MCPcopy Create free account
hub / github.com/ElementsProject/lightning / IsLocal

Function IsLocal

connectd/netaddress.c:141–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141static bool IsLocal(const struct wireaddr *addr)
142{
143 // IPv4 loopback
144 if (IsIPv4(addr) && (GetByte(addr, 3) == 127 || GetByte(addr, 3) == 0))
145 return true;
146
147 // IPv6 loopback (::1/128)
148 static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
149 if (IsIPv6(addr) && RawEq(addr, pchLocal, sizeof(pchLocal)))
150 return true;
151
152 return false;
153}
154
155static bool IsInternal(const struct wireaddr *addr)
156{

Callers 3

IsRoutableFunction · 0.85
address_routableFunction · 0.85
mainFunction · 0.85

Calls 4

IsIPv4Function · 0.85
GetByteFunction · 0.85
IsIPv6Function · 0.85
RawEqFunction · 0.85

Tested by 1

mainFunction · 0.68