Commit Graph

61 Commits

Author SHA1 Message Date
Jason Rhinelander
d02558350a
Crank oxen-mq to (1.2.)11; switch to oxen-encoding
- Update oxen-mq submodule to latest stable
- Add oxen-encoding submodule
- Convert all oxenmq encoding usage to oxenc
- Modernize cmake handling of oxenmq/oxenc
2022-02-17 16:30:17 -04:00
majestrate
838183e36e
Merge pull request #1748 from majestrate/liblokinet-udp-api-2021-09-19
liblokinet updates
2022-02-06 13:19:08 -05:00
Jeff
95efe8f4e5 bump ngtcp2 to v0.1.0 tag 2022-01-31 13:05:03 -05:00
Jeff Becker
b20e7bedf8 identify 2022-01-31 10:53:48 -05:00
Jeff Becker
5b8ebb269c changes for liblokinet-ffi
* cmake option BUILD_DAEMON for toggling building of daemon directory
* when WITH_BOOTSTRAP is OFF dont build curl or cpr
2022-01-31 10:53:48 -05:00
Jeff Becker
ec83641ee8
update submodule 2021-09-24 16:51:03 -04:00
Jeff Becker
3c61af1de9
bump ngtcp2 submodule 2021-09-24 16:51:03 -04:00
Jason Rhinelander
089fc026d8 Redo how we build ngtcp2 lib
ngtcp2's top-level CMakeLists.txt is not friendly to being used as a
subdirectory (for instance, it always adds a `check` target when cunit
is installed), so stop using it in favour of skipping directly into the
ngtcp2/lib subdir.

This requires some hackery to set up a couple of the things the
top-level cmake does, but it isn't *too* painful.
2021-09-10 15:12:57 -03:00
jeff
0708a0d897
initial network extension code for macos
probably does not work
2021-09-02 14:17:08 -04:00
Jason Rhinelander
d90b28ce24 Remove double cpr submodule
Fix cpr being listed twice in .gitmodules and submodule check.
2021-06-01 10:49:38 -03:00
Jason Rhinelander
ed1a80170a Update submodules and static build deps
Static deps:
- expat 2.3.0
- unbound 1.13.1
- sqlite 3.35.5
- libuv 1.41.0
- curl 7.76.1

Submodules:
- ghc-filesystem 1.5.4
- ngtcp2 (latest master)
- oxenmq 1.2.5
- pybind11 2.6.2
- sqlite_orm 1.6
2021-04-20 19:58:11 -03:00
Jeff Becker
83b0f25075
cleanup after rebase 2021-04-19 07:19:07 -04:00
Jeff Becker
c547cd0118
fixes for lokinet-bootstrap
* use schannel on windows platforms
* load ca bundle for non windows platforms
* use geteuid for detecting root user when finding default data dir
2021-04-19 07:08:23 -04:00
Jeff Becker
3d87dbff91
bullshit for windows and openssl with CPR
* windows static cross compile is wonky af so we add some hacks to make it work
2021-04-19 07:08:03 -04:00
Jeff Becker
ebdb9699c0
refactor: make lokinet-bootstrap a native executable
* pull in cpr
* tidy up windows.sh
* rename main.cpp to lokinet.cpp to satisfy my autism
* add llarp::GetDefaultBootstrap()
2021-04-19 07:06:15 -04:00
Jason Rhinelander
db2344505f
Update ngtcp2 2021-04-19 06:59:04 -04:00
Jason Rhinelander
a1a152b5c3
Disable building ngtcp2 example code 2021-04-19 06:59:04 -04:00
Jeff Becker
eb965c8323
fix link error in ngtcp2 2021-04-19 06:58:35 -04:00
Jeff Becker
1885b1cae9
more 2021-04-19 06:58:05 -04:00
Jason Rhinelander
46c619c49f
Move external/ cmake bits into external/CMakeLists.txt
- Move uvw target to external instead of llarp/CMakeLists.txt

- Add sqlite_orm headers via interface library rather than shoving it
  into the global include search path.

