Commit Graph

36 Commits

Author SHA1 Message Date
Jason Rhinelander 9950adf472 Remove unneeded split(str, char) method
This function had a bug in stable (fixed in dev) when `last` returns
npos, but the function also appears to basically be duplicating what the
next split version can do, so this just removes it and uses the single
more generic split(strview, strview) method.
2021-08-11 00:26:52 -03:00
Jeff Becker e96ec156ea
add / remove route blackhole so we dont leak if we crash 2021-07-12 08:26:53 -04:00
Jeff Becker 6d12a7a712
fixes for android jni 2021-04-26 06:08:02 -04:00
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.
2021-03-09 19:01:41 -05:00
Jeff Becker bb9bd25059
get rid of use of llarp::IpAddress from hotpaths 2021-02-22 10:01:05 -05:00
Jeff Becker 1526941f3a
make it compile again 2021-02-17 07:49:47 -05:00
Jeff Becker 0600f42814
fix up names of functions to be less hidious. 2021-02-17 06:37:21 -05:00
Jeff Becker 1ee545d6d2
fix up macos route command for ipv6 2021-02-16 16:37:08 -05:00
Jeff Becker 35137913b9
windows and macos route pokers for ipv6 2021-02-16 15:01:07 -05:00
Jeff Becker 1c7079dbab
fix up route poking with lokinet to work with ipv6 2021-02-16 12:37:16 -05:00
Jeff Becker bd93a8f828
initial v6 exits 2021-02-16 10:59:57 -05:00
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 db7abe8f09
do /1 route poker split on linux (#1480)
* do /1 route poker split on linux

i hate netlink so god damn much

* use an enum class for the gateway mode
2020-11-16 13:33:45 -05:00
Jeff dad66c50cb
poke route hole for loopback on windows because that OS is made by brain damaged non programmers. (#1473)
this fixes the gui bug where it hangs on adding an exit becuase loopback gets routed over the exit.
before it was causing the lmq connection to hang becuase of that route change.
2020-11-16 12:16:38 -05:00
Thomas Winget a91bb35dbf
Some Windows fixes (#1415)
* Should fix some windows service issues

* fix return condition inversion

* Add some Trace level logging

also make the logger actually respect the log level you set.

* event loop should not queue things to itself...

at present, logic thread queue continues until it is empty, so
queueing things onto itself is just wasteful.

* call_later(foreach thing) is better than foreach thing (call later)

also if you already queued those things but they have not happened yet,
there is no sense to queue them to happen again.

* do not queue read on write finish, only on read finish

* failure to start DNS server should be proper startup failure.

without the DNS server working lokinet is...kinda pointless, right?

* format

* don't queue stuff to logic thread if in logic thread
the thing that clears the queue...clears it.  So you're just delaying and adding overhead.

* windows unbound thread sleep instead of just busy-waiting

also clang-format decided I can't have a blank line for some reason...

* fix unbound async worker on windows
2020-10-21 09:06:43 -04:00
Jeff 56f49a6980
make win32 exits work again (#1367) 2020-09-28 18:43:31 -04:00
Jeff Becker 7a18d14fde make it compile 2020-09-23 14:39:06 -03:00
Jeff a9d23d3ac3
use absolute path for route command (#1354)
* ignore tun interfaces on windows for mitigating foot cannons

* add flag for git add -p when using format verifier as git hook

* use explicit path for route command on windows

* fix typo

* fix typo

* remove hunk for win32 route exclusion based off being a tun interface

* add metric to win32 route command

* * refactor win32 route poking to use a common function for iterating over routes

* put interface in route poking for default route

* mnake it compile

* use correct route command on windows

* use fs::path for service::Identity::EnsureKeys
2020-09-23 07:06:11 -04:00
Jeff fe30193a97
revive android build system (#1339)
* it lives?

* clean up

* add readme and add x86_64 to abi filters

* disable route poking on android

* make it compile on android

* it compiles!!111

* typofix

* re-enable ccache for android
2020-09-22 15:04:15 -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
Jeff Becker 1b4f5ee5ea
add forgotten win32 header 2020-08-25 17:24:38 -04: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 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 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