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

Function in6_addrtomac

scapy/utils6.py:272–281  ·  view source on GitHub ↗

Extract the mac address from provided address. None is returned on error.

(addr)

Source from the content-addressed store, hash-verified

270
271
272def in6_addrtomac(addr):
273 # type: (str) -> Optional[str]
274 """
275 Extract the mac address from provided address. None is returned
276 on error.
277 """
278 mask = inet_pton(socket.AF_INET6, "::ffff:ffff:ffff:ffff")
279 x = in6_and(mask, inet_pton(socket.AF_INET6, addr))
280 ifaceid = inet_ntop(socket.AF_INET6, x)[2:]
281 return in6_ifaceidtomac(ifaceid)
282
283
284def in6_addrtovendor(addr):

Callers 1

in6_addrtovendorFunction · 0.85

Calls 4

inet_ptonFunction · 0.90
inet_ntopFunction · 0.90
in6_andFunction · 0.85
in6_ifaceidtomacFunction · 0.85

Tested by

no test coverage detected