---
title: ifnet_add_proto_func
framework: kernel
role: symbol
role_heading: Type Alias
path: kernel/ifnet_add_proto_func
---

# ifnet_add_proto_func

## Declaration

```occ
typedef errno_t (*ifnet_add_proto_func)(ifnet_t interface, protocol_family_t protocol_family, const struct ifnet_demux_desc *demux_array, u_int32_t demux_count);
```

## Parameters

- `interface`: The interface the protocol will be attached to.
- `protocol_family`: The family of the protocol being attached.
- `demux_array`: An array of demux descriptors that describe the interface specific ways of identifying packets belonging to this protocol family.
- `demux_count`: The number of demux descriptors in the array.

## Return Value

Return Value If the result is zero, processing will continue normally. If the result is anything else, the add protocol will be aborted.

## Discussion

Discussion if_add_proto_func is called by the stack when a protocol is attached to an interface. This gives the interface an opportunity to get a list of protocol description structures for demuxing packets to this protocol (demux descriptors).

## See Also

### ifnet

- [ifnet_attach_proto_param](kernel/ifnet_attach_proto_param.md)
- [ifnet_attach_proto_param_v2](kernel/ifnet_attach_proto_param_v2.md)
- [ifnet_check_multi](kernel/ifnet_check_multi.md)
- [ifnet_del_proto_func](kernel/ifnet_del_proto_func.md)
- [ifnet_demux_desc](kernel/ifnet_demux_desc.md)
- [ifnet_demux_func](kernel/ifnet_demux_func.md)
- [ifnet_detached_func](kernel/ifnet_detached_func.md)
- [ifnet_event_func](kernel/ifnet_event_func.md)
- [ifnet_family_t](kernel/ifnet_family_t.md)
- [ifnet_framer_func](kernel/ifnet_framer_func.md)
- [ifnet_init_params](kernel/ifnet_init_params.md)
- [ifnet_ioctl_func](kernel/ifnet_ioctl_func.md)
- [ifnet_offload_t](kernel/ifnet_offload_t.md)
- [ifnet_output_func](kernel/ifnet_output_func.md)
- [ifnet_set_bpf_tap](kernel/ifnet_set_bpf_tap.md)
- [ifnet_stat_increment_param](kernel/ifnet_stat_increment_param.md)
- [ifnet_stats_param](kernel/ifnet_stats_param.md)
- [ifnet_t](kernel/ifnet_t.md)
