 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Bottom of page |
|
ifnet(9s)
NAME
ifnet - Network: Defines a network interface
SYNOPSIS
_____________________________________
Member Name Data Type
_____________________________________
if_name char *
if_version char *
if_addr struct sockaddr
if_flags short
if_unit short
if_mtu u_short
if_mediamtu u_short
if_timer short
if_addrlist struct ifaddr *
if_init int (*if_init) ()
if_output int (*if_output) ()
if_start int (*if_start) ()
if_ioctl int (*if_ioctl) ()
if_reset int (*if_reset) ()
if_watchdog int (*if_watchdog) ()
if_ipackets int
if_ierrors int
if_opackets int
if_oerrors int
if_collisions int
if_sysid_type int
if_iqdrops int
if_baudrate int
if_type u_char
if_addrlen u_char
if_hdrlen u_char
if_affinity int
if_snd struct ifqueue
lk_softc simple_lock_data_t
_____________________________________
MEMBERS
if_name
Specifies the name of the driver associated with the network interface,
for example, tu and lo. Typically, you set this member in the driver's
attach interface.
if_version
Specifies the version of the network interface. Typically, this version
is a character string, for example, 3Com EtherLink III. You usually
set this member in the driver's attach interface to a character string
that identifies the version of the network interface.
if_addr
Specifies the address of the network interface. You usually initialize
this field in the driver's attach interface.
if_flags
Specifies the status flags that indicate, for example, whether the
broadcast address is valid, that the interface is up and running, that
the interface is a point-to-point link, and so forth.
Typically, you set this member to the bitwise inclusive OR of the valid
status flags defined in the <if.h> file. The following are some of the
status flags:
IFF_BROADCAST
The network interface supports broadcasting and the associated
broadcast address is valid.
IFF_MULTICAST
The network interface supports multicast addresses.
IFF_NOTRAILERS
The transmission avoids the use of trailers. The term trailers
refers to the IP trailer encapsulation protocol, which is obsolete.
IFF_SIMPLEX
The interface cannot identify its own transmissions.
IFF_LOOPBACK
The network interface supports loopback mode.
IFF_RUNNING
The network interface is up and running.
if_unit
Specifies the subunit for the lower-level driver. This subunit is
usually the controller number. This member is set by if_alloc() when
this data structure is allocated.
if_mtu
Specifies the maximum transmission unit. You usually set this member in
the driver's attach interface to the media-specific constant that
represents the maximum transmission unit. The following are some of the
media-specific constants that represent the maximum transmission unit:
ETHERMTU
The maximum transmission unit for Ethernet media. The <if_ether.h>
file defines the ETHERMTU constant.
FDDIMTU
The maximum transmission unit for FDDI media. The <if_fddi.h> file
defines the FDDIMTU constant.
TRN4_RFC1042_IP_MTU
The maximum transmission unit for the 4-megabits/second Token Ring
media. The <if_trn.h> file defines the TRN4_RFC1042_IP_MTU
constant.
TRN16_RFC1042_IP_MTU
The maximum transmission unit for the 16-megabits/second Token Ring
media. The <if_trn.h> file defines the TRN16_RFC1042_IP_MTU
constant.
if_mediamtu
Specifies the maximum transmission unit of the media. Typically, you
set this member in the driver's attach interface to the media-specific
constant that represents the maximum transmission unit of the media.
The following are some of the media-specific constants that represent
the maximum transmission unit of the media:
ETHERMTU
The maximum transmission unit for the Ethernet media. The
<if_ether.h> file defines the ETHERMTU constant. Note that this
constant is also used to set the maximum transmission unit in the
if_mtu member.
FDDIMEDIAMTU
The maximum transmission unit for the FDDI media. The <if_fddi.h>
file defines the FDDIMEDIAMTU constant.
TRN4_MEDIA_MTU
The maximum transmission unit for the 4-megabits/second Token Ring
media. The <if_trn.h> file defines the TRN4_MEDIA_MTU constant.
TRN16_MEDIA_MTU
The maximum transmission unit for the 16-megabits/second Token Ring
media. The <if_trn.h> file defines the TRN16_MEDIA_MTU constant.
if_timer
Specifies the time until the driver's watchdog interface is called.
Typically, you set the if_timer member in the driver's attach interface
to the value 0 (zero).
if_addrlist
Specifies a linked list of addresses per interface.
if_init
Specifies a pointer to an if_init interface. Typically, you set this
member in the driver's attach interface to the name of the network
driver's init interface.
if_output
Specifies a pointer to an if_output interface. Typically, you set this
member in the driver's attach interface to the ether_output interface.
if_start
Specifies a pointer to an if_start interface. Typically, you set this
member in the driver's attach interface to the name of the network
driver's start interface.
if_ioctl
Specifies a pointer to an if_ioctl interface. Typically, you set this
member in the driver's attach interface to the name of the network
driver's ioctl interface.
if_reset
Specifies a pointer to an if_reset interface. Typically, you set this
member in the driver's attach interface to the name of the network
driver's reset interface.
if_watchdog
Specifies a pointer to an if_watchdog interface. Typically, you set
this member in the driver's attach interface to the name of the network
driver's watchdog interface.
if_ipackets
Specifies the number of packets received on the interface.
if_ierrors
Specifies the number of input errors on the network interface.
if_opackets
Specifies the number of packets sent on the network interface.
if_oerrors
Specifies the number of output errors on the network interface.
if_collisions
Specifies the number of collisions on CSMA/CD interfaces.
if_sysid_type
Specifies a unique number that identifies the bus adapter hardware to
the network management software. This number is referred to as the MOP
system ID device code. Typically, you set this member in the driver's
attach interface.
if_iqdrops
Specifies that this network interface dropped the packet on input.
if_baudrate
Specifies the line speed. Typically, you set this member in the
driver's attach interface to a media-specific constant that represents
the line speed for the media. The following are some of the media-
specific constants you can use:
ETHER_BANDWIDTH_10MB
Ethernet line speed is 10 megabits/second. The <if_ether.h> file
defines the ETHER_BANDWIDTH_10MB constant.
FDDI_BANDWIDTH_100MB
FDDI line speed is 100 megabits/second. The <if_fddi.h> file
defines the FDDI_BANDWIDTH_100MB constant.
TRN_BANDWIDTH_4MB
Token Ring line speed is 4 megabits/second. The <if_trn.h> file
defines the TRN_BANDWIDTH_4MB constant.
TRN_BANDWIDTH_16MB
Token Ring line speed is 16 megabits/second. The <if_trn.h> file
defines the TRN_BANDWIDTH_16MB constant.
if_type
Specifies the type of network interface, for example, Ethernet, FDDI,
Token Ring, and so forth. Typically, you set this member in the
driver's attach interface. The following are some of the valid
interface types defined in the <if_types.h> file:
IFT_ETHER
Ethernet I or II interface
IFT_FDDI
FDDI interface
IFT_ISO88025
Token Ring interface
if_addrlen
Specifies the media address length. Typically, you set this member in
the driver's attach interface to an integer value. For most network
interfaces, this value is 6.
if_hdrlen
Specifies the maximum media header length. Typically, you set this
member in the driver's attach interface to the media header length plus
the number of bytes required to specify the protocol. For most network
interfaces, this is an additional 8 bytes to cover the length of an LLC
and SNAP header. The media header length is represented by the
following data structures:
ether_header
The media header length structure associated with Ethernet media.
The <ether_driver.h> file defines the ether_header structure.
fddi_header
The media header length structure associated with FDDI media. The
<if_fddi.h> file defines the fddi_header structure.
trn_header
The media header length structure associated with Token Ring media.
The <if_trn.h> file defines the trn_header structure.
if_affinity
Specifies which CPU to run on. Typically, you set this member in the
driver's attach interface to a constant that indicates whether this
network driver can operate in a symmetric multiprocessor (SMP)
environment. You can set this member to one of the following constants,
defined in <if.h>:
NETMASTERCPU
Specifies that you want to funnel the network device driver because
you have not made it SMP safe. The network driver is forced to
execute on a single CPU (the master).
NETALLCPU
Specifies that you do not want to funnel the network device driver
because you have made it SMP safe. The network driver can execute
on multiple CPUs. You make a network device driver SMP safe by
using the simple or complex lock mechanism in all critical sections
of the driver.
if_snd
Specifies the output queue. The queue is a structure that contains the
following members:
·
A pointer to an mbuf structure that contains the queue head
·
A pointer to an mbuf structure that contains the queue tail
·
The maximum length of the queue
·
The number of elements in the queue
lk_softc
Specifies a pointer to the driver's lock structure.
DESCRIPTION
The ifnet data structure defines a network interface. In addition to
storing the entry points for a network driver's associated interfaces, the
ifnet data structure stores information such as the transmission medium and
statistics to track the performance of the interface and network.
The ifnet data structure also contains a queue of data packets that the
network driver sends to the network device. These packets are linked lists
of mbuf data structures. Each such linked list represents one data packet.
The upper-level network code fragments data to be sent out over a network
interface based on how a network driver fills in certain members of the
ifnet data structure. In the case of the Ethernet network interface, the
upper-level code never hands off a single packet that exceeds 1514 bytes to
a network driver.
A network driver's probe interface allocates and its attach interface
initializes the ifnet data structure. Its ioctl, output, and start
interfaces take an ifnet structure pointer as a formal parameter.
FILES
<net/if.h>
SEE ALSO
Routines: if_alloc(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Top of page |
|