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

Method i2repr_one

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

Source from the content-addressed store, hash-verified

2776
2777class XByteEnumField(ByteEnumField):
2778 def i2repr_one(self, pkt, x):
2779 # type: (Optional[Packet], int) -> str
2780 if self not in conf.noenum and not isinstance(x, VolatileValue):
2781 if self.i2s:
2782 try:
2783 return self.i2s[x]
2784 except KeyError:
2785 pass
2786 elif self.i2s_cb:
2787 ret = self.i2s_cb(x)
2788 if ret is not None:
2789 return ret
2790 return lhex(x)
2791
2792
2793class IntEnumField(EnumField[int]):

Callers

nothing calls this directly

Calls 1

lhexFunction · 0.90

Tested by

no test coverage detected