Commit Graph

65 Commits

Author SHA1 Message Date
Jeff Becker
df4ea34a56
nodedb refactor
* bump zmq static dep
* lokimq -> oxenmq
* llarp_nodedb -> llarp::NodeDB
* remove all crufty api parts of NodeDB
* make NodeDB rc selection api not suck
* make path builder api not suck
* propagate all above changes so that unit tests work and it all compiles
2021-02-02 09:35:40 -05:00
Jeff
49b9ad7197
tun code refactor (#1495)
* partial tun code refactor

* take out the trash

* move vpn platform code into llarp/vpn/platform.cpp

* fix hive build

* fix win32

* fix memory leak on win32

* reduce cpu use

* make macos compile

* win32 patches:

* use wepoll for zmq
* use all cores on windows iocp read loop

* fix zmq patch for windows

* clean up cmake for win32

* add uninstall before reinstall option to win32 installer

* more ipv6 stuff

* make it compile

* fix up route poker

* remove an unneeded code block in macos wtf

* always use call to system

* fix route poker behavior on macos

* disable ipv6 on windows for now

* cpu perf improvement:

* colease calls to Router::PumpLL to 1 per event loop wakeup

* set up THEN add addresses

* emulate proactor event loop on win32

* remove excessively verbose error message

* fix issue #1499

* exclude uv_poll from win32 so that it can start up

* update logtag to include directory

* create minidump on windows if there was a crash

* make windows happy

* use dmp suffix on minidump files

* typo fix

* address feedback from jason
* use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR
* quote $@ in apply-patches in case path has spaces in it

* address feedback from tom

* remove llarp/ev/pipe
* add comments for clairification
* make event loop queue size constant named
2021-01-11 18:13:22 -05:00
Jeff
252692a55b
dont poke routes if we have no exit (#1352)
* * refactor route poking out of llarp::Router and into llarp::RoutePoker
* only poke routes when we have an exit enabled as a client

* add route_poker header so it compiles
2020-09-23 20:28:38 -04:00
jeff
5391e6a66a initial config overriding on runtime 2020-08-27 12:43:53 +00:00
jeff
f6f56029d3
working netlink route poker 2020-08-24 20:23:26 -04:00
Stephen Shelton
0f074cff8c
Remove ambguity WRT loading and passing of Config 2020-07-06 13:38:02 -06:00
Stephen Shelton
552dcce5fd
Use inheritance to handle Hive injection 2020-07-02 10:25:10 -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
595288e046
Add PeerDb::handleGossipedRC 2020-07-02 10:13:22 -06: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
e13e886df9
fix up event loop crap so that unit tests pass 2020-07-02 11:10:06 -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
ad882d0d70
initial working code 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
1497b829bd
Ignore our self.signed file if we're a client 2020-06-04 11:05:23 -06:00
Stephen Shelton
273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
2020-04-07 12:38:56 -06:00
Stephen Shelton
ea835405c5
Refactor NotifyRouterEvent() to forward args, event code cleanup
This template-ifies Router::NotifyRouterEvent() up so that it accepts
the arguments to instantiate the specified event type, forwarding them
to std::make_unique. This would allow (in the future) the function to
no-op the call and avoid memory allocation. It also slightly reduces
the amount of code required to fire an event.

This commit also simplifies some of the RouterEvent code to reduce
redundancy.
2020-03-12 11:50:46 -06:00
Thomas Winget
84a1d7dbcc clang format....... 2020-03-06 20:20:11 -05:00
Thomas Winget
f712acc486 huzzah it builds, time to test soon! 2020-03-03 19:57:09 -05:00
Jeff Becker
da79b14703 make it compile 2020-03-03 19:57:09 -05:00
Thomas Winget
8dc5dabe49 working toward compilation, still has include issue 2020-03-03 19:57:09 -05:00
Thomas Winget
8d03e6dd3c more router hive stuff, read below the fold
Router now has a hive pointer if LOKINET_HIVE is set.
llarp::Context has a method InjectHive to give Router the pointer.
Router has a method NotifyRouterEvent which does:
  - when LOKINET_HIVE is set, passes the event to RouterHive
  - else when LOKINET_DEBUG is set, prints the event at a low log level
  - else NOP
2020-03-03 19:57:09 -05:00
Thomas Winget
74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 2020-02-20 16:57:48 -05:00
Thomas Winget
fc56a018e5 path builder prints hops, rest print short name 2020-02-20 16:37:39 -05:00
Jeff Becker
ea3851d15f
rc gossiping 2020-02-12 12:10:48 -05:00
Stephen Shelton
fba12093ac
Remove dead code (AbstractRouter::EnsureRouter()) 2020-01-22 11:15:40 -07:00
Jeff Becker
e5f92eaa79
only ping lokid if a service node 2020-01-07 12:58:49 -05:00
Jeff Becker
f56e543d75
add deadlock checker and revert bencode change from long ago 2019-12-07 14:58:19 -05:00
Stephen Shelton
2c6226f54a Backup SNApp keys when migrating to new ed25519 crypto 2019-12-06 11:21:14 -07:00
jeff
58a25602f5 more fixes, implemenmt missing functions 2019-10-09 09:08:38 -04:00
Michael
15cb49c9bd
Introduce --background to only start JSON RPC
fixes #853
2019-10-04 10:32:52 +01:00
Thomas Winget
38fd0552d3 Adds Link-Relay Status Messages
Success case:
  - the path endpoint creates and sends a LR_StatusMessage upon
    successful path creation

Failure case:
  - an intermediate hop creates and sends a LR_StatusMessage upon
    failure to forward the path to the next hop for any reason

Both cases:
  - transit hops receive LR_StatusMessages and add a frame
    to them reflecting their "status" with respect to that path
  - the path creator receives LR_StatusMessages and decrypts/parses
    the LR_StatusRecord frames from the path hops.  If all is good,
    the Path does as it would when receiving a PathConfirmMessage.
    If not, the Path marks the new path as failed.

LR_StatusMessage is now used/sent in place of PathConfirmMessage
2019-07-25 17:46:56 -04:00
Thomas Winget
baf8019fe5 Refactor Router code into more classes
This commit refactors functionality from the Router class into separate,
dedicated classes.
There are a few behavior changes that came as a result of discussion on
what the correct behavior should be.
In addition, many things Router was previously doing can now be provided
callback functions to alert the calling point when the asynchronous
action completes, successfully or otherwise.
2019-07-25 14:11:02 -04:00
Jeff Becker
b9bcc2b775
make threadpool consice 2019-07-09 09:47:24 -04:00
Jeff Becker
9ec41b8831
update RC expiration logic, lookup more often and remove stale entries 2019-06-10 08:47:21 -04:00
Jeff Becker
762a0c534f
Merge remote-tracking branch 'origin/master' 2019-05-29 08:09:02 -04:00
Michael
491fee206b
Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
Jeff Becker
2897141036
make format and introduce new function EnsureRouter on router to check nodedb or do dht lookup 2019-05-28 07:35:26 -04:00
Jeff Becker
a375f1103f
explicitly lookup router if not connected to it on LRCM forward. 2019-05-27 15:01:09 -04:00
Jeff Becker
64c7ed42fc
make format 2019-05-22 12:20:50 -04:00
Jeff Becker
9c96aecf3f
move llarp::Logic to std::shared_ptr
add sequence numbers to HSD messages

begin work on network isolation code

add more docs
2019-05-22 12:20:03 -04:00
Michael
636bb2a17d
Convert router diskworker to use a modern ThreadPool 2019-05-18 23:04:08 +01:00
Jeff Becker
ecc39428f6
count routers correctly 2019-05-09 11:36:39 -04:00
Jeff Becker
d423ee02d2
use shared_ptr 2019-05-03 09:15:03 -04:00
Jeff Becker
bb47d612b3
more 2019-04-30 12:07:17 -04:00
Jeff Becker
3a8cb0bfb5
add shell based hooks for service::Endpoint, also make format 2019-04-22 08:25:25 -04:00