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

Method m2i

scapy/fields.py:3856–3869  ·  view source on GitHub ↗
(self,
            pkt,  # type: Optional[Packet]
            x,  # type: bytes
            )

Source from the content-addressed store, hash-verified

3854 raise FieldAttributeException("Unknown fmt")
3855
3856 def m2i(self,
3857 pkt, # type: Optional[Packet]
3858 x, # type: bytes
3859 ):
3860 # type: (...) -> UUID
3861 self._check_uuid_fmt()
3862 if self.uuid_fmt == UUIDField.FORMAT_BE:
3863 return UUID(bytes=x)
3864 elif self.uuid_fmt == UUIDField.FORMAT_LE:
3865 return UUID(bytes_le=x)
3866 elif self.uuid_fmt == UUIDField.FORMAT_REV:
3867 return UUID(bytes=x[::-1])
3868 else:
3869 raise FieldAttributeException("Unknown fmt")
3870
3871 def any2i(self,
3872 pkt, # type: Optional[Packet]

Callers 1

any2iMethod · 0.95

Calls 3

_check_uuid_fmtMethod · 0.95
UUIDClass · 0.50

Tested by

no test coverage detected