Skip to main content

Module bindings

Module bindings 

Source
Expand description

Layer binding system for automatic field setting when stacking layers.

For example, when stacking Ether() / ARP(), the Ethernet type field should automatically be set to 0x0806 (ARP).

Structs§

BindingRegistry
Registry for custom bindings (runtime-defined).
LayerBinding
Describes a binding between two layers.

Statics§

LAYER_BINDINGS
Static table of layer bindings.

Functions§

apply_binding
Apply binding to set the appropriate field when stacking layers.
expected_upper_layers
Get the expected upper layer kinds for a given lower layer.
find_binding
Find the binding for a given layer pair.
find_bindings_from
Find all bindings where the given layer is the lower layer.
find_bindings_to
Find all bindings where the given layer is the upper layer.
infer_upper_layer
Determine the upper layer kind based on field value.