Commit Graph

149 Commits

Author SHA1 Message Date
Jeff Becker
301cb6d32f
fix issue #1320 (allow providing ip/port in bind section of config) 2020-07-30 10:36:36 -04: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
0f21eeccb0
* rework exit codepath to allow multiple exits
* rework net code for ip ranges to be cleaner
* clean up endpoint auth code
* refactor config to validate network configs before setting up endpoints
* remove buildone from path/pathbuilder.cpp so we don't spam connection attempts
2020-07-02 11:13:30 -04:00
Jeff Becker
3cdca30a74
more auth shit 2020-07-02 11:13:30 -04:00
Jeff Becker
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04:00
Rick V
a787db9b35 fix ipv4_hdr 2020-06-12 17:34:53 -05:00
Jeff Becker
114bdd5ce5
add move and copy constructors/assigment operators to ip_address 2020-05-23 16:07:20 -04:00
Jeff Becker
6af498092b
exit traffic via loki addresses 2020-05-23 16:07:19 -04:00
Jason Rhinelander
3bb24580a4 make format 2020-05-20 19:48:13 -03:00
Jason Rhinelander
ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
2020-05-20 19:18:28 -03:00
Jason Rhinelander
7f9160bb6e Untangle some interdependencies
macOS doing a shared library build is not working without untangling
some of the interdependencies.  This commit does that, at least enough
to get macOS to compile.

This isn't the cleanest as currently implemented (we have some net/
things in `liblokinet-platform` and some in `liblokinet`, and likewise
ev/vpnio.cpp is in `liblokinet` while the rest of `ev/*` is in
`liblokinet-platform`).
2020-05-20 19:18:28 -03:00
Jason Rhinelander
97088719e0 Avoid reserved __identifiers
Identifier names with `__` in them are reserved for the implementation.
One leading underscore followed by a lower-case letter is fine though
(leading underscore followed by *upper*-case is, however, also
reserved).
2020-05-20 19:18:28 -03:00
Jason Rhinelander
60d704b25d Remove dead code 2020-05-20 19:18:28 -03:00
Jason Rhinelander
f9bbc30c3d IsIPv4Bogon: constexpr array instead of a function-local static vector
The fixed-size array + not needing to do an atomic operation in the
function should allow better compiler optimization.

(And with C++17 the type and size are inferred).
2020-05-20 19:18:27 -03:00
Jason Rhinelander
bdc9c7bfa8 Move IPRange out of net.hpp; free up TruncateV6 etc.
- Move IPRange into its own net/ip_range.hpp

- Move the static net::IPPacket::TruncateV6, etc. functions to free
net::TruncateV6, etc. functions (now from net/ip.hpp instead of
net/ip_packet.hpp).

- Make net::TruncateV6 and net::ExpandV4 constexpr.

- Add IPRange::FromIPv4 factory function (to replace the iprange_ipv4
free function)
2020-05-20 19:18:27 -03:00
Jason Rhinelander
72bf215da4 Move IPPacket header (part 1)
Rename net/ip.{cpp,hpp} to net/ip_packet.{cpp,hpp}.

(Doing this in two commits because I want to repurpose ip.hpp/ip.cpp,
and want git to figure out the history properly).
2020-05-20 19:18:27 -03:00
Rick V
918a09c0cf fix sockaddr win32 and collapse headers on the unix side 2020-05-18 15:13:45 -05:00
Jason Rhinelander
a45bec7c4f Removed RPI definition
This was a long-obsolete fix for things that don't matter anymore.
2020-05-17 21:28:25 -03:00
Jason Rhinelander
26ecf23ad8 Silence various warnings 2020-05-17 21:28:17 -03:00
Jeff Becker
fc5b28b66f
const correctness 2020-05-15 14:07:22 -04:00
Jeff Becker
1780e86faa
fix up unit tests, make them all pass 2020-05-15 08:38:04 -04:00
Stephen Shelton
4dd4327f36
IpAddress::toString() support for IPv6 2020-05-11 14:52:30 -06:00
Stephen Shelton
043f993e41
Return stream in operator<<(stream, IpAddress) 2020-05-11 14:47:09 -06:00
Stephen Shelton
0a40892867
Implement SockAddr operator<() and operator==() 2020-05-11 11:55:36 -06:00
Stephen Shelton
1c7d57f207
Don't forget to return 2020-05-11 11:42:38 -06:00
Stephen Shelton
c0f58c8159
Properly read in ExitInfo's address 2020-05-11 10:46:53 -06:00
Stephen Shelton
e85105e738
Implement SockAddr's operator<<ostream 2020-05-11 10:17:41 -06:00
Stephen Shelton
dfe71309f1
Add to/from in6_addr to SockAddr 2020-05-11 10:14:07 -06:00
Stephen Shelton
fd145d6eeb
Make FIXME throws uniquely identifiable 2020-05-11 10:00:03 -06:00
Stephen Shelton
839fb42ba4
Hard code RPC's expectedHostname to 'localhost' 2020-05-11 09:47:26 -06:00
Stephen Shelton
0cd5d7a060
Derp 2020-05-11 09:22:42 -06:00
Stephen Shelton
cd44caccaf
Attempt to get this SockAddr refactor up and running 2020-05-11 09:11:44 -06:00
Stephen Shelton
78d09f2ae5
Support SockAddr in from sockaddr and friends 2020-05-08 16:52:00 -06:00
Stephen Shelton
e944bcb28a
Unit tests and fixes for SockAddr::fromString() 2020-05-08 14:33:44 -06:00
Stephen Shelton
0b54087689
Begin implementing SockAddr 2020-05-08 11:23:21 -06:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
Stephen Shelton
1cab83ad01
Expand upon IpAddress header, take in feedback 2020-05-04 15:36:08 -06:00
Stephen Shelton
dff170712f
Gut Addr, replace with stubbed SockAddr and IpAddress 2020-05-04 15:17:16 -06:00
Jeff Becker
7e4fdc5b0e
check for zero address for bogons 2020-05-04 15:05:33 -04:00
Jeff Becker
f1edca9fa1
additional cleanup of cruft 2020-05-04 14:39:14 -04:00
Jeff Becker
e33a1a2e0f
proper autodetect of ifname and ifaddr 2020-05-04 12:51:57 -04:00
Stephen Shelton
42a7bcd434
Less invasive fix for Addr 2020-05-04 11:08:25 -04: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
Rick V
df634b7775
remove a ton of ded win32 code 2020-04-20 19:05:53 -05: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
Jeff Becker
7ba30eec25
squash commits 2020-03-11 16:55:12 -04:00
Linux User
fd23fd6894
32-bit linux patches 2020-02-25 15:48:07 -06:00
Jason Rhinelander
27025030ce Renamed uint128.h -> uint128.hpp 2020-02-24 14:27:44 -04:00
Jason Rhinelander
3fedd5ba6b Avoid wrong-order initialization on big endian 2020-02-24 14:27:44 -04:00
Jason Rhinelander
2093f94244 Make uint128_t use big/little endian layout internally
Thus if someone wants to memcpy out of it it will have the expected
endianness of the internal data.
2020-02-24 14:27:44 -04:00