ifnet.9 (116272) | ifnet.9 (119893) |
---|---|
1.\" -*- Nroff -*- 2.\" Copyright 1996, 1997 Massachusetts Institute of Technology 3.\" 4.\" Permission to use, copy, modify, and distribute this software and 5.\" its documentation for any purpose and without fee is hereby 6.\" granted, provided that both the above copyright notice and this 7.\" permission notice appear in all copies, that both the above 8.\" copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" | 1.\" -*- Nroff -*- 2.\" Copyright 1996, 1997 Massachusetts Institute of Technology 3.\" 4.\" Permission to use, copy, modify, and distribute this software and 5.\" its documentation for any purpose and without fee is hereby 6.\" granted, provided that both the above copyright notice and this 7.\" permission notice appear in all copies, that both the above 8.\" copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" |
29.\" $FreeBSD: head/share/man/man9/ifnet.9 116272 2003-06-12 21:33:00Z hmp $ | 29.\" $FreeBSD: head/share/man/man9/ifnet.9 119893 2003-09-08 19:57:22Z ru $ |
30.Dd January 15, 1997 31.Os 32.Dt IFNET 9 33.Sh NAME 34.Nm ifnet , 35.Nm ifaddr , 36.Nm ifqueue , 37.Nm if_data --- 86 unchanged lines hidden (view full) --- 124.Vt extern int ifqmaxlen ; 125.Sh DATA STRUCTURES 126The kernel mechanisms for handling network interfaces reside primarily 127in the 128.Vt ifnet , if_data , ifaddr , 129and 130.Vt ifmultiaddr 131structures in | 30.Dd January 15, 1997 31.Os 32.Dt IFNET 9 33.Sh NAME 34.Nm ifnet , 35.Nm ifaddr , 36.Nm ifqueue , 37.Nm if_data --- 86 unchanged lines hidden (view full) --- 124.Vt extern int ifqmaxlen ; 125.Sh DATA STRUCTURES 126The kernel mechanisms for handling network interfaces reside primarily 127in the 128.Vt ifnet , if_data , ifaddr , 129and 130.Vt ifmultiaddr 131structures in |
132.Aq Pa net/if.h | 132.In net/if.h |
133and | 133and |
134.Aq Pa net/if_var.h | 134.In net/if_var.h |
135and the functions named above and defined in 136.Pa /sys/net/if.c . 137Those interfaces which are intended to be used by user programs 138are defined in | 135and the functions named above and defined in 136.Pa /sys/net/if.c . 137Those interfaces which are intended to be used by user programs 138are defined in |
139.Aq Pa net/if.h ; | 139.In net/if.h ; |
140these include the interface flags, the 141.Vt if_data 142structure, and the structures defining the appearance of 143interface-related messages on the 144.Xr route 4 145routing socket and in 146.Xr sysctl 3 . 147The header file | 140these include the interface flags, the 141.Vt if_data 142structure, and the structures defining the appearance of 143interface-related messages on the 144.Xr route 4 145routing socket and in 146.Xr sysctl 3 . 147The header file |
148.Aq Pa net/if_var.h | 148.In net/if_var.h |
149defines the kernel-internal interfaces, including the 150.Vt ifnet , ifaddr , 151and 152.Vt ifmultiaddr 153structures and the functions which manipulate them. 154(A few user programs will need | 149defines the kernel-internal interfaces, including the 150.Vt ifnet , ifaddr , 151and 152.Vt ifmultiaddr 153structures and the functions which manipulate them. 154(A few user programs will need |
155.Aq Pa net/if_var.h | 155.In net/if_var.h |
156because it is the prerequisite of some other header file like | 156because it is the prerequisite of some other header file like |
157.Aq Pa netinet/if_ether.h . | 157.In netinet/if_ether.h . |
158Most references to those two files in particular can be replaced by | 158Most references to those two files in particular can be replaced by |
159.Aq Pa net/ethernet.h . ) | 159.In net/ethernet.h . ) |
160.Pp 161The system keeps a linked list of interfaces using the 162.Li TAILQ 163macros defined in 164.Xr queue 3 ; 165this list is headed by a 166.Vt "struct ifnethead" 167called --- 179 unchanged lines hidden (view full) --- 347Not used. 348We are not even sure what it was ever for. 349The prototype is faked. 350.It Fn if_ioctl 351Process interface-related 352.Xr ioctl 2 353requests 354(defined in | 160.Pp 161The system keeps a linked list of interfaces using the 162.Li TAILQ 163macros defined in 164.Xr queue 3 ; 165this list is headed by a 166.Vt "struct ifnethead" 167called --- 179 unchanged lines hidden (view full) --- 347Not used. 348We are not even sure what it was ever for. 349The prototype is faked. 350.It Fn if_ioctl 351Process interface-related 352.Xr ioctl 2 353requests 354(defined in |
355.Aq Pa sys/sockio.h ) . | 355.In sys/sockio.h ) . |
356Preliminary processing is done by the generic routine 357.Fn ifioctl 358to check for appropriate privileges, locate the interface being 359manipulated, and perform certain generic operations like twiddling 360flags and flushing queues. 361See the description of 362.Fn ifioctl 363below for more information. --- 127 unchanged lines hidden (view full) --- 491The following elements of the 492.Vt if_data 493structure are initialized by the interface and are not expected to change 494significantly over the course of normal operation: 495.Bl -tag -width ".Va ifi_lastchange" -offset indent 496.It Va ifi_type 497.Pq Vt u_char 498The type of the interface, as defined in | 356Preliminary processing is done by the generic routine 357.Fn ifioctl 358to check for appropriate privileges, locate the interface being 359manipulated, and perform certain generic operations like twiddling 360flags and flushing queues. 361See the description of 362.Fn ifioctl 363below for more information. --- 127 unchanged lines hidden (view full) --- 491The following elements of the 492.Vt if_data 493structure are initialized by the interface and are not expected to change 494significantly over the course of normal operation: 495.Bl -tag -width ".Va ifi_lastchange" -offset indent 496.It Va ifi_type 497.Pq Vt u_char 498The type of the interface, as defined in |
499.Aq Pa net/if_types.h | 499.In net/if_types.h |
500and described below in the 501.Sx "Interface Types" 502section. 503.It Va ifi_physical 504.Pq Vt u_char 505Intended to represent a selection of physical layers on devices which 506support more than one; never implemented. 507.It Va ifi_addrlen --- 90 unchanged lines hidden (view full) --- 598.It Va ifi_lastchange 599.Pq Vt "struct timeval" 600The time of the last administrative change to the interface (as required 601for 602.Tn SNMP ) . 603.El 604.Ss Interface Types 605The header file | 500and described below in the 501.Sx "Interface Types" 502section. 503.It Va ifi_physical 504.Pq Vt u_char 505Intended to represent a selection of physical layers on devices which 506support more than one; never implemented. 507.It Va ifi_addrlen --- 90 unchanged lines hidden (view full) --- 598.It Va ifi_lastchange 599.Pq Vt "struct timeval" 600The time of the last administrative change to the interface (as required 601for 602.Tn SNMP ) . 603.El 604.Ss Interface Types 605The header file |
606.Aq Pa net/if_types.h | 606.In net/if_types.h |
607defines symbolic constants for a number of different types of 608interfaces. 609The most common are: 610.Pp 611.Bl -tag -offset indent -width ".Dv IFT_PROPVIRTUAL" -compact 612.It Dv IFT_OTHER 613none of the following 614.It Dv IFT_ETHER --- 464 unchanged lines hidden --- | 607defines symbolic constants for a number of different types of 608interfaces. 609The most common are: 610.Pp 611.Bl -tag -offset indent -width ".Dv IFT_PROPVIRTUAL" -compact 612.It Dv IFT_OTHER 613none of the following 614.It Dv IFT_ETHER --- 464 unchanged lines hidden --- |