Commit Graph

26 Commits (871c3e3281d15ce876fcd85a02228b4e70453bac)

Author SHA1 Message Date
Jeff 871c3e3281
changeset for windows port
* wintun vpn platform for windows
* bundle config snippets into nsis installer for exit node, keyfile persisting, reduced hops mode.
* use wintun for vpn platform
* isolate all windows platform specific code into their own compilation units and libraries
* split up internal libraries into more specific components
* rename liblokinet.a target to liblokinet-amalgum.a to elimiate ambiguity with liblokinet.so
* DNS platform for win32
* rename llarp/ev/ev_libuv.{c,h}pp to llarp/ev/libuv.{c,h}pp as the old name was idiotic
* split up net platform into win32 and posix specific compilation units
* rename lokinet_init.c to easter_eggs.cpp as that is what they are for and it does not need to be a c compilation target
* add cmake option STRIP_SYMBOLS for seperating out debug symbols for windows builds
* intercept dns traffic on all interfaces on windows using windivert and feed it into lokinet
2 years ago
Jeff baddad9564
remove compat wrapper 2 years ago
Jeff 74362149eb
refactor dns subsystem
we want to be able to have multiple locally bound dns sockets in lokinet so
i restructured most of the dns subsystem in order to make this easier.

specifically, we have a new structure to dns subsystem:

* dns::QueryJob_Base

base type for holding a dns query and response with virtual methods
in charge of sending a reply to whoever requested.

* dns::PacketSource_Base

base type for reading and writing dns messages to and from wherever they came from

* dns::Resolver_Base

base type for filtering and handling of dns messages asynchronously.

* dns::Server

contextualized per endpoint dns object, responsible for all dns related isms.

this change hides all impelementation details of all of the dns components.
adds some more helper functions for parsing dns and dealing with OwnedBuffer.

overall dns becomes less of a pain with this new structure. probably.
2 years ago
Jeff b3d9cd463f route poker: allow not blackholing routes.
allow runtime configuration to disable ip blackholing.
2 years ago
majestrate 2c44ffe85b
Update llarp/router/route_poker.cpp
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
2 years ago
Jeff 27ba3e044d
prevent segfault in route poker if Init() is not called 2 years ago
Jeff Becker 14ffdb6639
configurable route poker
this allows you to use exit nodes without forcing routes over the interface, useful for using lokinet with an exit and selectively routing over the lokinet interface using an external socks proxy or binding to device explicitly.

* make route poker configurable, defaults to enabled but allows disabling it on runtime if desired
* add config option [network]:auto-routing to enable/disable route poker
2 years ago
Jeff Becker 64cd2990bc
remove old routing table maniuplation code 3 years ago
Jeff Becker 0871862452
initial routing table refactor
* move routing table manipulation to vpn platform
* add initial linux implementation of vpn platform route manipulation
3 years ago
Jeff Becker e96ec156ea
add / remove route blackhole so we dont leak if we crash 3 years ago
Jeff Becker a24b82119b
fix #1655
* make it so that we don't set up unbound resolver when we have no resolvers provided by config
* clean up dns codepath and make it use llarp::SockAddr instead of llarp::IpAddress
3 years ago
Jeff ef28de8c9f
Merge pull request #1610 from majestrate/android-fixes-2021-04-26
Android fixes
3 years ago
Jason Rhinelander 4ef25ef679 Add systemd-resolved dynamic DNS updating
Wires up systemd support to configure DNS on startup and when
enabling/disabling exit mode.

On startup (and when turning off an exit) we tell systemd-resolved to
direct .loki and .snode lookups to lokinet (leaving other DNS traffic
alone).

On exit enabling, we reconfigure it to resolve "." (i.e. the root DNS
domain) so that all lookups come into it.
3 years ago
Jeff Becker 6d12a7a712
fixes for android jni 3 years ago
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
3 years ago
Jeff Becker bb9bd25059
get rid of use of llarp::IpAddress from hotpaths 3 years ago
Jeff Becker dc68ff6de9
prevent bad side effects, dont use iterator after use and use operator[] 3 years ago
Jeff Becker b2b68c413c
actually set disabled when disabiling route poker 3 years ago
Jeff Becker b484d9bebb
update route poker logic to include "up" 3 years ago
Jeff Becker 07b599430e
thaw router when connectivity changes 3 years ago
Jeff Becker bd93a8f828
initial v6 exits 3 years ago
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
3 years ago
Jeff c81b6049f1
fix crashes on shutdown (#1433) 4 years ago
Thomas Winget df36ed953d
Route Poker changes (#1416)
If not using an exit, messing with the routing table is not good.
As such, the ability to keep track of routes we *might* want is good,
but the ability to set/unset those routes is necessary, to correspond
to enabling/disabling exit functionality.
4 years ago
Jeff 8943be6c3a
serialize auth codes in rpc (#1369)
* serialize auth codes in rpc

* format

* format

* config and route fixups

* bump lokimq

* fix compile

* discard unknown members in service keys

* format
4 years ago
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
4 years ago