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

# proto_inject

## Declaration

```occ
errno_t proto_inject(protocol_family_t protocol, mbuf_t packet);
```

## Parameters

- `protocol`: The protocol of the packet.
- `packet`: The first packet in a chain of packets to be injected.

## Return Value

Return Value A errno error on failure. Unless proto_inject returns zero, the caller is responsible for freeing the mbuf.

## Discussion

Discussion Injects a packet on the specified protocol from anywhere. To avoid recursion, the protocol may need to queue the packet to be handled later.
