Commit Graph

587 Commits (71663fafc192a5fd078ac40eb830821a93647a76)

Author SHA1 Message Date
Stephen Shelton 305795315b
Specify disabling RC gossiping (testing only) properly 4 years ago
Stephen Shelton 90ec789fe9
Avoid lokid in router hive 4 years ago
Stephen Shelton 0f074cff8c
Remove ambguity WRT loading and passing of Config 4 years ago
Stephen Shelton f607b99dbe
Fixes to Context::Configure with default config 4 years ago
Stephen Shelton fb75329b88
Update SessionEstablished function sig in test_iwp_session.cpp 4 years ago
Stephen Shelton 97c14d81fd
Refactor test_llarp_exit_context.cpp to remove C API usage 4 years ago
Stephen Shelton ec20d94c6b
Fix Context::Configure() 4 years ago
Stephen Shelton 343252c48d
Use HiveContext and HiveRouter properly 4 years ago
Stephen Shelton 552dcce5fd
Use inheritance to handle Hive injection 4 years ago
Stephen Shelton 1e95625f27
<3 apple -- avoid std::optional::value() 4 years ago
Stephen Shelton 186a35c0e2
Appease clang (fixes for minor compilation errors) 4 years ago
Stephen Shelton bdac43e19f
Peer stats test which artificially stops a router from gossiping its RC 4 years ago
Stephen Shelton 3b6f84c68c
Peek at peer stats db in test_peer_stats 4 years ago
Stephen Shelton d1b629f494
RouterHive ConnectionAttemptEvent 4 years ago
Stephen Shelton d69d538f1a
Add missing files 4 years ago
Stephen Shelton b2a72dd46a
Initial test_peer_stats hive test 4 years ago
Stephen Shelton a9ce319e76
Make llarp_time_t serializable in sqlite_orm 4 years ago
Stephen Shelton aa1c8f257f
Sort out peerstats receive <-> expiry windows 4 years ago
Stephen Shelton 5e05defc76
Add API query for peer stats, other related fixes 4 years ago
Stephen Shelton 595288e046
Add PeerDb::handleGossipedRC 4 years ago
Stephen Shelton 7109ddc951
Add PeerDb::modifyPeerStats() 4 years ago
Stephen Shelton cc6e9c882a
Use foo.snode as peerstats unique id, test file-backed db 4 years ago
Stephen Shelton a30806b375
Some sqlite_orm related fixes 4 years ago
Stephen Shelton 8adb6295fc
Initialize sqlite_orm and start interacting with it 4 years ago
Stephen Shelton 73c9ddff52
Begin peer stats infrastructure 4 years ago
Jason Rhinelander a7c42ab2bd
Use lokimq's hex/base32z encoding/decoding 4 years ago
Jason Rhinelander 271ded7a1f
Fix test variable scope
These variables need to persist past the end of the lambda and weren't;
release builds didn't seem to mind access the freed memory, but Debug
builds triggered failures.
4 years ago
Jeff Becker 8fc52fcbbe
increase test timeout 4 years ago
Jeff Becker c9a2222d39
Revert "bump submodules"
This reverts commit 0de2b994fa3e3252eae46d39960dd17872184050.
4 years ago
Jeff Becker 0f21eeccb0
* rework exit codepath to allow multiple exits
* rework net code for ip ranges to be cleaner
* clean up endpoint auth code
* refactor config to validate network configs before setting up endpoints
* remove buildone from path/pathbuilder.cpp so we don't spam connection attempts
4 years ago
Jeff Becker 2ef2e6171a
bump submodules 4 years ago
Jeff Becker 3cdca30a74
more auth shit 4 years ago
Jeff Becker 0d6e3bcd89
fix crashing tests 4 years ago
Jeff Becker 0787b6e2fd
load config differently for unit tests because they run as root in CI for some reason 4 years ago
Jeff Becker 98a3b45f16
disable logging to see why ci tests die like a sucka 4 years ago
Jeff Becker b6a7b5ccfb
only run catch2 tests in gdb and add assert to unit test 4 years ago
Jeff Becker e13e886df9
fix up event loop crap so that unit tests pass 4 years ago
Jeff Becker 456f9d4ba1
remove GNU-ism 4 years ago
Jeff Becker 0a889d7042
fix up iwp unit test 4 years ago
Jeff Becker e95b9d530e
fix unit tests, make them pass 4 years ago
Jeff Becker f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 4 years ago
Stephen Shelton 11951510bf
Remove libabyss and rpc::Caller/rpc::Server 4 years ago
Stephen Shelton 0aa43c6b07
Pass RuntimeOptions instead of 'bool isRelay' 4 years ago
Stephen Shelton b5d6a73ffd
Rip out most of C API 4 years ago
Jeff Becker 6984cda3a6
add pybind and router hive to ci 4 years ago
Jeff Becker b8e1ffa83e
add comments and improve the regression test 4 years ago
Jeff Becker 3d2990f90d
use llarp::LogSilencer to shut up loging in unit tests 4 years ago
Jeff Becker a73335579a
silence logging in regression test 4 years ago
Jeff Becker 800668348a
add regression test for key backup bug 4 years ago
Stephen Shelton 1497b829bd
Ignore our self.signed file if we're a client 4 years ago
Jeff Becker 328c7a398e
make sure event loop owns logic so that logic call does not use seperate thread 4 years ago
Jeff Becker 00143e63f4
put replay filters on transit hops to reduce retransmissions. 4 years ago
Jason Rhinelander d05e6716cb Remove llarp::str(string_view)
It was a workaround for pre-C++17 std::string which didn't support
passing a string_view to various functions/operators.  There's only one
place left that needs an explicit conversion, and that's where it is
used as a map key; so just be explicit there and remove llarp::str()
everywhere else.
4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 years ago
Jason Rhinelander bdc9c7bfa8 Move IPRange out of net.hpp; free up TruncateV6 etc.
- Move IPRange into its own net/ip_range.hpp

