MCPcopy Create free account
hub / github.com/secdev/scapy / any2i

Method any2i

scapy/layers/dcerpc.py:2282–2294  ·  view source on GitHub ↗
(self, pkt, x)

Source from the content-addressed store, hash-verified

2280 return super(_NDRConfField, self).i2len(pkt, self._subval(x))
2281
2282 def any2i(self, pkt, x):
2283 # User-friendly helper
2284 if self.conformant_in_struct:
2285 return super(_NDRConfField, self).any2i(pkt, x)
2286 if self.CONFORMANT_STRING and not isinstance(x, NDRConformantString):
2287 return NDRConformantString(
2288 value=super(_NDRConfField, self).any2i(pkt, x),
2289 )
2290 elif not isinstance(x, NDRConformantArray):
2291 return NDRConformantArray(
2292 value=super(_NDRConfField, self).any2i(pkt, x),
2293 )
2294 return x
2295
2296 # Can't use i2repr = Field.i2repr and so on on PY2 :/
2297 def i2repr(self, pkt, val):

Callers

nothing calls this directly

Calls 3

NDRConformantStringClass · 0.85
NDRConformantArrayClass · 0.85
any2iMethod · 0.45

Tested by

no test coverage detected