kpi_mbuf.h

Overview

See the Overview section above for header-level documentation.

Overview

This header defines an API for interacting with mbufs. mbufs are the primary method of storing packets in the networking stack.

mbufs are used to store various items in the networking stack. The most common usage of an mbuf is to store a packet or data on a socket waiting to be sent or received. The mbuf is a contiguous structure with some header followed by some data. To store more data than would fit in an mbuf, external data is used. Most mbufs with external data use clusters to store the external data.

mbufs can be chained, contiguous data in a packet can be found by following the m_next chain. Packets may be bundled together using m_nextpacket. Many parts of the stack do not properly handle chains of packets. When in doubt, don't chain packets.

Included Headers

  • <sys/kernel_types.h>

  • <mach/vm_types.h>

Topics

Data Types

See the Overview section above for header-level documentation.

mbuf_traffic_class_t

Traffic class of a packet

Constants

See the Overview section above for header-level documentation.

mbuf_csum_performed_flags_t

Checksum performed/requested flags.

mbuf_csum_request_flags_t

Checksum performed/requested flags.

mbuf_flags_t

Constants defining mbuf flags. Only the flags listed below can be set or retrieved.

mbuf_how_t

Method of allocating an mbuf.

mbuf_type_t

Types of mbufs.