Commit Graph

4060 Commits

Author SHA1 Message Date
Stephen Shelton
3b6f84c68c
Peek at peer stats db in test_peer_stats 2020-07-02 10:22:02 -06:00
Stephen Shelton
c4cbbd6731
RouterHive: store router contexts by routerId instead of index 2020-07-02 10:22:02 -06:00
Stephen Shelton
d1b629f494
RouterHive ConnectionAttemptEvent 2020-07-02 10:22:02 -06:00
Stephen Shelton
d69d538f1a
Add missing files 2020-07-02 10:16:19 -06:00
Stephen Shelton
b2a72dd46a
Initial test_peer_stats hive test 2020-07-02 10:16:19 -06:00
Stephen Shelton
2453fff10b
Piggyback on link callbacks to add peer stats 2020-07-02 10:13:26 -06:00
Stephen Shelton
cb8e5354f5
Add some breadcrumbs about how ILinkLayer's callbacks are used 2020-07-02 10:13:26 -06:00
Stephen Shelton
c9faddc8e4
Use fs::path since mac doesn't support std::filesystem 2020-07-02 10:13:25 -06:00
Stephen Shelton
5a8f390b3b
Make mutex mutable, fix typo 2020-07-02 10:13:25 -06:00
Stephen Shelton
023e061146
Make [router]:enable-peer-stats only valid for client 2020-07-02 10:13:25 -06:00
Stephen Shelton
54017652d6
log-- 2020-07-02 10:13:24 -06:00
Stephen Shelton
d897099e1d
Track traffic peerstats 2020-07-02 10:13:24 -06:00
Stephen Shelton
77b98459dd
Implement RouterID serialization in sqlite_orm 2020-07-02 10:13:24 -06:00
Stephen Shelton
a9ce319e76
Make llarp_time_t serializable in sqlite_orm 2020-07-02 10:13:23 -06:00
Stephen Shelton
aa1c8f257f
Sort out peerstats receive <-> expiry windows 2020-07-02 10:13:23 -06:00
Stephen Shelton
4b4284ccf4
PeerDb sqlite optimizations 2020-07-02 10:13:23 -06:00
Stephen Shelton
5e05defc76
Add API query for peer stats, other related fixes 2020-07-02 10:13:22 -06:00
Stephen Shelton
595288e046
Add PeerDb::handleGossipedRC 2020-07-02 10:13:22 -06:00
Stephen Shelton
7109ddc951
Add PeerDb::modifyPeerStats() 2020-07-02 10:13:21 -06:00
Stephen Shelton
4f4192e272
constexpr 2020-07-02 10:13:21 -06:00
Stephen Shelton
2a30e7dac2
Add PeerDb to Router 2020-07-02 10:13:21 -06:00
Stephen Shelton
cc6e9c882a
Use foo.snode as peerstats unique id, test file-backed db 2020-07-02 10:12:14 -06:00
Stephen Shelton
a30806b375
Some sqlite_orm related fixes 2020-07-02 10:12:14 -06:00
Stephen Shelton
8adb6295fc
Initialize sqlite_orm and start interacting with it 2020-07-02 10:12:13 -06:00
Stephen Shelton
73c9ddff52
Begin peer stats infrastructure 2020-07-02 10:12:11 -06:00
Jeff Becker
2c0c6aa819
log error instead of executing job 2020-07-02 12:05:39 -04:00
Jeff Becker
d7ff6c579c
address feedback from jason
* split up ipv6 netmask
* revert iwp ack interval change
* c++17-isms in ip range map
* lambda-ize nodedb
* mutable lambdas in transit hops
* perfect forwarding of args in abstract router
* mutable lambdas in lokid rpc client
* notes in readme about nproc
2020-07-02 11:13:32 -04:00
Jeff Becker
d85c7bc628
remove wrapper and just use a lambda that throws on non empty value 2020-07-02 11:13:32 -04:00
Jeff Becker
a0dc2e795c
add a wrapper that always throws with a custom error message
use that wrapper for lokid.jsonrpc
2020-07-02 11:13:32 -04:00
Jeff Becker
a9109aa91b
* deprecate old unused lokid rpc options
* use lokimq::address in config and in lokid rpc
* bump lokimq submodule
2020-07-02 11:13:31 -04:00
Jeff Becker
80919a3b76
address feedback.
* use exceptions when fetching identity key instead of std::optional, will throw on fail
* fix up config options for endpoint auth and add better docs
* add llarp::serive::AuthType enum for controlling what kind of endpoint auth to use
2020-07-02 11:13:31 -04:00
Jason Rhinelander
a7c42ab2bd
Use lokimq's hex/base32z encoding/decoding 2020-07-02 11:13:31 -04:00
Jeff Becker
e85efcf7ce
move include so it's included on all platforms including windows 2020-07-02 11:13:30 -04:00
Jeff Becker
00aa78c80a
it's safe to call reply from another thread because all it does is fufill a promoise 2020-07-02 11:13:30 -04:00
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
2020-07-02 11:13:30 -04:00
Jeff Becker
3cdca30a74
more auth shit 2020-07-02 11:13:30 -04:00
Jeff Becker
0d6e3bcd89
fix crashing tests 2020-07-02 11:13:30 -04:00
Jeff Becker
98a3b45f16
disable logging to see why ci tests die like a sucka 2020-07-02 11:12:50 -04:00
Jeff Becker
63b56d55a9
check pw and pw_dir to be not null so that if either are null it bails to else block 2020-07-02 11:12:06 -04:00
Jeff Becker
2371e416bd
dont use $HOME when checking for default data dir 2020-07-02 11:12:05 -04:00
Jeff Becker
e13e886df9
fix up event loop crap so that unit tests pass 2020-07-02 11:10:06 -04:00
Jeff Becker
e95b9d530e
fix unit tests, make them pass 2020-07-02 11:10:06 -04:00
Jeff Becker
1779f33506
fix makefile fromat target
use lokimq::address instead of std::string or std::string_view
2020-07-02 11:07:34 -04:00
Jeff Becker
ca9e015ca4
virtual destructor 2020-07-02 11:07:34 -04:00
Jeff Becker
397d558af8
wtf 2020-07-02 11:07:34 -04:00
Jeff Becker
59eb1b0842
make format 2020-07-02 11:07:34 -04:00
Jeff Becker
f1e7fc2cba
make format and update submodule 2020-07-02 11:07:34 -04:00
Jeff Becker
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04:00
Jeff Becker
5abf111159
endpoint auth whitelist 2020-07-02 11:07:33 -04:00
Jeff Becker
9f11b03016
enable exit node again 2020-07-02 11:07:33 -04:00
Jeff Becker
a42d3d51c3
more 2020-07-02 11:07:33 -04:00
Jeff Becker
1e8368b636
make it compile 2020-07-02 11:07:33 -04:00
Jeff Becker
61c5808765
exit authentication (initial) 2020-07-02 11:07:33 -04:00
Jeff Becker
be01808a6b
more 2020-07-02 11:07:33 -04:00
Jeff Becker
c5dbb670ca
set sane defaults for config, implement lmq rpc server, update lokinetmon 2020-07-02 11:07:33 -04:00
Jeff Becker
6bbf7beaf5
add stubs for lmq rpc server 2020-07-02 11:07:33 -04:00
Jeff Becker
1175a583d2
initial working code 2020-07-02 11:07:32 -04:00
Stephen Shelton
13b0a4f2fc
WIP: LokidRpcClient 2020-07-02 11:07:32 -04:00
Jeff Becker
9bfff61d08
initial wack at lokimq 2020-07-02 11:07:32 -04:00
Stephen Shelton
fd4b03f896
WIP: LokidRpcClient 2020-07-02 11:07:32 -04:00
Stephen Shelton
17026a0b21
Remove libabyss and rpc::Caller/rpc::Server 2020-07-02 11:07:32 -04:00
Jeff Becker
749c5a813c
require at least 2 hops because otherwise stuff wont publish 2020-07-02 11:07:32 -04:00
Jeff Becker
d5b4dbe052
more 2020-07-02 11:07:32 -04:00
Jeff Becker
b1259e25c5
set sane defaults for config, implement lmq rpc server, update lokinetmon 2020-07-02 11:07:31 -04:00
Jeff Becker
fb8b8e2e56
add stubs for lmq rpc server 2020-07-02 11:07:31 -04:00
Jeff Becker
ad882d0d70
initial working code 2020-07-02 11:07:31 -04:00
Stephen Shelton
78256e3228
WIP: LokidRpcClient 2020-07-02 11:07:31 -04:00
Jeff Becker
0006751d80
initial wack at lokimq 2020-07-02 11:07:31 -04:00
Stephen Shelton
91725a8530
WIP: LokidRpcClient 2020-07-02 11:07:31 -04:00
Stephen Shelton
11951510bf
Remove libabyss and rpc::Caller/rpc::Server 2020-07-02 11:07:30 -04:00
Stephen Shelton
0aa43c6b07
Pass RuntimeOptions instead of 'bool isRelay' 2020-07-01 08:38:56 -06:00
Stephen Shelton
daecd6eda5
Remove llarp_config and llarp_main 2020-06-29 14:51:13 -06:00
Stephen Shelton
d85e48c9d0
Use llarp::Context::CallSafe() for vpn AsyncClose() 2020-06-29 14:39:31 -06:00
Stephen Shelton
b5d6a73ffd
Rip out most of C API 2020-06-29 13:55:59 -06:00
Thomas Winget
32843510bb libunbound can now be built as a static dep 2020-06-15 18:44:59 -04:00
Thomas Winget
8f0330c9f2 std::vector instead of std::array 2020-06-15 18:32:57 -04:00
Thomas Winget
b875d40491 restructure how upstream dns replies are handled
llarp::dns::Message does not fully support DNS packets,
so converting the upstream response to one will not work
for all query types.  Also it is kinda silly to begin with,
as the upstream reply is already a network packet, ready to go.
2020-06-15 18:32:57 -04:00
Thomas Winget
221e9ff5de make format 2020-06-15 18:32:57 -04:00
Thomas Winget
df284cb757 proper CMake finding and using of libunbound 2020-06-15 18:32:57 -04:00
Thomas Winget
c2a30692cf Implement upstream DNS using libunbound 2020-06-15 18:32:57 -04:00
Rick V
dc52f8c2fe remove stray path separator 2020-06-12 20:50:00 -05:00
Rick V
2fe4c15792 why jeff why 2020-06-12 18:00:39 -05:00
Rick V
a787db9b35 fix ipv4_hdr 2020-06-12 17:34:53 -05:00
Rick V
6d5155def4
jeff pls 2020-06-12 17:13:19 -05:00
Jeff Becker
6984cda3a6
add pybind and router hive to ci 2020-06-08 15:50:12 -04:00
Jeff Becker
3358a3371e
restore correct logstream 2020-06-08 09:31:09 -04:00
Jeff Becker
3d2990f90d
use llarp::LogSilencer to shut up loging in unit tests 2020-06-08 09:26:53 -04:00
Jeff Becker
a73335579a
silence logging in regression test 2020-06-08 09:07:49 -04:00
Jeff Becker
800668348a
add regression test for key backup bug 2020-06-08 08:42:10 -04:00
Jeff Becker
019168fef0
remove unused local variable 2020-06-05 11:40:19 -04:00
Jeff Becker
1899debfb5
unfug transit hops 2020-06-05 11:40:18 -04:00
Stephen Shelton
193060d602
Undo client-related changes to RC creation
This partially reverts changes from
1497b829bd and intsead only prevents
clients from saving their RC to disk.
2020-06-04 15:02:05 -06:00
Jeff
098df580e8
Merge pull request #1298 from majestrate/unfug-transit-hops-2020-06-04
Unfug transit hops
2020-06-04 16:23:47 -04:00
Jeff Becker
9fb681eb7c
typo 2020-06-04 16:16:07 -04:00
Jeff Becker
fe1dae8f30
fix transit hop job queuing 2020-06-04 15:48:32 -04:00
Stephen Shelton
980853804d
Remove log statement 2020-06-04 13:34:15 -06:00
Stephen Shelton
cecafb3215
Undo unintentional revert? 2020-06-04 13:32:38 -06:00
Stephen Shelton
43ffe23f66
Remove obnoxious log statement 2020-06-04 13:21:05 -06:00
Stephen Shelton
d8b12ce764
Let KeyManager assemble key filenames 2020-06-04 12:38:35 -06:00
Stephen Shelton
1497b829bd
Ignore our self.signed file if we're a client 2020-06-04 11:05:23 -06:00
Jeff
bb14b44bcf
Merge pull request #1296 from majestrate/fix-one-hop-path-building-2020-06-02
fix one hop mode path builds
2020-06-02 11:29:51 -04:00
Jeff Becker
ac26037c34
when in 1 hop mode we where hitting a case where we were failing to build paths
this was because we were trying to diversify the endpoints used which is not
appicable in 1 hop mode because first hops are sticky.
2020-06-02 07:14:13 -04:00
Stephen Shelton
91a2af0eda
Sanity checks around shared_from_this() 2020-06-01 14:56:58 -06:00
Jeff
45cda241f0
Merge pull request #1272 from majestrate/exit-nodes-2020-05-16
exit traffic via snapps
2020-06-01 14:42:43 -04:00
Jeff Becker
f40ffc0fd6
simplify header for tom. 2020-06-01 13:58:45 -04:00
Jeff Becker
95e55a2544
consistent spelling and use std::max 2020-06-01 13:31:12 -04:00
Jeff Becker
c6885ec285
remove Endpoint::GetExitRouters() 2020-06-01 09:35:21 -04:00
Jeff Becker
44c790b65c
revert back to for loop for simplicity 2020-06-01 09:23:17 -04:00
Jeff Becker
acecb23eb3
make libuv event loop logic queue size configurable.
remove logic constructor that is no-op.
add constant for default logic queue size
add constant for transit hop queue size
2020-06-01 09:17:44 -04:00
Rick V
1340cd0dce remove some string conversions entirely 2020-05-26 23:09:16 -05:00
Rick V
5529371637 RouterContact::[Read|Write] now take a fs::path const ref 2020-05-26 22:39:01 -05:00
Rick V
f62214cf8c
first pass fix wstring path conversions 2020-05-26 20:48:07 -05:00
Jeff Becker
c47a210302
remove a std::move that prevents copy elision 2020-05-26 14:04:43 -04:00
Jeff Becker
f25e9bb01f
use std::list here too 2020-05-24 08:51:17 -04:00
Jeff Becker
db00d080f6
use std::list instead of std::vector because idfk man 2020-05-24 08:36:46 -04:00
Jeff Becker
9298313066
use std::move 2020-05-24 08:21:04 -04:00
Jeff Becker
96cbab33c3
style: put iterator erase in for loop update 2020-05-24 08:15:36 -04:00
Jeff Becker
44ff3a9928
copy assignment so we don't crash 2020-05-24 08:14:08 -04:00
Jeff Becker
149a01c80f
dont use std::bind, use lambda 2020-05-24 08:07:37 -04:00
Jeff Becker
403bc74493
unbreak unit tests 2020-05-24 07:06:27 -04:00
Jeff Becker
f0eca908a4
use static_assert instead 2020-05-23 17:18:00 -04:00
Jeff Becker
4ad8ae253d
align to either 64bit or max_align_t which ever is smaller, for 32 bit. 2020-05-23 17:06:04 -04:00
Jeff Becker
7a5c193e4f
remove unused member 2020-05-23 16:55:02 -04:00
Jeff Becker
25a4bbd5ca
use std::swap 2020-05-23 16:07:21 -04:00
Jeff Becker
4a378ae934
remove logic thread from logic as it is now a thin wrapper arround the event loop 2020-05-23 16:07:21 -04:00
Jeff Becker
eb0abbf1ff
add eraseif to decaying hashset 2020-05-23 16:07:21 -04:00
Jeff Becker
39f8f17b53
dont set callback if non provided 2020-05-23 16:07:21 -04:00
Jeff Becker
1230b81517
make format 2020-05-23 16:07:21 -04:00
Jeff Becker
b8da447053
use const iterators explicitly 2020-05-23 16:07:21 -04:00
Jeff Becker
b8d262573a
use std::vector instead of thrashing heap with allocation 2020-05-23 16:07:20 -04:00
Jeff Becker
c826d0a0b1
increase transit hop limits 2020-05-23 16:07:20 -04:00
Jeff Becker
3a776b3ed1
bounds checks and such 2020-05-23 16:07:20 -04:00
Jeff Becker
a45f92dca7
use random good path for outbound traffic so that it uses an even spread accross
all paths
2020-05-23 16:07:20 -04:00
Jeff Becker
382e4215a8
path testing interval increase to reduce bandwidth use 2020-05-23 16:07:20 -04:00
Jeff Becker
00143e63f4
put replay filters on transit hops to reduce retransmissions. 2020-05-23 16:07:20 -04:00
Jeff Becker
114bdd5ce5
add move and copy constructors/assigment operators to ip_address 2020-05-23 16:07:20 -04:00
Jeff Becker
3eb006f78c
iwp/libuv cleanup: remove llarp_pkt_list and all users of it as it's broke 2020-05-23 16:07:19 -04:00
Jeff Becker
6af498092b
exit traffic via loki addresses 2020-05-23 16:07:19 -04:00
Jason Rhinelander
854619f04f Workaround for ghc::filesystem (mac) compatibility 2020-05-21 17:21:04 -03:00
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.
2020-05-21 17:05:30 -03:00
Jason Rhinelander
3bb24580a4 make format 2020-05-20 19:48:13 -03:00
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().
2020-05-20 19:18:28 -03:00
Jason Rhinelander
7f9160bb6e Untangle some interdependencies
macOS doing a shared library build is not working without untangling
some of the interdependencies.  This commit does that, at least enough
to get macOS to compile.

