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

Method i2m

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

Source from the content-addressed store, hash-verified

3840 "Unsupported uuid_fmt ({})".format(self.uuid_fmt))
3841
3842 def i2m(self, pkt, x):
3843 # type: (Optional[Packet], Optional[UUID]) -> bytes
3844 self._check_uuid_fmt()
3845 if x is None:
3846 return b'\0' * 16
3847 if self.uuid_fmt == UUIDField.FORMAT_BE:
3848 return x.bytes
3849 elif self.uuid_fmt == UUIDField.FORMAT_LE:
3850 return x.bytes_le
3851 elif self.uuid_fmt == UUIDField.FORMAT_REV:
3852 return x.bytes[::-1]
3853 else:
3854 raise FieldAttributeException("Unknown fmt")
3855
3856 def m2i(self,
3857 pkt, # type: Optional[Packet]

Callers

nothing calls this directly

Calls 2

_check_uuid_fmtMethod · 0.95

Tested by

no test coverage detected