---
name: "pktb_mac_header"
section: "3"
platform: "linux"
package: "libnetfilter-queue-doc"
version: "1.0.5-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pktb_tailroom"
---

# pktb\_mac\_header(3)

Other functions

Part of [pktb\_tailroom(3)](/pktb_tailroom/3.md).

## NAME

otherfns - Other functions

## SYNOPSIS

### Modules

**Internal functions**\

### Functions

unsigned int **pktb\_tailroom** (struct pkt\_buff \*pktb)\
 uint8\_t \* **pktb\_mac\_header** (struct pkt\_buff \*pktb)\
 uint8\_t \* **pktb\_network\_header** (struct pkt\_buff \*pktb)\
 uint8\_t \* **pktb\_transport\_header** (struct pkt\_buff \*pktb)\

## Detailed Description

The library provides a number of other functions which many user-space programs will never need. These divide into 2 groups: \

- 1\.

  Functions to get values of members of opaque **struct pktbuff**, described below \

- 2\.

  Internal functions, described in Module **Internal functions**

## Function Documentation

### uint8\_t \* pktb\_mac\_header (struct pkt\_buff \* pktb)

pktb\_mac\_header - get address of layer 2 header (if any)

**Parameters**

*pktb* Pointer to userspace packet buffer

**Returns**

Pointer to MAC header or NULL if no such header present. \
 Only packet buffers in family **AF\_BRIDGE** have a non-NULL MAC header.

Definition at line **233** of file **pktbuff.c**.

### uint8\_t \* pktb\_network\_header (struct pkt\_buff \* pktb)

pktb\_network\_header - get address of layer 3 header

**Parameters**

*pktb* Pointer to userspace packet buffer

**Returns**

Pointer to layer 3 header or NULL if the packet buffer was created with an unsupported family

Definition at line **245** of file **pktbuff.c**.

### unsigned int pktb\_tailroom (struct pkt\_buff \* pktb)

pktb\_tailroom - get room available for packet expansion

**Parameters**

*pktb* Pointer to userspace packet buffer

**Returns**

room in bytes after the tail of the packet buffer \
 This starts off as the **extra** argument to **pktb\_alloc()**. Programmers should ensure this **extra** argument is sufficient for any packet mangle, as packet buffers cannot be expanded dynamically.

Definition at line **220** of file **pktbuff.c**.

### uint8\_t \* pktb\_transport\_header (struct pkt\_buff \* pktb)

pktb\_transport\_header - get address of layer 4 header (if known)

**Parameters**

*pktb* Pointer to userspace packet buffer

**Returns**

Pointer to layer 4 header or NULL if not (yet) set

**Note**

Unlike the lower-level headers, it is the programmer's responsibility to create the level 4 (transport) header pointer by caling e.g. **nfq\_ip\_set\_transport\_header()**

Definition at line **260** of file **pktbuff.c**.

## Author

Generated automatically by Doxygen for libnetfilter\_queue from the source code.
