Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/ifnet.9
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
.In sys/socket.h | .In sys/socket.h | ||||
.In net/if.h | .In net/if.h | ||||
.In net/if_var.h | .In net/if_var.h | ||||
.In net/if_types.h | .In net/if_types.h | ||||
.\" | .\" | ||||
.Ss "Interface Manipulation Functions" | .Ss "Interface Manipulation Functions" | ||||
.Ft "struct ifnet *" | .Ft "struct ifnet *" | ||||
.Fn if_alloc "u_char type" | .Fn if_alloc "u_char type" | ||||
.Ft "struct ifnet *" | |||||
.Fn if_alloc_dev "u_char type" "device_t dev" | |||||
.Ft "struct ifnet *" | |||||
.Fn if_alloc_domain "u_char type" "int numa_domain" | |||||
.Ft void | .Ft void | ||||
.Fn if_attach "struct ifnet *ifp" | .Fn if_attach "struct ifnet *ifp" | ||||
.Ft void | .Ft void | ||||
.Fn if_detach "struct ifnet *ifp" | .Fn if_detach "struct ifnet *ifp" | ||||
.Ft void | .Ft void | ||||
.Fn if_free "struct ifnet *ifp" | .Fn if_free "struct ifnet *ifp" | ||||
.Ft void | .Ft void | ||||
.Fn if_free_type "struct ifnet *ifp" "u_char type" | .Fn if_free_type "struct ifnet *ifp" "u_char type" | ||||
▲ Show 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | |||||
.It Va if_alloctype | .It Va if_alloctype | ||||
.Pq Vt u_char | .Pq Vt u_char | ||||
The type of the interface as it was at the time of its allocation. | The type of the interface as it was at the time of its allocation. | ||||
It is used to cache the type passed to | It is used to cache the type passed to | ||||
.Fn if_alloc , | .Fn if_alloc , | ||||
but unlike | but unlike | ||||
.Va if_type , | .Va if_type , | ||||
it would not be changed by drivers. | it would not be changed by drivers. | ||||
.It Va if_numa_domain | |||||
.Pq Vt uint8_t | |||||
The NUMA domain of the hardware device associated with the interface. | |||||
This is filled in with a wildcard value unless the kernel is NUMA | |||||
aware, the system is a NUMA system, and the ifnet is allocated | |||||
using | |||||
.Fn if_alloc_dev | |||||
or | |||||
.Fn if_alloc_domain . | |||||
.El | .El | ||||
.Pp | .Pp | ||||
References to | References to | ||||
.Vt ifnet | .Vt ifnet | ||||
structures are gained by calling the | structures are gained by calling the | ||||
.Fn if_ref | .Fn if_ref | ||||
function and released by calling the | function and released by calling the | ||||
.Fn if_rele | .Fn if_rele | ||||
▲ Show 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | |||||
.It Fn if_alloc | .It Fn if_alloc | ||||
Allocate and initialize | Allocate and initialize | ||||
.Vt "struct ifnet" . | .Vt "struct ifnet" . | ||||
Initialization includes the allocation of an interface index and may | Initialization includes the allocation of an interface index and may | ||||
include the allocation of a | include the allocation of a | ||||
.Fa type | .Fa type | ||||
specific structure in | specific structure in | ||||
.Va if_l2com . | .Va if_l2com . | ||||
.It Fn if_alloc_dev | |||||
Allocate and initialize | |||||
.Vt "struct ifnet" | |||||
as | |||||
.Fn if_alloc | |||||
does, with the addition that the ifnet can be tagged with the | |||||
appropriate NUMA domain derived from the | |||||
.Fa dev | |||||
argument passed by the caller. | |||||
.It Fn if_alloc_domain | |||||
Allocate and initialize | |||||
.Vt "struct ifnet" | |||||
as | |||||
.Fn if_alloc | |||||
does, with the addition that the ifnet will be tagged with the NUMA | |||||
domain via the | |||||
.Fa numa_domain | |||||
argument passed by the caller. | |||||
.It Fn if_attach | .It Fn if_attach | ||||
Link the specified interface | Link the specified interface | ||||
.Fa ifp | .Fa ifp | ||||
into the list of network interfaces. | into the list of network interfaces. | ||||
Also initialize the list of | Also initialize the list of | ||||
addresses on that interface, and create a link-layer | addresses on that interface, and create a link-layer | ||||
.Vt ifaddr | .Vt ifaddr | ||||
structure to be the first element in that list. | structure to be the first element in that list. | ||||
(A pointer to | (A pointer to | ||||
this address structure is saved in the | this address structure is saved in the | ||||
.Vt ifnet | .Vt ifnet | ||||
structure and is accessed by the | structure and is accessed by the | ||||
.Fn ifaddr_byindex | .Fn ifaddr_byindex | ||||
function.) | function.) | ||||
The | The | ||||
.Fa ifp | .Fa ifp | ||||
must have been allocated by | must have been allocated by | ||||
.Fn if_alloc . | .Fn if_alloc , | ||||
.Fn if_alloc_dev | |||||
or | |||||
.Fn if_alloc_domain . | |||||
.It Fn if_detach | .It Fn if_detach | ||||
Shut down and unlink the specified | Shut down and unlink the specified | ||||
.Fa ifp | .Fa ifp | ||||
from the interface list. | from the interface list. | ||||
.It Fn if_free | .It Fn if_free | ||||
Free the given | Free the given | ||||
.Fa ifp | .Fa ifp | ||||
back to the system. | back to the system. | ||||
▲ Show 20 Lines • Show All 341 Lines • Show Last 20 Lines |