- Find sqlite3 as part of the sqlite_orm target deps rather than linking
  it separately.  (Also don't link it into lokinet-util, which doesn't
  appear to actually need it).
2021-04-19 06:57:45 -04:00
Jason Rhinelander
442fa951fc
Add ngtcp2 submodule 2021-04-19 06:56:26 -04:00
Jeff Becker
0c37cc7f60
lokinet-bootstrap native binary 2021-04-15 13:39:45 -04:00
Jason Rhinelander
e0bb7b7d0f Bump oxen-mq submodule to tagged 1.2.4 2021-03-09 15:45:50 -04:00
Jason Rhinelander
91d6698a9d Reformat with clang-format-11 2021-03-05 13:36:31 -04:00
Jason Rhinelander
ced035d401 Switch uvw to a fork with libuv backwards compat support 2021-03-04 16:51:18 -04:00
Jason Rhinelander
5b555ee5aa Replace libuv with uvw & related refactoring
- removes all the llarp_ev_* functions, replacing with methods/classes/functions in the llarp
  namespace.
- banish ev/ev.h to the void
- Passes various things by const lvalue ref, especially shared_ptr's that don't need to be copied
  (to avoid an atomic refcount increment/decrement).
- Add a llarp::UDPHandle abstract class for UDP handling
- Removes the UDP tick handler; code that needs tick can just do a separate handler on the event
  loop outside the UDP socket.
- Adds an "OwnedBuffer" which owns its own memory but is implicitly convertible to a llarp_buffer_t.
  This is mostly needed to take over ownership of buffers from uvw without copying them as,
  currently, uvw does its own allocation (pending some open upstream issues/PRs).
- Logic:
  - add `make_caller`/`call_forever`/`call_every` utility functions to abstract Call wrapping and
    dependent timed tasks.
  - Add inLogicThread() so that code can tell its inside the logic thread (typically for
    debugging assertions).
  - get rid of janky integer returns and dealing with cancellations on call_later: the other methods
    added here and the event loop code remove the need for them.
- Event loop:
  - redo everything with uvw instead of libuv
  - rename EventLoopWakeup::Wakeup to EventLoopWakeup::Trigger to better reflect what it does.
  - add EventLoopRepeater for repeated events, and replace the code that reschedules itself every
    time it is called with a repeater.
  - Split up `EventLoop::run()` into a non-virtual base method and abstract `run_loop()` methods;
    the base method does a couple extra setup/teardown things that don't need to be in the derived class.
  - udp_listen is replaced with ev->udp(...) which returns a new UDPHandle object rather that
    needing gross C-style-but-not-actually-C-compatible structs.
  - Remove unused register_poll_fd_(un)readable
  - Use shared_ptr for EventLoopWakeup rather than returning a raw pointer; uvw lets us not have to
    worry about having the event loop class maintain ownership of it.
  - Add factory EventLoop::create() function to create a default (uvw-based) event loop (previously
    this was one of the llarp_ev_blahblah unnamespaced functions).
  - ev_libuv: this is mostly rewritten; all of the glue code/structs, in particular, are gone as
    they are no longer needed with uvw.
- DNS:
  - Rename DnsHandler to DnsInterceptor to better describe what it does (this is the code that
    intercepts all DNS to the tun IP range for Android).
- endpoint:
  - remove unused "isolated network" code
  - remove distinct (but actually always the same) variables for router/endpoint logic objects
- llarp_buffer_t
  - make constructors type-safe against being called with points to non-size-1 values
- tun packet reading:
  - read all available packets off the device/file descriptor; previously we were reading one packet
    at a time then returning to the event loop to poll again.
  - ReadNextPacket() now returns a 0-size packet if the read would block (so that we can implement
    the previous point).
  - ReadNextPacket() now throws on I/O error
