NetBSD-5.0.2/share/doc/iso/wiscman/if.4n

.\"	$NetBSD: if.4n,v 1.3 1998/01/09 06:35:23 perry Exp $
.\"
.\"#
.\"# 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1988
.\"# LICENSED MATERIALS - PROPERTY OF IBM
.\"# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
.\"#
.\"# WISC: Header:if.4n_ca 1.5$ 
.\"# WISC: ACIS:if.4n_ca 1.5$ 
.\"# WISC: Source: /ibm/acis/usr/man/man4/RCS/if.4n_ca,v $ 
.\" @(#)if.4n	1.2 87/08/23 3.2/4.3NFSSRC
.\" @(#)if.4n	1.2 87/02/10 NFSSRC
.\" @(#)if.4n 1.1 86/09/25 SMI;
.TH IF 4N "Sept 1988" "Space overwritten" " "
.AC 1 0
.SH NAME
if \- general properties of network interfaces (NFS only)
.SH DESCRIPTION
.IX  "if device"  ""  "\fLif\fP \(em network interface general properties"  ""  PAGE START
Each network interface in a system corresponds to a
path through which messages may be sent and received.  A network
interface usually has a hardware device associated with it, but
certain interfaces, such as the loopback interface
.IR lo (4),
do not.
.LP
At boot time each interface which has underlying hardware support
makes itself known to the system during the autoconfiguration
process.  Once the interface has acquired its address it is
expected to install a routing table entry so that messages may
be routed through it.  Most interfaces require some part of
their address specified with an SIOCSIFADDR ioctl before they
will allow traffic to flow through them.  On interfaces where
the network-link layer address mapping is static, only the
network number is taken from the ioctl; the remainder is found
in a hardware specific manner.  On interfaces which provide
dynamic network-link layer address mapping facilities (for example,
10Mb/s Ethernets using
.IR arp (4P),),
the entire address specified in the ioctl is used.
.LP
The following 
.I ioctl
calls may be used to manipulate network interfaces.  Unless
specified otherwise, the request takes an
.I ifreq
structure as its parameter.  This structure has the form
.RS
.nf
struct	ifreq {
	char	ifr_name[16];		/* name of interface (e.g. "ec0") */
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		short	ifru_flags;
	} ifr_ifru;
