ifnet Struct Reference

#include <stdapis/net/if_var.h>

struct ifnet
Public Attributes
struct ifaddrheadif_addrhead
void *if_afdata
intif_amcount
struct bpf_if *if_bpf
void *if_bridge
const uint8_t *if_broadcastaddr
intif_capabilities
intif_capenable
struct carp_if *if_carp
struct if_dataif_data
const char *if_dname
intif_dunit
intif_flags
u_shortif_index
void *if_linkmib
size_t if_linkmiblen
struct ifaddr *if_lladdr
struct ifmultiheadif_multiaddrs
intif_pcount
void(*if_poll_unused
struct ifprefixheadif_prefixhead
struct lwkt_serialize *if_serializer
void *if_softc
shortif_timer
charif_xname
Public Member Functions
TAILQ_ENTRY(ifnet)
voidif_init(void *)
voidif_input(struct ifnet *, struct mbuf *)
intif_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *)
intif_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)
intif_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *)
voidif_start(struct ifnet *)
voidif_watchdog(struct ifnet *)

Detailed Description

Structure defining a network interface.

ifnet and its related packet queues are protected by if_serializer. Callers of if_output, if_ioctl, if_start, if_watchdog, if_init, if_resolvemulti, and if_poll hold if_serializer. Device drivers usually use the same serializer for their interrupt but this is not required. However, the device driver must be holding if_serializer when it calls if_input. Note that the serializer may be temporarily released within if_input to avoid a deadlock (e.g. when fast-forwarding or bridging packets between interfaces).

If a device driver installs the same serializer for its interrupt as for ifnet, then the driver only really needs to worry about further serialization in timeout based entry points. All other entry points will already be serialized. Older ISA drivers still using the old interrupt infrastructure will have to obtain and release the serializer in their interrupt routine themselves.

Member Attribute Documentation

if_addrhead

struct ifaddrheadif_addrhead

if_afdata

void *if_afdata

if_amcount

intif_amcount

if_bpf

struct bpf_if *if_bpf

if_bridge

void *if_bridge

if_broadcastaddr

const uint8_t *if_broadcastaddr

if_capabilities

intif_capabilities

if_capenable

intif_capenable

if_carp

struct carp_if *if_carp

if_data

struct if_dataif_data

if_dname

const char *if_dname

if_dunit

intif_dunit

if_flags

intif_flags

if_index

u_shortif_index

if_linkmib

void *if_linkmib

if_linkmiblen

size_t if_linkmiblen

if_lladdr

struct ifaddr *if_lladdr

if_multiaddrs

struct ifmultiheadif_multiaddrs

if_pcount

intif_pcount

if_poll_unused

void(*if_poll_unused

if_prefixhead

struct ifprefixheadif_prefixhead

if_serializer

struct lwkt_serialize *if_serializer

if_softc

void *if_softc

if_timer

shortif_timer

if_xname

charif_xname

Member Function Documentation

TAILQ_ENTRY ( ifnet )

TAILQ_ENTRY(ifnet)

if_init ( void * )

voidif_init(void *)

if_input ( struct ifnet *, struct mbuf * )

voidif_input(struct ifnet *,
struct mbuf *
)

if_ioctl ( struct ifnet *, u_long, caddr_t, struct ucred * )

intif_ioctl(struct ifnet *,
u_long,
caddr_t,
struct ucred *
)

if_output ( struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry * )

intif_output(struct ifnet *,
struct mbuf *,
struct sockaddr *,
struct rtentry *
)

if_resolvemulti ( struct ifnet *, struct sockaddr **, struct sockaddr * )

intif_resolvemulti(struct ifnet *,
struct sockaddr **,
struct sockaddr *
)

if_start ( struct ifnet * )

voidif_start(struct ifnet *)

if_watchdog ( struct ifnet * )

voidif_watchdog(struct ifnet *)