Module skb

Linux socket buffer interface.

Functions

__len ()
checksum () Recomputes IP and transport-layer (TCP/UDP) checksums.
copy () Returns an independent copy of the skb with its own data buffer.
data ([layer])
forward () Forwards the skb out through its ingress device.
ifindex ()
resize (n) Expands (skbput) or shrinks (skbtrim) the skb data area.
vlan ()


Functions

__len ()

Returns:

    integer skb length in bytes
checksum ()
Recomputes IP and transport-layer (TCP/UDP) checksums.
copy ()
Returns an independent copy of the skb with its own data buffer. The skb is linearized before copying to avoid failures on fragmented skbs (e.g. bridged traffic with paged data).

Returns:

    skb

Raises:

if skb is FRAGLIST GSO, linearization fails, or copy allocation fails
data ([layer])

Parameters:

  • layer string "net" (default, L3) or "mac" (L2, includes MAC header) (optional)

Returns:

    data

Raises:

if linearization fails, MAC header is not set, or layer is invalid
forward ()
Forwards the skb out through its ingress device.

Raises:

if skb has no device, MAC header is not set, or clone fails
ifindex ()

Returns:

    integer network interface index, or nil if not available
resize (n)
Expands (skbput) or shrinks (skbtrim) the skb data area.

Parameters:

  • n integer desired size in bytes

Raises:

if insufficient tailroom for expansion
vlan ()

Returns:

    integer VLAN tag ID, or nil if not present
generated by LDoc 1.5.0 Last updated 2026-03-31 12:21:45