This isn't the cleanest as currently implemented (we have some net/
things in `liblokinet-platform` and some in `liblokinet`, and likewise
ev/vpnio.cpp is in `liblokinet` while the rest of `ev/*` is in
`liblokinet-platform`).
2020-05-20 19:18:28 -03:00
Jason Rhinelander
97088719e0 Avoid reserved __identifiers
Identifier names with `__` in them are reserved for the implementation.
One leading underscore followed by a lower-case letter is fine though
(leading underscore followed by *upper*-case is, however, also
reserved).
2020-05-20 19:18:28 -03:00
Jason Rhinelander
60d704b25d Remove dead code 2020-05-20 19:18:28 -03:00
Jason Rhinelander
f9bbc30c3d IsIPv4Bogon: constexpr array instead of a function-local static vector
The fixed-size array + not needing to do an atomic operation in the
function should allow better compiler optimization.

(And with C++17 the type and size are inferred).
2020-05-20 19:18:27 -03:00
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)
2020-05-20 19:18:27 -03:00
Jason Rhinelander
72bf215da4 Move IPPacket header (part 1)
Rename net/ip.{cpp,hpp} to net/ip_packet.{cpp,hpp}.

(Doing this in two commits because I want to repurpose ip.hpp/ip.cpp,
and want git to figure out the history properly).
2020-05-20 19:18:27 -03:00
Jason Rhinelander
be9ddf2ae1 Bring back ghc::filesystem for broke AF macos
macOS doesn't provide `<filesystem>` support when targetting anything
earlier than 10.15.
2020-05-20 19:18:27 -03:00
Stephen Shelton
ffdeca5378
Initialize all primitive values in Config 2020-05-20 15:54:23 -06:00
Stephen Shelton
ac225eb65e
Testing: explicitly initialize variable 2020-05-20 15:54:22 -06:00
Jason Rhinelander
604501b07f Fix cmake curl definition 2020-05-18 23:49:30 -03:00
Jeff
abc127a78a
Merge pull request #1276 from despair86/sockaddr-fix
fix sockaddr on win32
2020-05-18 16:16:04 -04:00
Rick V
918a09c0cf fix sockaddr win32 and collapse headers on the unix side 2020-05-18 15:13:45 -05:00
Jason Rhinelander
28362fd6a6 Clean up curl define
It doesn't have to be win32-specific, we could (for example) use this on
mac as well to build without curl/SN support.
2020-05-18 15:35:13 -03:00
Jason Rhinelander
856cf82c0e Only link curl if we set up a curl target
Should fix win32 (which doesn't link to curl).
2020-05-18 15:11:13 -03:00
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).
2020-05-17 23:31:23 -03:00
Jason Rhinelander
ab4ee954b9 Remove DEBIAN option
This hasn't been used in a long time; the debian packaging lives in
separate branches instead.
2020-05-17 21:29:05 -03:00
Jason Rhinelander
a45bec7c4f Removed RPI definition
This was a long-obsolete fix for things that don't matter anymore.
2020-05-17 21:28:25 -03:00
Jason Rhinelander
26ecf23ad8 Silence various warnings 2020-05-17 21:28:17 -03:00
Jason Rhinelander
e03dfc751c Remove crypto_noop
It isn't used anywhere, and has bitrotted (it is marked final, but is
missing some required abstract method instances).
2020-05-17 17:08:11 -03:00
Jeff Becker
fc5b28b66f
const correctness 2020-05-15 14:07:22 -04:00
Jeff Becker
e56faba23d
make format 2020-05-15 09:07:28 -04:00
Jeff Becker
1780e86faa
fix up unit tests, make them all pass 2020-05-15 08:38:04 -04:00
Jeff Becker
f04407f183
use only 1 uv_async_t for event loop wakeups
flush logic calls in there too as this was causing unit tests to hang
2020-05-15 08:36:38 -04:00
Jeff
ad9edc4ecf
Merge pull request #1266 from majestrate/issue-1264-fix-setting-upstream-dns-2020-05-14
default to port 53 in dns section entries
2020-05-14 13:58:30 -04:00
Stephen Shelton
ed31cdaacf
Cosmetic fixes 2020-05-14 11:51:27 -06:00
Jeff Becker
555b9721ce
keyfile was being initialized before being set by configure call.
this made it so that snapps always use ephemeral keys.
this fixes this.
2020-05-14 13:45:27 -04:00
Jeff Becker
09a356a8a4
dont use static local lambda 2020-05-14 13:30:23 -04:00
Jeff Becker
edb5c9e873
keyfile was being initialized before being set by configure call.
this made it so that snapps always use ephemeral keys.
this fixes this.
2020-05-14 13:26:36 -04:00
Jeff Becker
ebed21c392
DRY 2020-05-14 12:33:37 -04:00
Jeff Becker
3753dfbddb
IpAddresses in dns section config were not defaulting to port 53 when no port was provided.
Fixes #1264
2020-05-14 08:14:19 -04:00
Jason Rhinelander
6686668b48 Annotate netid mismatch message with (theirs)/(ours)
Every time I see this I don't know which one is wrong.  This helps.
2020-05-13 22:36:15 -03:00
Jason Rhinelander
dccc663f31 Miss Match demands her name be removed from the code
(i.e. fix speeling mistack: missmatch -> mismatch)
2020-05-13 22:35:15 -03:00
Jeff
e6a85d7176
Merge pull request #1263 from jagerman/c++17-niceties
C++17 niceties
2020-05-12 16:07:27 -04:00
Jason Rhinelander
e470a6d73e C++17 niceties
- class template argument deduction lets us write `std::unique_lock
  foo{mutex}` instead of `std::unique_lock<mutex_type> foo{mutex}` which
  makes the `unique_lock` and `shared_lock` functions unnecessary.