- Move the static net::IPPacket::TruncateV6, etc. functions to free
net::TruncateV6, etc. functions (now from net/ip.hpp instead of
net/ip_packet.hpp).

- Make net::TruncateV6 and net::ExpandV4 constexpr.

- Add IPRange::FromIPv4 factory function (to replace the iprange_ipv4
free function)
4 years ago
Stephen Shelton 807bfc5302
Initialize Config with LoadConfig in all key manager tests 4 years ago
Stephen Shelton fa6845b206
Use global RC file paths instead of redefining them 4 years ago
Stephen Shelton ac225eb65e
Testing: explicitly initialize variable 4 years ago
Stephen Shelton 7167b4ad02
Properly initialize config in unit test 4 years ago
Rick V 918a09c0cf fix sockaddr win32 and collapse headers on the unix side 4 years ago
Jason Rhinelander c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
4 years ago
Jason Rhinelander 26ecf23ad8 Silence various warnings 4 years ago
Jason Rhinelander bc4573c447 Disable empty string SockAddr throw test
The code intentionally no longer throws and handles this as a special
case (resulting in an empty SockAddr).
4 years ago
Jeff Becker 1780e86faa
fix up unit tests, make them all pass 4 years ago
Jeff a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
Bandaids for sockaddr refactor 2020 05 11
4 years ago
Stephen Shelton 174c9ec740
log-- 4 years ago
Stephen Shelton 78d09f2ae5
Support SockAddr in from sockaddr and friends 4 years ago
Stephen Shelton e944bcb28a
Unit tests and fixes for SockAddr::fromString() 4 years ago
Stephen Shelton 0b54087689
Begin implementing SockAddr 4 years ago
Stephen Shelton bcf473757d
Fix broken config-related test cases 4 years ago
Jeff Becker 635dc4fe13
unbreak router hive
llarp/config/config.cpp:
respect [network]:type option

