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

Method getfield

scapy/contrib/openflow.py:564–572  ·  view source on GitHub ↗
(self, pkt, s)

Source from the content-addressed store, hash-verified

562
563class OFPacketField(PacketField):
564 def getfield(self, pkt, s):
565 try:
566 tmp_len = s[2:4]
567 tmp_len = struct.unpack("!H", tmp_len)[0]
568 ofload = s[:tmp_len]
569 remain = s[tmp_len:]
570 return remain, OpenFlow(ofload)
571 except Exception:
572 return "", Raw(s)
573
574
575ofp_error_type = {0: "OFPET_HELLO_FAILED",

Callers

nothing calls this directly

Calls 2

RawClass · 0.90
OpenFlowClass · 0.85

Tested by

no test coverage detected