MCPcopy Create free account
hub / github.com/secdev/scapy / m2i

Method m2i

scapy/fields.py:3465–3472  ·  view source on GitHub ↗
(self, pkt, x)

Source from the content-addressed store, hash-verified

3463 return (s[:self._numbytes(pfxlen)], pfxlen)
3464
3465 def m2i(self, pkt, x):
3466 # type: (Optional[Packet], Tuple[bytes, int]) -> Tuple[str, int]
3467 # (b"\xfc\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", 64) -> ("fc00:1::1", 64) # noqa: E501
3468 (s, pfxlen) = x
3469
3470 if len(s) < self.maxbytes:
3471 s = s + (b"\0" * (self.maxbytes - len(s)))
3472 return (self.ntoa(s), pfxlen)
3473
3474 def any2i(self, pkt, x):
3475 # type: (Optional[Packet], Optional[Any]) -> Tuple[str, int]

Callers 1

getfieldMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected