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

Method m2i

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

Source from the content-addressed store, hash-verified

3342 return r
3343
3344 def m2i(self, pkt, x):
3345 # type: (Optional[Packet], int) -> Set[str]
3346 v = self.depends_on(pkt)
3347 these_names = self.names.get(v, {})
3348
3349 r = set()
3350 i = 0
3351 while x:
3352 if x & 1:
3353 if i in these_names:
3354 r.add(these_names[i].short)
3355 else:
3356 r.add('bit {}'.format(i))
3357 x >>= 1
3358 i += 1
3359 return r
3360
3361 def i2repr(self, pkt, x):
3362 # type: (Optional[Packet], Set[str]) -> str

Callers 1

any2iMethod · 0.95

Calls 3

getMethod · 0.45
addMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected