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

Method any2i

scapy/contrib/http2.py:1269–1281  ·  view source on GitHub ↗

:param packet.Packet|None pkt: the packet instance containing this field instance. # noqa: E501 :param str|HPackStringsInterface x: the value to convert :return: HPackStringsInterface: the Scapy internal value for this field :raises: AssertionError, InvalidEncodingE

(self, pkt, x)

Source from the content-addressed store, hash-verified

1267 return self._parse(t == 1, x[:tmp_len])
1268
1269 def any2i(self, pkt, x):
1270 # type: (Optional[packet.Packet], Union[str, HPackStringsInterface]) -> HPackStringsInterface # noqa: E501
1271 """
1272 :param packet.Packet|None pkt: the packet instance containing this field instance. # noqa: E501
1273 :param str|HPackStringsInterface x: the value to convert
1274 :return: HPackStringsInterface: the Scapy internal value for this field
1275 :raises: AssertionError, InvalidEncodingException
1276 """
1277 if isinstance(x, bytes):
1278 assert isinstance(pkt, packet.Packet)
1279 return self.m2i(pkt, x)
1280 assert isinstance(x, HPackStringsInterface)
1281 return x
1282
1283 def i2m(self, pkt, x):
1284 # type: (Optional[packet.Packet], HPackStringsInterface) -> str

Callers

nothing calls this directly

Calls 1

m2iMethod · 0.95

Tested by

no test coverage detected