Commit Graph

4040 Commits

Author SHA1 Message Date
Jeff
a035dbdb9a enable peer stats by default 2020-09-19 09:56:47 -04:00
Jeff
78b40d6725 wire up lns gotnamemessage handler to kitchen sink 2020-09-19 09:29:36 -04:00
Jeff
21930cf667
LNS (#1342)
* initial relay side lns

* fix typo

* add reserved names and refactor test for dns

* lns name decryption

* all wired up (allegedly)

* refact to use service::EncryptedName for LNS responses to include nonce with ciphertext

* fully rwemove tag_lookup_job

* replace lns cache with DecayingHashTable

* check for lns name validity against the following rules:

* not localhost.loki, loki.loki, or snode.loki

* if it contains no dash then max 32 characters long, not including the .loki tld (and also assuming a leading subdomain has been stripped)

* These are from general DNS requirements, and also enforced in
registrations:

* Must be all [A-Za-z0-9-]. (A-Z will be lower-cased by the RPC call).

* cannot start or end with a -

* max 63 characters long if it does contain a dash

* cannot contain -- in the third and fourth characters unless it starts with xn--

* handle timeout in name lookup job by calling the right handler with std::nullopt
2020-09-17 15:18:08 -04:00
Jeff
c64c9093f2
make endpoints reachable by default (#1344) 2020-09-14 18:19:17 -04:00
Jeff
681459185f
remove locks (#1336)
* remove locks

* use tryPushBack to attempt to prevent deadlocks
2020-09-04 15:55:49 -04:00
Jeff
3ab7db7723
macos route poking (#1333)
* fix up macos route poker logic

* fix typo

* use string_view

* add forgotten header

* full paths

* add debugging

* catch exception on adding route

* workarround for macos

* typofix

* typofix

* fix for macos

* fix command for macos

* because we autopoke remove explicit route poking in rpc

* probably final fix of macos route poking

* split routes instead of deleting them

* dynamic route poking

* move log statement for introset lookup and dont consider bad sessions as able to send

* send convotag reset frame when we have no session

* add exit map to rpc

* use split_any
2020-09-03 18:22:22 -04:00
Jeff
60f4d96ba5
proper route poking (#1330)
* route poking:

* remove popen() call, replace with reading /proc/net/route for getting default route
* dynamically poke and unpoke routes on runtime

* swap intros and fix rpc endpoint for version to return what the ui expects

* use std::string::find_first_not_of instead of using a lambda
2020-09-01 17:22:22 -04:00
Thomas Winget
2c6e7b86c3
SRV records fixes (#1332)
* fix a log print log level

* correctly match SRV record service and protocol...

* tests for new dns question functions
2020-08-31 19:25:58 -04:00
Thomas Winget
b1c14af938
SRV Record handling for introsets (#1331)
* update loki-mq submodule for tuple support

* srv record reply implementation

still need to encode srv records into intro sets / router contacts
as well as decode from them and match against queried service.proto

* inverted condition fix in config code

* SRV record struct (de-)serialization for intro sets

* parsing and using srv records from config (for/in introsets)

* adopt str utils from core and use for srv parsing

* changes to repeat requests

no longer drop repeat requests on the floor, but do not make
an *actual* request for them if one is in progress.

do not call reply hook for each reply for a request, as
each userland request is actually made into several lokinet
requests and this would result in duplicate replies.

* fetch SRVs from introsets for .loki

* make format

* dns and srv fixes, srv appears to be working
2020-08-31 16:07:17 -04:00
jeff
1537ad18df format 2020-08-28 11:35:10 +00:00
jeff
75f550434c change assert to throw an exception instead when service node has no peer stats enable.
update unit tests so it passes on debian sid
2020-08-28 11:26:50 +00:00
jeff
52d20968a7 remove llarp::StrEq 2020-08-28 11:05:29 +00:00
jeff
5391e6a66a initial config overriding on runtime 2020-08-27 12:43:53 +00:00
jeff
e3bfe76f98 add exit auth token awareness to config 2020-08-27 07:12:56 -04:00
Jeff Becker
1b4f5ee5ea
add forgotten win32 header 2020-08-25 17:24:38 -04:00
jeff
39f5e7213f set send timeout to 5 seconds for exits 2020-08-25 19:00:05 +00:00
Jeff Becker
d39ed26ff0
add headers and fix type for windows 2020-08-25 10:12:40 -04:00
Jeff Becker
68e72d88fd
add forgotten header on macos 2020-08-25 09:51:39 -04:00
Jeff Becker
d4e1a44452
fix typo 2020-08-25 08:55:15 -04:00
Jeff Becker
184503dab1
change to unsigned char for CI 2020-08-25 08:48:35 -04:00
Jeff Becker
bc40453100
get rid of void pointer arithmatic and signed vs unsigned comparison 2020-08-25 08:41:38 -04:00
Jeff Becker
43a58b9c74
const correctness 2020-08-24 20:44:20 -04:00
Jeff Becker
d8dcffe80a
resolve conflict with dev 2020-08-24 20:27:47 -04:00
jeff
574a986d9a
explicitly set frame reset field to zero by default 2020-08-24 20:23:26 -04:00
jeff
f6f56029d3
working netlink route poker 2020-08-24 20:23:26 -04:00
jeff
668ddf837f
checks 2020-08-24 20:21:55 -04:00
jeff
e039aeb6d5
remove codepath for convotag invalidation 2020-08-24 20:21:55 -04:00
jeff
0c3b57199a
fix initialization 2020-08-24 20:21:55 -04:00
jeff
abc55924e7
forgot header 2020-08-24 20:21:55 -04:00
jeff
5a8884cc2f
uncomment block 2020-08-24 20:21:55 -04:00
jeff
8472aea93f
initial netlink jizz 2020-08-24 20:21:55 -04:00
jeff
b0bb0b7609
initial route poking 2020-08-24 20:21:55 -04:00
jeff
2e7f9d1b87
remove convo tag when we invalidate it 2020-08-24 20:21:18 -04:00
jeff
3fbc46879d
Revert "don't send protocol discard message on fail"
This reverts commit ee2a42118c88bd7778cd6dc8694564c7d10e60d1.
2020-08-24 20:21:18 -04:00
jeff
78a4d361ab
don't send protocol discard message on fail 2020-08-24 20:21:18 -04:00
jeff
30a6e901f5
add router.enable-peer-stats config option unconditionally 2020-08-24 20:21:18 -04:00
jeff
75f9643776
attempt to fix snode traffic ip rewrite bug 2020-08-24 20:19:52 -04:00
jeff
fac5502c55
if Router::SendToOrQueue fails propagate that failure in LRCM handler 2020-08-24 20:19:52 -04:00
jeff
b6d63968c4
* correct unit tests for exit context so they pass
* when providing an ip address for inbound links dont throw if they are valid
2020-08-24 20:19:52 -04:00
jeff
2aaed895f3
disable exits in RCs 2020-08-24 20:19:51 -04:00
Jeff Becker
3619356406
attempt fixing 100% cpu use on relays 2020-08-24 20:19:51 -04:00
Jeff Becker
ff130e2b5e
die if we are a relay and don't have any inbound links 2020-08-24 20:19:51 -04:00
Jeff Becker
8c3621cead
fix issue #1328 2020-08-24 20:19:51 -04:00
Jeff Becker
37e16291cb
working on linux with root 2020-08-24 20:19:48 -04:00
Jeff Becker
576c6ec9d4
fix serialize order of dict in peer stats and make the unit tests match this change 2020-08-24 20:19:48 -04:00
Jeff Becker
e9aa200e8c
make formatting happy 2020-08-24 20:19:48 -04:00
Rick V
5c34665fce
move win32 lokimq patch 2020-08-10 13:51:48 -05:00
Jeff Becker
4bb214eba0
attempt fix for libunbound on win32
* run unbound stuff in another thread because LOL windows
* because unbound runs in another thread callbacks for libunbound need to be wrapped in a deferred call so they are done in the logic thread
* bump sqlite3 dep because it's gone, repin hash.
2020-08-04 10:53:32 -04:00
Jeff Becker
301cb6d32f
fix issue #1320 (allow providing ip/port in bind section of config) 2020-07-30 10:36:36 -04:00
Stephen Shelton
83d337ddfd
Send response on error conditions in API request 2020-07-24 11:55:15 -06:00
Stephen Shelton
b037cf0ae4
Handle get_peer_stats request's list of router ids 2020-07-24 11:49:14 -06:00
Stephen Shelton
4699280d97
Crude attempt at retrying lokid connection 2020-07-23 10:54:39 -06:00
Stephen Shelton
1d9c337021
Grab lokimq::ConnectionID on connection attempt 2020-07-23 10:53:34 -06:00
Stephen Shelton
eedf7ca599
Add implementation of get_peer_stats API 2020-07-20 13:48:57 -06:00
Stephen Shelton
bbc1cd5a31
Stub out get_peer_stats LMQ API request 2020-07-16 16:48:26 -06:00
Stephen Shelton
c07dcaa2ef
Handle service node privkeys response correctly 2020-07-16 16:48:04 -06:00
Stephen Shelton
acb0248f94
Use LMQ request instead of command for lokid ping 2020-07-16 16:46:59 -06:00
Stephen Shelton
9deee9e542
Add bencoding serialization to PeerStats 2020-07-09 13:06:31 -06:00
Stephen Shelton
159447b984
Don't "safely" visit relays in RouterHive 2020-07-06 18:11:15 -06:00
Stephen Shelton
305795315b
Specify disabling RC gossiping (testing only) properly 2020-07-06 17:38:41 -06:00
Stephen Shelton
0f074cff8c
Remove ambguity WRT loading and passing of Config 2020-07-06 13:38:02 -06:00
Stephen Shelton
f607b99dbe
Fixes to Context::Configure with default config 2020-07-02 12:25:16 -06:00
Stephen Shelton
ced2ac64fb
Remove last remnants of 'worker' 2020-07-02 11:25:53 -06:00
Stephen Shelton
cdaa28bfd3
Use QueueDiskIO instead of diskworker for db flushing 2020-07-02 10:36:12 -06:00
Stephen Shelton
88c3e9ce00
Remove worker thread parameter from Router constructors 2020-07-02 10:35:44 -06:00
Stephen Shelton
ec20d94c6b
Fix Context::Configure() 2020-07-02 10:26:53 -06:00
Stephen Shelton
ed47ba998f
Minor fixes around Context 2020-07-02 10:26:52 -06:00
Stephen Shelton
552dcce5fd
Use inheritance to handle Hive injection 2020-07-02 10:25:10 -06:00
Stephen Shelton
b0d8568452
Remove llarp C API usage from RouterHive 2020-07-02 10:24:19 -06:00
Stephen Shelton
84c83a2400
Add specialized subclass of Router for Hive 2020-07-02 10:22:57 -06:00
Stephen Shelton
e38a507551
<3 Windows (prefer fs::path::string() over native()) 2020-07-02 10:22:07 -06:00
Stephen Shelton
93bafcf142
Set up sqlite3 deps 'if NOT TAGRET sqlite3' 2020-07-02 10:22:06 -06:00
Stephen Shelton
186a35c0e2
Appease clang (fixes for minor compilation errors) 2020-07-02 10:22:06 -06:00
Stephen Shelton
fd230dd93b
<3 apple 2020-07-02 10:22:05 -06:00
Stephen Shelton
6e1a23cdc7
Use pkg_check_modules instead of find_package for sqlite3 2020-07-02 10:22:05 -06:00
Stephen Shelton
0ecdda7a89
make format 2020-07-02 10:22:04 -06:00
Stephen Shelton
4aa6f8e2df
Use find_package() for sqlite3 2020-07-02 10:22:04 -06:00
Stephen Shelton
aeb0c2be3a
Remove ability to stop routers from gossiping for now 2020-07-02 10:22:03 -06:00
Stephen Shelton
bdac43e19f
Peer stats test which artificially stops a router from gossiping its RC 2020-07-02 10:22:03 -06:00
Stephen Shelton
63f41d6a98
Introduce mutex for hive's routers 2020-07-02 10:22:03 -06:00
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