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

Method m2i

scapy/contrib/http2.py:133–143  ·  view source on GitHub ↗

:param packet.Packet|None pkt: the packet instance containing this field instance; probably unused # noqa: E501 :param int x: must be the machine representatino of the default value :return: int; default value :raises: AssertionError

(self, pkt, x)

Source from the content-addressed store, hash-verified

131 return super(HPackMagicBitField, self).i2h(pkt, self._magic)
132
133 def m2i(self, pkt, x):
134 # type: (Optional[packet.Packet], int) -> int
135 """
136 :param packet.Packet|None pkt: the packet instance containing this field instance; probably unused # noqa: E501
137 :param int x: must be the machine representatino of the default value
138 :return: int; default value
139 :raises: AssertionError
140 """
141 r = super(HPackMagicBitField, self).m2i(pkt, x)
142 assert r == self._magic, 'Invalid value parsed from m2i; error in class guessing detected!' # noqa: E501
143 return r
144
145 def i2m(self, pkt, x):
146 # type: (Optional[packet.Packet], int) -> int

Callers

nothing calls this directly

Calls 1

m2iMethod · 0.45

Tested by

no test coverage detected