Commit Graph

6780 Commits (59891d5d5fe1167ed81a7b1611a73661d13b9281)
 

Author SHA1 Message Date
Jeff Becker 59891d5d5f
wire up snode traffic to quic 3 years ago
Jeff Becker 58bec09232
fix compile error 3 years ago
Jason Rhinelander 752879d712
QUIC lokinet integration refactor
Refactors how quic packets get handled: the actual tunnels now live in
tunnel.hpp's TunnelManager which holds and manages all the quic<->tcp
tunnelling.  service::Endpoint now holds a TunnelManager rather than a
quic::Server.  We only need one quic server, but we need a separate quic
client instance per outgoing quic tunnel, and TunnelManager handles all
that glue now.

Adds QUIC packet handling to get to the right tunnel code.  This
required multiplexing incoming quic packets, as follows:

Adds a very small quic tunnel packet header of 4 bytes:

    [1, SPORT, ECN] for client->server packets, where SPORT is our
    source "port" (really: just a uint16_t unique quic instance
    identifier)

or

    [2, DPORT, ECN] for server->client packets where the DPORT is the SPORT
    from above.

(This also reworks ECN bits to get properly carried over lokinet.)

We don't need a destination/source port for the server-side because
there is only ever one quic server (and we know we're going to it when
the first byte of the header is 1).

Removes the config option for quic exposing ports; a full lokinet will
simply accept anything incoming on quic and tunnel it to the requested
port on the the local endpoint IP (this handler will come in a following
commit).

Replace ConvoTags with full addresses: we need to carry the port, as
well, which the ConvoTag can't give us, so change those to more general
SockAddrs from which we can extract both the ConvoTag *and* the port.

Add a pending connection queue along with new quic-side handlers to call
when a stream becomes available (TunnelManager uses this to wire up
pending incoming conns with quic streams as streams open up).

Completely get rid of tunnel_server/tunnel_client.cpp code; it is now
moved to tunnel.hpp.

Add listen()/forget() methods in TunnelManager for setting up quic
listening sockets (for liblokinet usage).

Add open()/close() methods in TunnelManager for spinning up new quic
clients for outgoing quic connections.
3 years ago
Jason Rhinelander 158ea4a951
Add isIPv4/isIPv6 to SockAddr 3 years ago
Jason Rhinelander 2ca7ef7f5f
Rename isRouter -> isSNode
The isRouter wording was quite confusing, especially in a call such as:

    router->Configure(config, opts.isRouter, nodedb)
3 years ago
Jason Rhinelander 1d6ad7284c
Fix cursed formatting 3 years ago
Jason Rhinelander d588f777c7
Fix logging of std::byte values
They were failing to compile if output because implicit integer
promotion doesn't work for std::byte's (but rather needs an explicit
std::to_integer call).
3 years ago
Jason Rhinelander e27fdf4c9a
Simplify/unify SendTo* methods
Overload them to the same name to make it easier to call and/or visit
them with either a RouterID, Address, Variant, or ConvoTag.
3 years ago
Jason Rhinelander 104f63543f
Change MaybeGetLoop to a virtual member func
Minor simplification.
3 years ago
Jeff Becker a1a1b2e2bc
remove superflous include 3 years ago
Jeff Becker a61f846d33
* add convotags to ensure path to snode
* add service::Endpoint::EnsurePathTo which gives you a std::optional<Convotag>
3 years ago
Jeff Becker fe32475cad
use more variants 3 years ago
Jeff Becker 9d483a12db
* add protocol type to snode traffic
* make path::PathSet::SendPacketToRemote know about protocol type
3 years ago
Jeff Becker e4ca7ce4de
get rid of uneeded type 3 years ago
Jeff Becker 618881e65c
update ngtcp2 address/path structs 3 years ago
Jeff Becker eb965c8323
fix link error in ngtcp2 3 years ago
Jeff Becker fc9b09bdbc
clean up address/ip management code to use std::variant and std::optional 3 years ago
Jeff Becker 1885b1cae9
more 3 years ago
Jeff Becker 4446f2fc16
fix and format.
* start moving quic code to use lokinet internals
3 years ago
Jason Rhinelander 39d31df059
no-op LogTrace(); print chars as ints
- LogTrace() (and LogTraceTag, etc.) are now no-ops for release builds.
(hoping there are no side effects in trace logging!)
- renamed llarp::_Log to llarp::_log because _Log is a reserved keyword
- change logging code to implicitly convert 1-byte types (char, unsigned
char, uint8_t) to ints so that we print them as numeric values rather
than raw chars because, more often than not, printing a single char is
trying to log an 8-bit value.
3 years ago
Jason Rhinelander b61bd82b4b
Add llarp::buffer_printer for pretty buffer logs 3 years ago
Jason Rhinelander 818b4042e9
Migrate plainquic logging to llarp logging 3 years ago
Jason Rhinelander 5d897781ef
Replace custom random with llarp/sodium random 3 years ago
Jason Rhinelander aa0f54fa07
WIP plainquic tunnels 3 years ago
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).
3 years ago
Jason Rhinelander 442fa951fc
Add ngtcp2 submodule 3 years ago
Jason Rhinelander 9df6cd74c7
Add draft liblokinet TCP-over-QUIC design doc 3 years ago
Jeff Becker 8ee80bc13d
don't build liblokinet in android we have liblokinet-android for that 3 years ago
Jeff Becker 079604c6cf
get rid of deprecated vpnio code in android 3 years ago
Jeff Becker b45a268dbc
fix windows dll link-ism 3 years ago
Jeff Becker 2fa7a54e86
fix pybind layer compile errors from missing llarp.h header 3 years ago
Jeff Becker e4841917ba
redo cmake parts
* add liblokinet.so target
* make every library we build except liblokinet.so static
* wire up parts of liblokinet
3 years ago
Jeff Becker affd2e23f7
flesh out lokinet.h more 3 years ago
Jeff Becker 414c2d42e6
add lokinet.h header for liblokinet api 3 years ago
Jeff Becker e11249d158
remove llarp.h header references 3 years ago
Jeff Becker 9e2cfd90cb
remove unneeded header 3 years ago
Jeff Becker a6715a1f75
remove old vpnio bits 3 years ago
Jeff Becker c92894804c
Merge remote-tracking branch 'origin/stable' into dev 3 years ago
Jeff Becker 68826f10bb use binary mode for writing files 3 years ago
Jeff 9f2f9e0f05
Merge pull request #1598 from majestrate/cherry-pick-for-stable-2021-04-15
new logos and new lokinet-bootstrap backport for stable
3 years ago
Jeff Becker 4daebc0141
catch exception and print out error 3 years ago
Jeff Becker a0d3ab125a
throw on failed writing and port fs namespace changes from oxen-core 3 years ago
Jeff Becker 6cde9062b5
build lokinet-android target only on android 3 years ago
Jeff Becker a80d8b95b3
update lokinet-bootstrap
* compat with old shell script curl wrapper's arguments
* do lazy validation of fetched data
3 years ago
Jeff Becker 77de60af91
require openssl explicitly for lokinet-bootstrap 3 years ago
Jeff Becker 27c80a2638
add include directory for daemon directory so llarp/* includes work 3 years ago
Jeff Becker e8178a032e
lokinet-bootstrap native binary 3 years ago
Jeff Becker 3af465bb5f
rebrand and bump version 3 years ago
Jeff 6e05f7ad13
Merge pull request #1597 from majestrate/lokinet-bootstrap-native-2021-04-15
Lokinet bootstrap native binary
3 years ago
Jeff Becker 0c37cc7f60
lokinet-bootstrap native binary 3 years ago