llarp/handlers/exit.cpp:
when [network]:type is null dont init tun interface

llarp/service/context.cpp:
respect [network]:type option
change endpoint name back to "default"

llarp/tooling/router_hive.cpp:
dont use LogicCall for obtaining RCs from underlying relays, it crashes the mainloop and it's probably safe to readonly access RCs.

pybind/common.hpp:
remove typecasters as we use C++17 now

pybind/llarp/config.cpp:
remove SnappConfig
wire up NetworkConfig

pybind/llarp/handlers/pyhandler.hpp:
remove SnappConfig from constructor

pybind/llarp/handlers/pyhandler.cpp:
update constructor implementation to match header

test/hive/hive.py:
remove broke endpoint related code
wire up null endpoint option using NetworkConfig
use index at 0 for relays and clients instead of 1
dont add a python endpoint to all clients
4 years ago
Stephen Shelton 42a7bcd434
Less invasive fix for Addr 4 years ago
Stephen Shelton d3b248e004
Add test for broken Addr::from_char_array() 4 years ago
Stephen Shelton 779658edd0
Refactor ExitEndpoint's config, mv dns ops from [network] to [dns] 4 years ago
Stephen Shelton 21ad442b55
Remove NetConfig_t 4 years ago
Jason Rhinelander 1697bf90fe C++17
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
4 years ago
Stephen Shelton 5c6c7c7020
Expand on ConfigDefinition truthy/falsy unit test 4 years ago
Stephen Shelton 320564d792
Specialize ConfigOption for bool to accept "truthy" / "falsy" values 4 years ago
Stephen Shelton 936fbb2424
Fix config not falling back to undeclared handler for missing option 4 years ago
Stephen Shelton 526b1320b7
Some maybe-fixes for RouterHive post config cleanup 4 years ago
Stephen Shelton dfcf8fb62e
Update RouterHive to reflect config changes 4 years ago
Stephen Shelton 0a9515a94a
Proper support for multiple values @ ConfigDefinition 4 years ago
Stephen Shelton a6787657be
Refactor config comments to take list of strings 4 years ago
Stephen Shelton a8671cf9c7
Rename config classes for clarity
ConfigDefinition -> OptionDefiniton
Configuration -> ConfigDefinition
4 years ago
Stephen Shelton 9e850705b4
Add 'AssignmentAcceptor' convenience for simple config acceptors 4 years ago
Stephen Shelton 733efbab40
Reflect removal of accessors on config structs 4 years ago
Stephen Shelton 028e55e997
Remove pre-refactor config test 4 years ago
Stephen Shelton 14e7789847
Add padding to config file generated output 4 years ago
Stephen Shelton 18ee23c2a3
Support for comments in config definition 4 years ago
Stephen Shelton c5ff672c79
Use 'undeclared handler' for multi-valued 'add-node' config option 4 years ago
Stephen Shelton 9a1b7b20de
Add "undeclared value" handler to Configuration 4 years ago
Stephen Shelton e9708a5d1c
Add split(string_view, char) util function 4 years ago
Stephen Shelton ffc58fcedb
Remove dead code (serverOptions) 4 years ago
Stephen Shelton 2e47262350
Demystify LinksConfig 4 years ago
Stephen Shelton a44eb73baa
Add config INI output unit tests 4 years ago
Stephen Shelton 69331f1571
Remove multiValued as an argument to ConfigDefinition 4 years ago
Stephen Shelton f6d000838f
Clarity and convenience for defining config options 4 years ago
Stephen Shelton 02e31f3867
Introduce acceptor function in ConfigDefinition 4 years ago
Stephen Shelton 60d0bf2a9b
Rename function for clarity 4 years ago
Stephen Shelton 8352de7bd4
Config documentation, clarity 4 years ago