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

Function bind_bottom_up

scapy/packet.py:2051–2070  ·  view source on GitHub ↗

r"""Bind 2 layers for dissection. The upper layer will be chosen for dissection on top of the lower layer, if ALL the passed arguments are validated. If multiple calls are made with the same layers, the last one will be used as default. ex: >>> bind_bottom_up(Ether, SNAP, ty

(lower,  # type: Type[Packet]
                   upper,  # type: Type[Packet]
                   __fval=None,  # type: Optional[Any]
                   **fval  # type: Any
                   )

Source from the content-addressed store, hash-verified

2049
2050
2051def bind_bottom_up(lower, # type: Type[Packet]
2052 upper, # type: Type[Packet]
2053 __fval=None, # type: Optional[Any]
2054 **fval # type: Any
2055 ):
2056 # type: (...) -> None
2057 r"""Bind 2 layers for dissection.
2058 The upper layer will be chosen for dissection on top of the lower layer, if
2059 ALL the passed arguments are validated. If multiple calls are made with
2060 the same layers, the last one will be used as default.
2061
2062 ex:
2063 >>> bind_bottom_up(Ether, SNAP, type=0x1234)
2064 >>> Ether(b'\xff\xff\xff\xff\xff\xff\xd0P\x99V\xdd\xf9\x124\x00\x00\x00\x00\x00') # noqa: E501
2065 <Ether dst=ff:ff:ff:ff:ff:ff src=d0:50:99:56:dd:f9 type=0x1234 |<SNAP OUI=0x0 code=0x0 |>> # noqa: E501
2066 """
2067 if __fval is not None:
2068 fval.update(__fval)
2069 lower.payload_guess = lower.payload_guess[:]
2070 lower.payload_guess.append((fval, upper))
2071
2072
2073def bind_top_down(lower, # type: Type[Packet]

Callers 15

vqp.pyFile · 0.90
hicp.pyFile · 0.90
mqttsn.pyFile · 0.90
rtsp.pyFile · 0.90
bfd.pyFile · 0.90
knx.pyFile · 0.90
ikev2.pyFile · 0.90
socks.pyFile · 0.90
gtp.pyFile · 0.90
psp.pyFile · 0.90
stun.pyFile · 0.90
openflow.pyFile · 0.90

Calls 2

updateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected