Technical data
SunOS 5.5 Protocols if_tcp(7P)
NAME if_tcp, if − general properties of Internet Protocol network interfaces
DESCRIPTION A network interface is a device for sending and receivingpackets on a network. A net-
work interface is usually a hardware device, althoughone may be implemented in
software. Network interfaces used by the Internet Protocol (IP) must be STREAMS devices
conforming to the Datalink Provider Interface (DLPI). See dlpi(7P).
APPLICATION
PROGRAMMING
INTERFACE
An interface becomes available to IP when it is opened and theIP module is pushed onto
the stream with theI_PUSH ioctl(2) command (see streamio(7I)). This may be initiated
by the kernelat boot time or by a user program some time after the system is running.
Each interface must be assigned an IP address with the SIOCSIFADDR ioctl() before it
can be used. On interfaces where the network-to-link layer address mapping is static,
only the network number is taken from the ioctl() request; the remainder is found in a
hardware specific manner. On interfaces which provide dynamic network-to-link layer
address mapping facilities (for example, 10Mb/s Ethernets using arp(7P)), the entire
address specified in the ioctl( ) is used. A routing table entry for destinations on the net-
work of the interface is installed automatically when an interface’s address is set.
IOCTLS The following ioctl() calls may be used to manipulateIP network interfaces. Unless
specified otherwise, the request takes an ifreq structure as its parameter. This structure
has the form:
/∗ Interface request structure used for socket ioctls. All ∗/
/∗ interface ioctls must have parameter definitions which ∗/
/∗ begin with ifr_name. The remainder may be interface specific. ∗/
struct ifreq {
#define IFNAMSIZ 16
char ifr_name[IFNAMSIZ]; /∗ if name, for example ∗/
/∗ "emd1" ∗/
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
char ifru_oname[IFNAMSIZ]; /∗ other if name ∗/
struct sockaddr ifru_broadaddr;
short ifru_flags;
int ifru_metric;
char ifru_data[1]; /∗ interface dependent data ∗/
char ifru_enaddr[6];
int if_muxid[2]; /∗ mux id’s for arp and ip ∗/
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /∗ address ∗/
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /∗ other end of p-to-p
link ∗/
modified 11 Oct 1994 7P-139










