#include <sys/mbuf.h>
sys/mbuf.h
22 macros · 4 structs · 2 typedefs · 1 enum
mbuf types
#define MT_FREE 0
should be on free list
#define MT_DATA 1
dynamic (data) allocation
#define MT_SOCKET 3
socket structure
#define MT_PCB 4
protocol control block
#define MT_RTABLE 5
routing tables
#define MT_HTABLE 6
IMP host tables
#define MT_ATABLE 7
address resolution tables
#define MT_SONAME 8
socket name
#define MT_SOOPTS 10
socket options
#define MT_FTABLE 11
fragment reassembly header
#define MT_RIGHTS 12
access rights
#define MT_IFADDR 13
interface address
#define MT_CONTROL 14
extra-data protocol message
#define MT_OOBDATA 15
expedited data
#define MT_TAG 16
volatile metadata associated to pkts
underlying type unsigned int
| MTF_FREE | 1 | |
| MTF_DATA | 2 | |
| 4 | |
| MTF_SOCKET | 8 | |
| MTF_PCB | 16 | |
| MTF_RTABLE | 32 | |
| MTF_HTABLE | 64 | |
| MTF_ATABLE | 128 | |
| MTF_SONAME | 256 | |
| MTF_SOOPTS | 1024 | |
| MTF_FTABLE | 2048 | |
| MTF_RIGHTS | 4096 | |
| MTF_IFADDR | 8192 | |
| MTF_CONTROL | 16384 | |
| MTF_OOBDATA | 32768 | |
| MTF_TAG | 65536 | |
Mbuf statistics (legacy).
size 584, align 4
Compatibillity with 10.3
size 568, align 4
mbuf class statistics.
#define MAX_MBUF_CNAME 15
size 136, align 8
| char[16] | mbcl_cname | class name |
| u_int32_t | mbcl_size | buffer size |
| u_int32_t | mbcl_total | # of buffers created |
| u_int32_t | mbcl_active | # of active buffers |
| u_int32_t | mbcl_infree | # of available buffers |
| u_int32_t | mbcl_slab_cnt | # of available slabs |
| u_int32_t | mbcl_pad | padding |
| u_int64_t | mbcl_alloc_cnt | # of times alloc is called |
| u_int64_t | mbcl_free_cnt | # of times free is called |
| u_int64_t | mbcl_notified | # of notified wakeups |
| u_int64_t | mbcl_purge_cnt | # of purges so far |
| u_int64_t | mbcl_fail_cnt | # of allocation failures |
| u_int32_t | mbcl_ctotal | total only for this class |
| u_int32_t | mbcl_release_cnt | amount of memory returned |
| u_int32_t | mbcl_mc_state | Cache layer statistics cache state (see below) |
| u_int32_t | mbcl_mc_cached | # of cached buffers |
| u_int32_t | mbcl_mc_waiter_cnt | # waiters on the cache |
| u_int32_t | mbcl_mc_wretry_cnt | # of wait retries |
| u_int32_t | mbcl_mc_nwretry_cnt | # of no-wait retry attempts |
| u_int32_t[7] | mbcl_reserved | for future use |
#define MCS_DISABLED 0
cache is permanently disabled
#define MCS_ONLINE 1
cache is online
#define MCS_PURGING 2
cache is being purged
#define MCS_OFFLINE 3
cache is offline (resizing)