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

Class Net6

scapy/utils6.py:916–936  ·  view source on GitHub ↗

Network object from an IP address or hostname and mask

Source from the content-addressed store, hash-verified

914
915
916class Net6(Net): # syntax ex. 2011:db8::/126
917 """Network object from an IP address or hostname and mask"""
918 name = "Net6" # type: str
919 family = socket.AF_INET6 # type: int
920 max_mask = 128 # type: int
921
922 @classmethod
923 def ip2int(cls, addr):
924 # type: (str) -> int
925 val1, val2 = struct.unpack(
926 '!QQ', inet_pton(socket.AF_INET6, cls.name2addr(addr))
927 )
928 return cast(int, (val1 << 64) + val2)
929
930 @staticmethod
931 def int2ip(val):
932 # type: (int) -> str
933 return inet_ntop(
934 socket.AF_INET6,
935 struct.pack('!QQ', val >> 64, val & 0xffffffffffffffff),
936 )

Callers 2

h2iMethod · 0.90
parse_optionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…