---
title: mbuf_gethdr
framework: Kernel
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: kernel/1535722-mbuf_gethdr
---

# mbuf_gethdr

## Declaration

```occ
errno_t mbuf_gethdr(mbuf_how_t how, mbuf_type_t type, mbuf_t *mbuf);
```

## Parameters

- `how`: Blocking or non-blocking.
- `type`: The type of the mbuf.
- `mbuf`: The mbuf.

## Return Value

Return Value 0 on success, errno error on failure.

## Discussion

Discussion Allocates an mbuf without a cluster for external data. Sets a flag to indicate there is a packet header and initializes the packet header.
