MCPcopy
hub / github.com/secdev/scapy / bind_top_down

Function bind_top_down

scapy/packet.py:2073–2091  ·  view source on GitHub ↗

Bind 2 layers for building. When the upper layer is added as a payload of the lower layer, all the arguments will be applied to them. ex: >>> bind_top_down(Ether, SNAP, type=0x1234) >>> Ether()/SNAP() >

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

Source from the content-addressed store, hash-verified

2071
2072
2073def bind_top_down(lower, # type: Type[Packet]
2074 upper, # type: Type[Packet]
2075 __fval=None, # type: Optional[Any]
2076 **fval # type: Any
2077 ):
2078 # type: (...) -> None
2079 """Bind 2 layers for building.
2080 When the upper layer is added as a payload of the lower layer, all the
2081 arguments will be applied to them.
2082
2083 ex:
2084 >>> bind_top_down(Ether, SNAP, type=0x1234)
2085 >>> Ether()/SNAP()
2086 <Ether type=0x1234 |<SNAP |>>
2087 """
2088 if __fval is not None:
2089 fval.update(__fval)
2090 upper._overload_fields = upper._overload_fields.copy() # type: ignore
2091 upper._overload_fields[lower] = fval
2092
2093
2094@conf.commands.register

Callers 15

ikev2.pyFile · 0.90
gtp.pyFile · 0.90
ltp.pyFile · 0.90
psp.pyFile · 0.90
stun.pyFile · 0.90
openflow.pyFile · 0.90
_bind_someip_layersFunction · 0.90
someip.pyFile · 0.90
xcp.pyFile · 0.90
ipsec.pyFile · 0.90
smb2.pyFile · 0.90
vxlan.pyFile · 0.90

Calls 2

updateMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected