MCPcopy Index your code
hub / github.com/secdev/scapy / in6_6to4ExtractAddr

Function in6_6to4ExtractAddr

scapy/utils6.py:390–402  ·  view source on GitHub ↗

Extract IPv4 address embedded in 6to4 address. Passed address must be a 6to4 address. None is returned on error.

(addr)

Source from the content-addressed store, hash-verified

388
389
390def in6_6to4ExtractAddr(addr):
391 # type: (str) -> Optional[str]
392 """
393 Extract IPv4 address embedded in 6to4 address. Passed address must be
394 a 6to4 address. None is returned on error.
395 """
396 try:
397 baddr = inet_pton(socket.AF_INET6, addr)
398 except Exception:
399 return None
400 if baddr[:2] != b" \x02":
401 return None
402 return inet_ntop(socket.AF_INET, baddr[2:6])
403
404
405def in6_getLocalUniquePrefix():

Callers 1

i2reprMethod · 0.90

Calls 2

inet_ptonFunction · 0.90
inet_ntopFunction · 0.90

Tested by

no test coverage detected