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

Function IPv4In6

connectd/netaddress.c:43–56  ·  view source on GitHub ↗

Return offset of IPv4 address, or 0 == not an IPv4 */

Source from the content-addressed store, hash-verified

41
42/* Return offset of IPv4 address, or 0 == not an IPv4 */
43static size_t IPv4In6(const struct wireaddr *addr)
44{
45 if (addr->type != ADDR_TYPE_IPV6)
46 return 0;
47 if (memcmp(addr->addr, pchIPv4, sizeof(pchIPv4)) == 0)
48 return sizeof(pchIPv4);
49 if (IsRFC6052(addr))
50 return 12;
51 if (IsRFC6145(addr))
52 return 12;
53 if (IsRFC3964(addr))
54 return 2;
55 return 0;
56}
57
58/* Is this an IPv4 address, or an IPv6-wrapped IPv4 */
59static bool IsIPv4(const struct wireaddr *addr)

Callers 4

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

Calls 3

IsRFC6052Function · 0.85
IsRFC6145Function · 0.85
IsRFC3964Function · 0.85

Tested by

no test coverage detected