1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

make format

This commit is contained in:
Jason Rhinelander 2020-05-20 19:48:13 -03:00
parent a2d46eda1e
commit 3bb24580a4
15 changed files with 24 additions and 28 deletions

View file

@ -159,8 +159,7 @@ namespace llarp
if (pkt.IsV6())
pkt.UpdateIPv6Address(src, m_IP);
else
pkt.UpdateIPv4Address(
xhtonl(net::TruncateV6(src)), xhtonl(net::TruncateV6(m_IP)));
pkt.UpdateIPv4Address(xhtonl(net::TruncateV6(src)), xhtonl(net::TruncateV6(m_IP)));
const auto _pktbuf = pkt.Buffer();
const llarp_buffer_t& pktbuf = _pktbuf.underlying;

View file

@ -486,8 +486,7 @@ namespace llarp
if (m_UseV6)
pkt.UpdateIPv6Address(from, m_IfAddr);
else
pkt.UpdateIPv4Address(
xhtonl(net::TruncateV6(from)), xhtonl(net::TruncateV6(m_IfAddr)));
pkt.UpdateIPv4Address(xhtonl(net::TruncateV6(from)), xhtonl(net::TruncateV6(m_IfAddr)));
return llarp_ev_tun_async_write(&m_Tun, pkt.Buffer());
}

View file

@ -950,8 +950,7 @@ namespace llarp
{
return false;
}
pkt.UpdateIPv4Address(
xhtonl(net::TruncateV6(themIP)), xhtonl(net::TruncateV6(usIP)));
pkt.UpdateIPv4Address(xhtonl(net::TruncateV6(themIP)), xhtonl(net::TruncateV6(usIP)));
}
else if (pkt.IsV6())
{

View file

@ -253,8 +253,7 @@ namespace llarp
else
{
if (pkt.IsV4())
pkt.UpdateIPv4Address(
xhtonl(pkt.srcv4()), xhtonl(net::TruncateV6(m_OurIP)));
pkt.UpdateIPv4Address(xhtonl(pkt.srcv4()), xhtonl(net::TruncateV6(m_OurIP)));
else
return false;
}

View file

@ -1,8 +1,8 @@
#include <net/ip.hpp>
#include <cstring>
namespace llarp::net {
namespace llarp::net
{
huint128_t
In6ToHUInt(in6_addr addr)
{
@ -25,4 +25,4 @@ namespace llarp::net {
return addr;
}
} // namespace llarp::net
} // namespace llarp::net

View file

@ -25,4 +25,4 @@ namespace llarp::net
return ret;
}
} // namespace llarp::net
} // namespace llarp::net

View file

@ -2,7 +2,6 @@
namespace llarp
{
bool
IPRange::ContainsV4(const huint32_t& ip) const
{

View file

@ -16,8 +16,7 @@ namespace llarp
static constexpr IPRange
FromIPv4(byte_t a, byte_t b, byte_t c, byte_t d, byte_t mask)
{
return IPRange{net::ExpandV4(ipaddr_ipv4_bits(a, b, c, d)),
netmask_ipv6_bits(mask + 96)};
return IPRange{net::ExpandV4(ipaddr_ipv4_bits(a, b, c, d)), netmask_ipv6_bits(mask + 96)};
}
/// return true if ip is contained in this ip range

View file

@ -465,8 +465,8 @@ namespace llarp
if (addr->sin_addr.s_addr)
// skip unconfig'd adapters (windows passes these through the unix-y
// wrapper)
currentRanges.emplace_back(IPRange{net::ExpandV4(xntohl(ifaddr)),
net::ExpandV4(xntohl(ifmask))});
currentRanges.emplace_back(
IPRange{net::ExpandV4(xntohl(ifaddr)), net::ExpandV4(xntohl(ifmask))});
}
});
// try 10.x.0.0/16
@ -635,7 +635,10 @@ namespace llarp
}
#else
bool
IsIPv4Bogon(const huint32_t&) { return false; }
IsIPv4Bogon(const huint32_t&)
{
return false;
}
#endif
} // namespace llarp

View file

@ -45,7 +45,6 @@ operator==(const in6_addr& a, const in6_addr& b);
namespace llarp
{
/// get a netmask with the higest numset bits set
constexpr huint128_t
_netmask_ipv6_bits(uint32_t numset)

View file

@ -194,8 +194,7 @@ namespace llarp
{
if (failedAt)
{
r->NotifyRouterEvent<tooling::PathBuildRejectedEvent>(
Endpoint(), RXID(), *failedAt);
r->NotifyRouterEvent<tooling::PathBuildRejectedEvent>(Endpoint(), RXID(), *failedAt);
LogWarn(Name(), " build failed at ", *failedAt);
r->routerProfiling().MarkHopFail(*failedAt);
}

View file

@ -548,7 +548,7 @@ namespace llarp
}
// Network config
if (conf->network.m_enableProfiling.has_value() and not *conf->network.m_enableProfiling)
if (conf->network.m_enableProfiling.has_value() and not*conf->network.m_enableProfiling)
{
routerProfiling().Disable();
LogWarn("router profiling explicitly disabled");

View file

@ -20,7 +20,8 @@ namespace llarp
}
bool
ServiceInfo::Update(const byte_t* sign, const byte_t* enc, const std::optional<VanityNonce>& nonce)
ServiceInfo::Update(
const byte_t* sign, const byte_t* enc, const std::optional<VanityNonce>& nonce)
{
signkey = sign;
enckey = enc;

View file

@ -2,12 +2,12 @@
#include <cstdint>
namespace llarp::service {
namespace llarp::service
{
using ProtocolType = uint64_t;
constexpr ProtocolType eProtocolControl = 0UL;
constexpr ProtocolType eProtocolTrafficV4 = 1UL;
constexpr ProtocolType eProtocolTrafficV6 = 2UL;
}
} // namespace llarp::service

View file

@ -56,8 +56,8 @@ namespace llarp
else if (*m_id != std::this_thread::get_id())
{
std::cerr << "NullMutex " << this << " was used across threads: locked by "
<< std::this_thread::get_id() << " and was previously locked by "
<< *m_id << "\n";
<< std::this_thread::get_id() << " and was previously locked by " << *m_id
<< "\n";
// if you're encountering this abort() call, you may have discovered a
// case where a NullMutex should be reverted to a "real mutex"
std::abort();