Module skb
Linux socket buffer interface.
Functions
| __len () | |
| checksum () | Recomputes IP and transport-layer (TCP/UDP) checksums. |
| connmark ([value]) | Gets or sets the conntrack mark: with no argument reads it, with value sets
it. |
| 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.
- connmark ([value])
-
Gets or sets the conntrack mark: with no argument reads it, with
valuesets it. Returns the current (or new) mark, or nil if no conntrack is associated.Parameters:
- value integer 32-bit mark to set (optional)
Returns:
-
integer
32-bit connmark, or nil if no conntrack is associated
- 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:
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