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

Method i2m

scapy/fields.py:213–220  ·  view source on GitHub ↗

Convert internal value to machine value

(self, pkt, x)

Source from the content-addressed store, hash-verified

211 return cast(I, x)
212
213 def i2m(self, pkt, x):
214 # type: (Optional[Packet], Optional[I]) -> M
215 """Convert internal value to machine value"""
216 if x is None:
217 return cast(M, 0)
218 elif isinstance(x, str):
219 return cast(M, bytes_encode(x))
220 return cast(M, x)
221
222 def any2i(self, pkt, x):
223 # type: (Optional[Packet], Any) -> Optional[I]

Callers 14

addfieldMethod · 0.95
i2mMethod · 0.45
i2mMethod · 0.45
i2mMethod · 0.45
i2mMethod · 0.45
i2mMethod · 0.45
addfieldMethod · 0.45
addfieldMethod · 0.45
addfieldMethod · 0.45
addfieldMethod · 0.45
addfieldMethod · 0.45
addfieldMethod · 0.45

Calls 1

bytes_encodeFunction · 0.90

Tested by

no test coverage detected