#define	ifr_addr		ifr_ifru.ifru_addr	/* address */
#define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
#define	ifr_flags		ifr_ifru.ifru_flags	/* flags */
};
.fi
.RE
.IP SIOCSIFADDR 5
.IX  "ioctls for sockets"  "SIOCSIFADDR"  "\fLioctl\fP's for sockets"  "\fLSIOCSIFADDR\fP \(em set ifnet address"
.IX  "SIOCSIFADDR set ifnet address"  ""  "\fLSIOCSIFADDR\fP \(em set ifnet address"
.IX  set "ifnet address ioctl \(em \fLSIOCSIFADDR\fP"
.IX  "network interface ioctls"  SIOCSIFADDR  "network interface \fLioctl\fP's" "\fLSIOCSIFADDR\fP \(em set ifnet address"
Set interface address.  Following the address
assignment, the ``initialization'' routine for
the interface is called.
.IP SIOCGIFADDR
.IX  "ioctls for sockets"  "SIOCGIFADDR"  "\fLioctl\fP's for sockets"  "\fLSIOCGIFADDR\fP \(em get ifnet address"
.IX  "SIOCGIFADDR get ifnet address"  ""  "\fLSIOCGIFADDR\fP \(em get ifnet address"
.IX  get "ifnet address \fLioctl\fP \(em \fLSIOCGIFADDR\fP"
.IX  "network interface ioctls"  SIOCGIFADDR  "network interface \fLioctl\fP's" "\fLSIOCGIFADDR\fP \(em get ifnet address"
Get interface address.
.IP SIOCSIFDSTADDR
.IX  "ioctls for sockets"  "SIOCSIFDSTADDR"  "\fLioctl\fP's for sockets"  "\fLSIOCSIFDSTADDR\fP \(em set p-p address"
.IX  "SIOCSIFDSTADDR set p-p address"  ""  "\fLSIOCSIFDSTADDR\fP \(em set p-p address"
.IX  set "p-p address ioctl \(em \fLSIOCSIFDSTADDR\fP"
.IX  "network interface ioctls"  SIOCSIFDSTADDR  "network interface \fLioctl\fP's" "\fLSIOCSIFDSTADDR\fP \(em set p-p address"
Set point to point address for interface.
.IP SIOCGIFDSTADDR
.IX  "ioctls for sockets"  "SIOCGIFDSTADDR"  "\fLioctl\fP's for sockets"  "\fLSIOCGIFDSTADDR\fP \(em get p-p address"
.IX  "SIOCGIFDSTADDR get p-p address"  ""  "\fLSIOCGIFDSTADDR\fP \(em get p-p address"
.IX  get "p-p address \fLioctl\fP \(em \fLSIOCGIFDSTADDR\fP"
.IX  "network interface ioctls"  SIOCGIFDSTADDR  "network interface \fLioctl\fP's" "\fLSIOCGIFDSTADDR\fP \(em get p-p address"
Get point to point address for interface.
.IP SIOCSIFFLAGS
.IX  "ioctls for sockets"  "SIOCSIFFLAGS"  "\fLioctl\fP's for sockets"  "\fLSIOCSIFFLAGS\fP \(em set ifnet flags"
.IX  "SIOCSIFFLAGS set ifnet flags"  ""  "\fLSIOCSIFFLAGS\fP \(em set ifnet flags"
.IX  set "ifnet flags ioctl \(em \fLSIOCSIFFLAGS\fP"
.IX  "network interface ioctls"  SIOCSIFFLAGS  "network interface \fLioctl\fP's" "\fLSIOCSIFFLAGS\fP \(em set ifnet flags"
Set interface flags field.  If the interface is marked down,
any processes currently routing packets through the interface
are notified.
.IP SIOCGIFFLAGS
.IX  "ioctls for sockets"  "SIOCGIFFLAGS"  "\fLioctl\fP's for sockets"  "\fLSIOCGIFFLAGS\fP \(em get ifnet flags"
.IX  "SIOCGIFFLAGS get ifnet flags"  ""  "\fLSIOCGIFFLAGS\fP \(em get ifnet flags"
.IX  get "ifnet flags \fLioctl\fP \(em \fLSIOCGIFFLAGS\fP"
.IX  "network interface ioctls"  SIOCGIFFLAGS  "network interface \fLioctl\fP's" "\fLSIOCGIFFLAGS\fP \(em get ifnet flags"
Get interface flags.
.IP SIOCGIFCONF
.IX  "ioctls for sockets"  "SIOCGIFCONF"  "\fLioctl\fP's for sockets"  "\fLSIOCGIFCONF\fP \(em get ifnet list"
.IX  "SIOCGIFCONF get ifnet list"  ""  "\fLSIOCGIFCONF\fP \(em get ifnet list"
.IX  get "ifnet list \fLioctl\fP \(em \fLSIOCGIFCONF\fP"
.IX  "network interface ioctls"  SIOCGIFCONF  "network interface \fLioctl\fP's" "\fLSIOCGIFCONF\fP \(em get ifnet list"
Get interface configuration list.  This request takes an
.I ifconf
structure (see below) as a value-result parameter.  The 
.I ifc_len
field should be initially set to the size of the buffer
pointed to by 
.IR ifc_buf .
On return it will contain the length, in bytes, of the
configuration list.
.RS
.nf
/*
 * Structure used in SIOCGIFCONF request.
 * Used to retrieve interface configuration
 * for machine (useful for programs which
 * must know all networks accessible).
 */
struct	ifconf {
	int	ifc_len;		/* size of associated buffer */
	union {
		caddr_t	ifcu_buf;
		struct	ifreq *ifcu_req;
	} ifc_ifcu;
#define	ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address */
#define	ifc_req	ifc_ifcu.ifcu_req	/* array of structures returned */
};
.RE
.fi
.IX  "if device"  ""  "\fLif\fP \(em network interface general properties"  ""  PAGE END
.SH "SEE ALSO
arp(4P), ec(4S), lo(4)