- Replace GNU-specific warn_unused_result attribute with C++17-standard
  [[nodiscard]]

- Remove pre-C++17 workaround code for fold expressions, void_t
2020-05-12 16:42:35 -03:00
Jeff
a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
Bandaids for sockaddr refactor 2020 05 11
2020-05-12 12:04:59 -04:00
Stephen Shelton
4dd4327f36
IpAddress::toString() support for IPv6 2020-05-11 14:52:30 -06:00
Stephen Shelton
043f993e41
Return stream in operator<<(stream, IpAddress) 2020-05-11 14:47:09 -06:00
Stephen Shelton
0a40892867
Implement SockAddr operator<() and operator==() 2020-05-11 11:55:36 -06:00
Stephen Shelton
1c7d57f207
Don't forget to return 2020-05-11 11:42:38 -06:00
Stephen Shelton
c0f58c8159
Properly read in ExitInfo's address 2020-05-11 10:46:53 -06:00
Stephen Shelton
e85105e738
Implement SockAddr's operator<<ostream 2020-05-11 10:17:41 -06:00
Stephen Shelton
dfe71309f1
Add to/from in6_addr to SockAddr 2020-05-11 10:14:07 -06:00
Stephen Shelton
fd145d6eeb
Make FIXME throws uniquely identifiable 2020-05-11 10:00:03 -06:00
Stephen Shelton
839fb42ba4
Hard code RPC's expectedHostname to 'localhost' 2020-05-11 09:47:26 -06:00
Stephen Shelton
0cd5d7a060
Derp 2020-05-11 09:22:42 -06:00
Stephen Shelton
cd44caccaf
Attempt to get this SockAddr refactor up and running 2020-05-11 09:11:44 -06:00
Stephen Shelton
78d09f2ae5
Support SockAddr in from sockaddr and friends 2020-05-08 16:52:00 -06:00
Stephen Shelton
e944bcb28a
Unit tests and fixes for SockAddr::fromString() 2020-05-08 14:33:44 -06:00
Stephen Shelton
0b54087689
Begin implementing SockAddr 2020-05-08 11:23:21 -06:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
Jeff Becker
01cc2c86bf
format 2020-05-06 11:37:15 -04:00
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
2020-05-06 10:45:30 -04:00
Stephen Shelton
1cab83ad01
Expand upon IpAddress header, take in feedback 2020-05-04 15:36:08 -06:00
Stephen Shelton
dff170712f
Gut Addr, replace with stubbed SockAddr and IpAddress 2020-05-04 15:17:16 -06:00
Jeff Becker
7e4fdc5b0e
check for zero address for bogons 2020-05-04 15:05:33 -04:00
Jeff Becker
f1edca9fa1
additional cleanup of cruft 2020-05-04 14:39:14 -04:00
Jeff Becker
c425355a6b
set data dir in in loadconfig too 2020-05-04 13:32:10 -04:00
Jeff Becker
f307c25d3e
set datadir path when giving filename for config 2020-05-04 13:30:58 -04:00