Jason Rhinelander
60d704b25d
Remove dead code
4 years ago
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).
4 years ago
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)
4 years ago
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).
4 years ago
Rick V
918a09c0cf
fix sockaddr win32 and collapse headers on the unix side
4 years ago
Jason Rhinelander
a45bec7c4f
Removed RPI definition
...
This was a long-obsolete fix for things that don't matter anymore.
4 years ago
Jason Rhinelander
26ecf23ad8
Silence various warnings
4 years ago
Jeff Becker
fc5b28b66f
const correctness
4 years ago
Jeff Becker
1780e86faa
fix up unit tests, make them all pass
4 years ago
Stephen Shelton
4dd4327f36
IpAddress::toString() support for IPv6
4 years ago
Stephen Shelton
043f993e41
Return stream in operator<<(stream, IpAddress)
4 years ago
Stephen Shelton
0a40892867
Implement SockAddr operator<() and operator==()
4 years ago
Stephen Shelton
1c7d57f207
Don't forget to return
4 years ago
Stephen Shelton
c0f58c8159
Properly read in ExitInfo's address
4 years ago
Stephen Shelton
e85105e738
Implement SockAddr's operator<<ostream
4 years ago
Stephen Shelton
dfe71309f1
Add to/from in6_addr to SockAddr
4 years ago
Stephen Shelton
fd145d6eeb
Make FIXME throws uniquely identifiable
4 years ago
Stephen Shelton
839fb42ba4
Hard code RPC's expectedHostname to 'localhost'
4 years ago
Stephen Shelton
0cd5d7a060
Derp
4 years ago
Stephen Shelton
cd44caccaf
Attempt to get this SockAddr refactor up and running
4 years ago
Stephen Shelton
78d09f2ae5
Support SockAddr in from sockaddr and friends
4 years ago
Stephen Shelton
e944bcb28a
Unit tests and fixes for SockAddr::fromString()
4 years ago
Stephen Shelton
0b54087689
Begin implementing SockAddr
4 years ago
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr
4 years ago
Stephen Shelton
1cab83ad01
Expand upon IpAddress header, take in feedback
4 years ago
Stephen Shelton
dff170712f
Gut Addr, replace with stubbed SockAddr and IpAddress
4 years ago
Jeff Becker
7e4fdc5b0e
check for zero address for bogons
4 years ago
Jeff Becker
f1edca9fa1
additional cleanup of cruft
4 years ago
Jeff Becker
e33a1a2e0f
proper autodetect of ifname and ifaddr
4 years ago
Stephen Shelton
42a7bcd434
Less invasive fix for Addr
4 years ago
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.
4 years ago
Rick V
df634b7775
remove a ton of ded win32 code
5 years ago
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.
5 years ago
Jeff Becker
7ba30eec25
squash commits
5 years ago
Linux User
fd23fd6894
32-bit linux patches
5 years ago
Jason Rhinelander
27025030ce
Renamed uint128.h -> uint128.hpp
5 years ago
Jason Rhinelander
3fedd5ba6b
Avoid wrong-order initialization on big endian
5 years ago
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.
5 years ago
Jason Rhinelander
454abb4f9f
Avoid copies in mutators
...
Reimplement operators in terms of mutators, rather than vice versa, so
that mutators don't have to make a copy.
5 years ago
Jason Rhinelander
4207a7cfa3
Rewrite In6ToHUInt to be endian agnostic
5 years ago
Jason Rhinelander
0839c16f19
Final abseil purge
...
Bye-bye Google Boost.
5 years ago
Jason Rhinelander
54186c4a89
Replace absl string_view with string_view from lokimq
...
When we add loki-mq has a dependency we can just alias it, but for now
it's easier to copy the header than add the whole submodule library.
5 years ago
Jason Rhinelander
3be7eb789b
Endian defines fix for macOS
...
It seems `__BYTE_ORDER`/`__LITTLE_ENDIAN`/`__BIG_ENDIAN` aren't defined
on macOS, so `if __BYTE_ORDER == __BIG_ENDIAN` was true which made macOS
take the big endian path *twice* (which cancelled out the big endian
conversion).
This makes util/endian.hpp define __LITTLE_ENDIAN__ or __BIG_ENDIAN__
everywhere, and errors if it can't be set.
5 years ago
Jason Rhinelander
9283aac4b6
Big endian fixes
5 years ago
Jeff Becker
a96fd645c5
remove side effect from address detection assert
5 years ago
Jeff Becker
8817e7fe21
fix include
5 years ago
Jeff Becker
c9d38d421b
clang fixes
5 years ago
Jeff Becker
4f87a95f66
fixes for travis
5 years ago
Stephen Shelton
93b8832026
Merge branch 'dev' into private-keys-backup-support
5 years ago
Jeff Becker
0828307906
fix address mapping bug
5 years ago