- Miscellaneous code cleanups/simplifications
2021-03-04 16:51:18 -04:00
Jeff Becker
60bfdacc23
get rid of the rest of gtest/gmock 2021-03-04 15:41:53 -05:00
Jeff Becker
979a652446
loki-mq -> oxen-mq 2021-03-01 07:57:57 -05:00
Jeff Becker
811b2a3fbf
bump submodule 2021-02-02 08:14:32 -05:00
Jeff
0ed8942dc6
libuv cmake fixups (#1511)
* fix up cmake parts for libuv
* make libuv use external project via StaticBuild.cmake
* remove libuv submodule
2021-01-16 19:11:28 -05:00
Jason Rhinelander
8dd5bd6899 Update to lokimq 1.2.2 for segfault-at-shutdown fix 2020-11-17 19:22:19 -04:00
Jason Rhinelander
e47b70a82f
CMake fixes: libuv static build, base_libs, shared lib install dir (#1431)
* Update how we build libuv

- Update submoduled libuv to latest stable (1.40.0)
- Don't look for a system libuv if we're under BUILD_STATIC_DEPS
- Add a libuv interface library rather than using globals
- Make the windows build fall back to the submodule if not explicitly
  given a LIBUV_ROOT

* Replace ${LIBS} global with `base_libs` interface

This simplifies linking and include handling a bit.

* Remove unneeded header

* Add missing csignal header

(This was previously being pulled in incredibly indirectly via some
stuff that eventually includes some other stuff that eventually included
uv.h)

* Use GNUInstallDirs to get lib dir instead of hard-coding lib

Fixes #1429
2020-10-28 18:26:43 -04:00
Jason Rhinelander
a888b7bbc2
Reduce macOS target to 10.12, and fix target for deps (#1414)
This is relatively painless for lokinet as it already had workarounds
during 0.8 dev work for the things macos hated in 10.13.

Dependencies, however, were not being built with the proper macos target
junk, so this fixes that.
2020-10-16 05:18:45 -04:00
Jason Rhinelander
60de84fde7
Try to build for 10.14 (#1412) 2020-10-14 07:32:24 -04:00
Jeff Becker
ac16cdc177 bump lokimq submodule to 1.2.0 2020-09-30 17:18:26 -03:00
Thomas Winget
15229ea7ff
New RC format (#1368)
* initial work for RC SRVs.

Needs tests for new RC format.

Needs SRVs added to new RC, and associated tests.

* convert rc sign/verify test to catch2, add test for new rc

Also fixes a mistake in new rc serialization

* bump loki-mq submodule

need support for viewing bt deserialize consumer buffer so we
know how much it has consumed.

* fix some behavior errors

need to advance llarp_buffer_t after consuming data from it

only rewind and modify size of llarp_buffer_t in owning context.

* Add test for router contact (de-)serialization

Adds a test that makes a list of RouterContact with mixed
versions and ensures it serializes and deserializes correctly.
2020-09-25 14:05:28 -04:00
Jason Rhinelander
f5e5066bd5
Update deps (#1348)
* Update submodules/static deps to latest versions

* Add mingw zmq build patch

* Drop support for Windows 2000
2020-09-16 15:47:35 -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
Jason Rhinelander
fd684a225b Update nlohmann to latest stable 2020-08-28 11:03:43 -03:00
Stephen Shelton
73c9ddff52
Begin peer stats infrastructure 2020-07-02 10:12:11 -06: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
92bb135a73
only bump loki-mq submodule 2020-07-02 11:13:30 -04:00
Jeff Becker
c9a2222d39
Revert "bump submodules"
This reverts commit 0de2b994fa3e3252eae46d39960dd17872184050.
2020-07-02 11:13:30 -04:00
Jeff Becker
2ef2e6171a
bump submodules 2020-07-02 11:13:30 -04:00
Jeff Becker
30b158b906
update submodule 2020-07-02 11:07:33 -04:00
Stephen Shelton
a7dceed4eb
Remove libabyss and rpc::Caller/rpc::Server 2020-07-02 11:07:31 -04:00
Stephen Shelton
c67db46b12
Add loki-mq as submodule 2020-07-02 11:07:30 -04: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
Jeff Becker
64157d5d44 track libcurl and libuv with cmake, add libuv submodule 2020-05-17 14:53:28 -03:00
Jason Rhinelander
1697bf90fe C++17
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
2020-05-01 17:43:27 -03:00