Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
IFNET(9)		 BSD Kernel Developer's	Manual		      IFNET(9)

NAME
     ifnet, ifaddr, ifqueue, if_data --	kernel interfaces for manipulating
     network interfaces

SYNOPSIS
     #include <sys/param.h>
     #include <sys/time.h>
     #include <sys/socket.h>
     #include <net/if.h>
     #include <net/if_var.h>
     #include <net/if_types.h>

   Interface Manipulation Functions
     void
     if_attach(struct ifnet *ifp);

     void
     if_down(struct ifnet *ifp);

     int
     ifioctl(struct socket *so,	u_long cmd, caddr_t data, struct thread	*td);

     int
     ifpromisc(struct ifnet *ifp, int pswitch);

     int
     if_allmulti(struct	ifnet *ifp, int	amswitch);

     struct ifnet *
     ifunit(const char *name);

     void
     if_up(struct ifnet	*ifp);

   Interface Address Functions
     struct ifaddr *
     ifa_ifwithaddr(struct sockaddr *addr);

     struct ifaddr *
     ifa_ifwithdstaddr(struct sockaddr *addr);

     struct ifaddr *
     ifa_ifwithnet(struct sockaddr *addr);

     struct ifaddr *
     ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp);

     void
     ifafree(struct ifaddr *ifa);

     IFAFREE(struct ifaddr *ifa);

   Interface Multicast Address Functions
     int
     if_addmulti(struct	ifnet *ifp, struct sockaddr *sa,
	 struct	ifmultiaddr **ifmap);

     int
     if_delmulti(struct	ifnet *ifp, struct sockaddr *sa);

     struct ifmultiaddr	*
     ifmaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp);

   Output queue	macros
     IF_DEQUEUE(struct ifqueue *ifq, struct mbuf *m);

   struct ifnet	Member Functions
     int
     (*if_output)(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
	 struct	rtentry	*rt);

     void
     (*if_start)(struct	ifnet *ifp);

     int
     (*if_done)(struct ifnet *ifp);

     int
     (*if_ioctl)(struct	ifnet *ifp, int	cmd, caddr_t data);

     void
     (*if_watchdog)(struct ifnet *ifp);

     int
     (*if_poll_recv)(struct ifnet *ifp,	int *quotap);

     int
     (*if_poll_xmit)(struct ifnet *ifp,	int *quotap);

     void
     (*if_poll_inttrn)(struct ifnet *ifp);

     void
     (*if_poll_slowinput)(struct ifnet *ifp, struct mbuf *m);

     void
     (*if_init)(void *if_softc);

     int
     (*if_resolvemulti)(struct ifnet *ifp, struct sockaddr **retsa,
	 struct	sockaddr *addr);

   struct ifaddr member	function
     void
     (*ifa_rtrequest)(int cmd, struct rtentry *rt, struct sockaddr *dst);

   Global Variables
     extern struct ifnethead ifnet;
     extern struct ifaddr **ifnet_addrs;
     extern int	if_index;
     extern int	ifqmaxlen;

DATA STRUCTURES
     The kernel	mechanisms for handling	network	interfaces reside primarily in
     the ifnet,	if_data, ifaddr, and ifmultiaddr structures in <net/if.h> and
     <net/if_var.h> and	the functions named above and defined in
     /sys/net/if.c.  Those interfaces which are	intended to be used by user
     programs are defined in <net/if.h>; these include the interface flags,
     the if_data structure, and	the structures defining	the appearance of in-
     terface-related messages on the route(4) routing socket and in sysctl(3).
     The header	file <net/if_var.h> defines the	kernel-internal	interfaces,
     including the ifnet, ifaddr, and ifmultiaddr structures and the functions
     which manipulate them.  (A	few user programs will need <net/if_var.h> be-
     cause it is the prerequisite of some other	header file like
     <netinet/if_ether.h>.  Most references to those two files in particular
     can be replaced by	<net/ethernet.h>.)

     The system	keeps a	linked list of interfaces using	the TAILQ macros de-
     fined in queue(3);	this list is headed by a struct	ifnethead called
     ifnet.  The elements of this list are of type struct ifnet, and most ker-
     nel routines which	manipulate interface as	such accept or return pointers
     to	these structures.  Each	interface structure contains an	if_data	struc-
     ture, which contains statistics and identifying information used by man-
     agement programs, and which is exported to	user programs by way of	the
     ifmib(4) branch of	the sysctl(3) MIB.  Each interface also	has a TAILQ of
     interface addresses, described by ifaddr structures; the head of the
     queue is always an	AF_LINK	address	(see link_addr(3)) describing the link
     layer implemented by the interface	(if any).  (Some trivial interfaces do
     not provide any link layer	addresses; this	structure, while still
     present, serves only to identify the interface name and index.)

     Finally, those interfaces supporting reception of multicast datagrams
     have a TAILQ of multicast group memberships, described by ifmultiaddr
     structures.  These	memberships are	reference-counted.

     Interfaces	are also associated with an output queue, defined as a struct
     ifqueue; this structure is	used to	hold packets while the interface is in
     the process of sending another.

   The ifnet structure
     The fields	of struct ifnet	are as follows:

	   if_softc	    (void *) A pointer to the driver's private state
			    block.  (Initialized by driver.)

	   if_link	    (TAILQ_ENTRY(ifnet)) queue(3) macro	glue.

	   if_xname	    (char *) The name of the interface,	(e.g., "fxp0"
			    or "lo0)".	(Initialized by	driver.)

	   if_dname	    (const char	*) The name of the driver.  (Initial-
			    ized by driver.)

	   if_dunit	    (int) A unique number assigned to each interface
			    managed by a particular driver.  Drivers may
			    choose to set this to IF_DUNIT_NONE	if a unit num-
			    ber	is not associated with the device.  (Initial-
			    ized by driver.)

	   if_addrhead	    (struct ifaddrhead)	The head of the	queue(3) TAILQ
			    containing the list	of addresses assigned to this
			    interface.

	   if_pcount	    (int) A count of promiscuous listeners on this in-
			    terface, used to reference-count the IFF_PROMISC
			    flag.

	   if_bpf	    (struct bpf_if *) Opaque per-interface data	for
			    the	packet filter, bpf(4).	(Initialized by
			    bpf_attach().)

	   if_index	    (u_short) A	unique number assigned to each inter-
			    face in sequence as	it is attached.	 This number
			    can	be used	in a struct sockaddr_dl	to refer to a
			    particular interface by index (see link_addr(3)).

	   if_timer	    (short) Number of seconds until the	watchdog timer
			    if_watchdog() is called, or	zero if	the timer is
			    disabled.  (Set by driver, decremented by generic
			    watchdog code.)

	   if_flags	    (int) Flags	describing operational parameters of
			    this interface (see	below).	 (Manipulated by both
			    driver and generic code.)

	   if_capabilities  (int) Flags	describing the capabilities the	inter-
			    face supports (see below).

	   if_capenable	    (int) Flags	describing the enabled capabilities of
			    the	interface (see below).

	   if_linkmib	    (void *) A pointer to an interface-specific	MIB
			    structure exported by ifmib(4).  (Initialized by
			    driver.)

	   if_linkmiblen    (size_t) The size of said structure.  (Initialized
			    by driver.)

	   if_data	    (struct if_data) More statistics and information;
			    see	The if_data structure, below.  (Initialized by
			    driver, manipulated	by both	driver and generic
			    code.)

	   if_snd	    (struct ifqueue) The output	queue.	(Manipulated
			    by driver.)

     There are in addition a number of function	pointers which the driver must
     initialize	to complete its	interface with the generic interface layer:

	   if_output()
	   Output a packet on interface	ifp, or	queue it on the	output queue
	   if the interface is already active.

	   if_start()
	   Start queued	output on an interface.	 This function is exposed in
	   order to provide for	some interface classes to share	a if_output()
	   among all drivers.  if_start() may only be called when the
	   IFF_OACTIVE flag is not set.	 (Thus,	IFF_OACTIVE does not literally
	   mean	that output is active, but rather that the device's internal
	   output queue	is full.)

	   if_done()
	   Not used.  We are not even sure what	it was ever for.  The proto-
	   type	is faked.

	   if_ioctl()
	   Process interface-related ioctl(2) requests (defined	in
	   <sys/sockio.h>).  Preliminary processing is done by the generic
	   routine ifioctl() to	check for appropriate privileges, locate the
	   interface being manipulated,	and perform certain generic operations
	   like	twiddling flags	and flushing queues.  See the description of
	   ifioctl() below for more information.

	   if_watchdog()
	   Routine called by the generic code when the watchdog	timer,
	   if_timer, expires.  Usually this will reset the interface.

	   if_init()
	   Initialize and bring	up the hardware, e.g., reset the chip and the
	   watchdog timer and enable the receiver unit.	 Should	mark the in-
	   terface running, but	not active (IFF_RUNNING, ~IIF_OACTIVE).

	   if_resolvemulti()
	   Check the requested multicast group membership, addr, for validity,
	   and if necessary compute a link-layer group which corresponds to
	   that	address	which is returned in *retsa.  Returns zero on success,
	   or an error code on failure.

   Interface Flags
     Interface flags are used for a number of different	purposes.  Some	flags
     simply indicate information about the type	of interface and its capabili-
     ties; others are dynamically manipulated to reflect the current state of
     the interface.  Flags of the former kind are marked <S> in	this table;
     the latter	are marked <D>.

	   IFF_UP	    <D>	The interface has been configured up by	the
			    user-level code.
	   IFF_BROADCAST    <S*> The interface supports	broadcast.
	   IFF_DEBUG	    <D>	Used to	enable/disable driver debugging	code.
	   IFF_LOOPBACK	    <S>	The interface is a loopback device.
	   IFF_POINTOPOINT  <S*> The interface is point-to-point; "broadcast"
			    address is actually	the address of the other end.
	   IFF_RUNNING	    <D*> The interface has been	configured and dynamic
			    resources were successfully	allocated.  Probably
			    only useful	internal to the	interface.
	   IFF_NOARP	    <D>	Disable	network	address	resolution on this in-
			    terface.
	   IFF_PROMISC	    <D*> This interface	is in promiscuous mode.
	   IFF_PPROMISC	    <D>	This interface is in the permanently promiscu-
			    ous	mode (implies IFF_PROMISC).
	   IFF_ALLMULTI	    <D*> This interface	is in all-multicasts mode
			    (used by multicast routers).
	   IFF_OACTIVE	    <D*> The interface's hardware output queue (if
			    any) is full; output packets are to	be queued.
	   IFF_SIMPLEX	    <S*> The interface cannot hear its own transmis-
			    sions.
	   IFF_LINK0
	   IFF_LINK1
	   IFF_LINK2	    <D>	Control	flags for the link layer.  (Currently
			    abused to select among multiple physical layers on
			    some devices.)
	   IFF_MULTICAST    <S*> This interface	supports multicast.

     The macro IFF_CANTCHANGE defines the bits which cannot be set by a	user
     program using the SIOCSIFFLAGS command to ioctl(2); these are indicated
     by	an asterisk in the listing above.

   Interface Capabilities Flags
     Interface capabilities are	specialized features an	interface may or may
     not support.  These capabilities are very hardware-specific and allow,
     when enabled, to offload specific network processing to the interface.

	   IFCAP_NETCONS  This interface can be	a network console.

	   IFCAP_RXCSUM	  This interface can do	checksum validation on receiv-
			  ing data.  Some interfaces do	not have sufficient
			  buffer storage to store frames above a certain MTU-
			  size completely.  The	driver for the interface might
			  disable hardware checksum validation if the MTU is
			  set above the	hardcoded limit.

	   IFCAP_TXCSUM	  This interface can do	checksum calculation on	trans-
			  mitting data.

   The if_data Structure
     In	4.4BSD,	a subset of the	interface information believed to be of	inter-
     est to management stations	was segregated from the	ifnet structure	and
     moved into	its own	if_data	structure to facilitate	its use	by user	pro-
     grams.  The following elements of the if_data structure are initialized
     by	the interface and are not expected to change significantly over	the
     course of normal operation:

	   ifi_type	   (u_char) The	type of	the interface, as defined in
			   <net/if_types.h> and	described below	in the
			   Interface Types section.

	   ifi_physical	   (u_char) Intended to	represent a selection of phys-
			   ical	layers on devices which	support	more than one;
			   never implemented.

	   ifi_addrlen	   (u_char) Length of a	link-layer address on this de-
			   vice, or zero if there are none.  Used to initial-
			   ized	the address length field in sockaddr_dl	struc-
			   tures referring to this interface.

	   ifi_hdrlen	   (u_char) Maximum length of any link-layer header
			   which might be prepended by the driver to a packet
			   before transmission.	 The generic code computes the
			   maximum over	all interfaces and uses	that value to
			   influence the placement of data in mbufs to attempt
			   to ensure that there	is always sufficient space to
			   prepend a link-layer	header without allocating an
			   additional mbuf.

	   ifi_mtu	   (u_long) The	maximum	transmission unit of the
			   medium, exclusive of	any link-layer overhead.

	   ifi_metric	   (u_long) A dimensionless metric interpreted by a
			   user-mode routing process.

	   ifi_baudrate	   (u_long) The	line rate of the interface, in bits
			   per second.

     The structure additionally	contains generic statistics applicable to a
     variety of	different interface types (except as noted, all	members	are of
     type u_long):

	   ifi_ipackets	   Number of packets received.

	   ifi_ierrors	   Number of receive errors detected (e.g., FCS	er-
			   rors, DMA overruns, etc.).  More detailed break-
			   downs can often be had by way of a link-specific
			   MIB.

	   ifi_opackets	   Number of packets transmitted.

	   ifi_oerrors	   Number of output errors detected (e.g., late	colli-
			   sions, DMA overruns,	etc.).	More detailed break-
			   downs can often be had by way of a link-specific
			   MIB.

	   ifi_collisions  Total number	of collisions detected on output for
			   CSMA	interfaces.  (This member is sometimes
			   [ab]used by other types of interfaces for other
			   output error	counts.)

	   ifi_ibytes	   Total traffic received, in bytes.

	   ifi_obytes	   Total traffic transmitted, in bytes.

	   ifi_imcasts	   Number of packets received which were sent by link-
			   layer multicast.

	   ifi_omcasts	   Number of packets sent by link-layer	multicast.

	   ifi_iqdrops	   Number of packets dropped on	input.	Rarely imple-
			   mented.

	   ifi_noproto	   Number of packets received for unknown network-
			   layer protocol.

	   ifi_lastchange  (struct timeval) The	time of	the last administra-
			   tive	change to the interface	(as required for
			   SNMP).

   Interface Types
     The header	file <net/if_types.h> defines symbolic constants for a number
     of	different types	of interfaces.	The most common	are:

	   IFT_OTHER	    none of the	following
	   IFT_ETHER	    Ethernet
	   IFT_ISO88023	    ISO	8802-3 CSMA/CD
	   IFT_ISO88024	    ISO	8802-4 Token Bus
	   IFT_ISO88025	    ISO	8802-5 Token Ring
	   IFT_ISO88026	    ISO	8802-6 DQDB MAN
	   IFT_FDDI	    FDDI
	   IFT_PPP	    Internet Point-to-Point Protocol (ppp(8))
	   IFT_LOOP	    The	loopback (lo(4)) interface
	   IFT_SLIP	    Serial Line	IP
	   IFT_PARA	    Parallel-port IP ("PLIP")
	   IFT_ATM	    Asynchronous Transfer Mode

   The ifaddr Structure
     Every interface is	associated with	a list (or, rather, a TAILQ) of	ad-
     dresses, rooted at	the interface structure's if_addrlist member.  The
     first element in this list	is always an AF_LINK address representing the
     interface itself; multi-access network drivers should complete this
     structure by filling in their link-layer addresses	after calling
     if_attach().  Other members of the	structure represent network-layer ad-
     dresses which have	been configured	by means of the	SIOCAIFADDR command to
     ioctl(2), called on a socket of the appropriate protocol family.  The el-
     ements of this list consist of ifaddr structures.	Most protocols will
     declare their own protocol-specific interface address structures, but all
     begin with	a struct ifaddr	which provides the most-commonly-needed	func-
     tionality across all protocols.  Interface	addresses are reference-
     counted.

     The members of struct ifaddr are as follows:

	   ifa_addr	  (struct sockaddr *) The local	address	of the inter-
			  face.

	   ifa_dstaddr	  (struct sockaddr *) The remote address of point-to-
			  point	interfaces, and	the broadcast address of
			  broadcast interfaces.	 (ifa_broadaddr	is a macro for
			  ifa_dstaddr.)

	   ifa_netmask	  (struct sockaddr *) The network mask for multi-ac-
			  cess interfaces, and the confusion generator for
			  point-to-point interfaces.

	   ifa_ifp	  (struct ifnet	*) A link back to the interface	struc-
			  ture.

	   ifa_link	  (TAILQ_ENTRY(ifaddr))	queue(3) glue for list of ad-
			  dresses on each interface.

	   ifa_rtrequest  See below.

	   ifa_flags	  (u_short) Some of the	flags which would be used for
			  a route representing this address in the route ta-
			  ble.

	   ifa_refcnt	  (short) The reference	count.

	   ifa_metric	  (int)	A metric associated with this interface	ad-
			  dress, for the use of	some external routing proto-
			  col.

     References	to ifaddr structures are gained	manually, by incrementing the
     ifa_refcnt	member.	 References are	released by calling either the
     ifafree() function	or the IFAFREE() macro.

     ifa_rtrequest() is	a pointer to a function	which receives callouts	from
     the routing code (rtrequest()) to perform link-layer-specific actions
     upon requests to add, resolve, or delete routes.  The cmd argument	indi-
     cates the request in question: RTM_ADD, RTM_RESOLVE, or RTM_DELETE.  The
     rt	argument is the	route in question; the dst argument is the specific
     destination being manipulated for RTM_RESOLVE, or a null pointer other-
     wise.

FUNCTIONS
     The functions provided by the generic interface code can be divided into
     two groups: those which manipulate	interfaces, and	those which manipulate
     interface addresses.  In addition to these	functions, there may also be
     link-layer	support	routines which are used	by a number of drivers imple-
     menting a specific	link layer over	different hardware; see	the documenta-
     tion for that link	layer for more details.

   The ifmultiaddr Structure
     Every multicast-capable interface is associated with a list of multicast
     group memberships,	which indicate at a low	level which link-layer multi-
     cast addresses (if	any) should be accepted, and at	a high level, in which
     network-layer multicast groups a user process has expressed interest.

     The elements of the structure are as follows:

	   ifma_link	  (LIST_ENTRY(ifmultiaddr)) queue(3) macro glue.

	   ifma_addr	  (struct sockaddr *) A	pointer	to the address which
			  this record represents.  The memberships for various
			  address families are stored in arbitrary order.

	   ifma_lladdr	  (struct sockaddr *) A	pointer	to the link-layer mul-
			  ticast address, if any, to which the network-layer
			  multicast address in ifma_addr is mapped, else a
			  null pointer.	 If this element is non-nil, this mem-
			  bership also holds an	invisible reference to another
			  membership for that link-layer address.

	   ifma_refcount  (u_int) A reference count of requests	for this par-
			  ticular membership.

   Interface Manipulation Functions
	   if_attach()
	   Link	the specified interface	ifp into the list of network inter-
	   faces.  Also	initialize the list of addresses on that interface,
	   and create a	link-layer ifaddr structure to be the first element in
	   that	list.  (A pointer to this address structure is saved in	the
	   global array	ifnet_addrs.)

	   if_down()
	   Mark	the interface ifp as down (i.e., IFF_UP	is not set), flush its
	   output queue, notify	protocols of the transition, and generate a
	   message from	the route(4) routing socket.

	   if_up()
	   Mark	the interface ifp as up, notify	protocols of the transition,
	   and generate	a message from the route(4) routing socket.

	   ifpromisc()
	   Add or remove a promiscuous reference to ifp.  If pswitch is	true,
	   add a reference; if it is false, remove a reference.	 On reference
	   count transitions from zero to one and one to zero, set the
	   IFF_PROMISC flag appropriately and call if_ioctl() to set up	the
	   interface in	the desired mode.

	   if_allmulti()
	   As ifpromisc(), but for the all-multicasts (IFF_ALLMULTI) flag in-
	   stead of the	promiscuous flag.

	   ifunit()
	   Return an ifnet pointer for the interface named name.

	   ifioctl()
	   Process the ioctl request cmd, issued on socket so by thread	td,
	   with	data parameter data.  This is the main routine for handling
	   all interface configuration requests	from user mode.	 It is ordi-
	   narily only called from the socket-layer ioctl(2) handler, and only
	   for commands	with class `i'.	 Any unrecognized commands will	be
	   passed down to socket so's protocol for further interpretation.
	   The following commands are handled by ifioctl():

		 SIOCGIFCONF
		 OSIOCGIFCONF	  Get interface	configuration.	(No call-down
				  to driver.)

		 SIOCGIFCAP
		 SIOCGIFFLAGS
		 SIOCGIFMETRIC
		 SIOCGIFMTU
		 SIOCGIFPHYS	  Get interface	capabilities, flags, metric,
				  MTU, medium selection.  (No call-down	to
				  driver.)

		 SIOCSIFCAP	  Enable interface capabilities.  Caller must
				  have appropriate privilege.

		 SIOCSIFFLAGS	  Change interface flags.  Caller must have
				  appropriate privilege.  If a change to the
				  IFF_UP flag is requested, if_up() or
				  if_down() is called as appropriate.  Flags
				  listed in IFF_CANTCHANGE are masked off, and
				  the driver if_ioctl()	routine	is called to
				  perform any setup requested.

		 SIOCSIFMETRIC
		 SIOCSIFPHYS	  Change interface metric or medium.  Caller
				  must have appropriate	privilege.

		 SIOCSIFMTU	  Change interface MTU.	 Caller	must have ap-
				  propriate privilege.	MTU values less	than
				  72 or	greater	than 65535 are considered in-
				  valid.  The driver if_ioctl()	routine	is
				  called to implement the change; it is	re-
				  sponsible for	any additional sanity checking
				  and for actually modifying the MTU in	the
				  interface structure.

		 SIOCADDMULTI
		 SIOCDELMULTI	  Add or delete	permanent multicast group mem-
				  berships on the interface.  Caller must have
				  appropriate privilege.  The if_addmulti() or
				  if_delmulti()	function is called to perform
				  the operation; qq.v.

		 SIOCSIFDSTADDR
		 SIOCSIFADDR
		 SIOCSIFBRDADDR
		 SIOCSIFNETMASK	  The socket's protocol	control	routine	is
				  called to implement the requested action.

		 OSIOGIFADDR
		 OSIOCGIFDSTADDR
		 OSIOCGIFBRDADDR
		 OSIOCGIFNETMASK  The socket's protocol	control	routine	is
				  called to implement the requested action.
				  On return, sockaddr structures are converted
				  into old-style (no sa_len member).

     if_down(),	ifioctl(), ifpromisc(),	and if_up() must be called at splnet()
     or	higher.

   Interface Address Functions
     Several functions exist to	look up	an interface address structure given
     an	address.  ifa_ifwithaddr() returns an interface	address	with either a
     local address or a	broadcast address precisely matching the parameter
     addr.  ifa_ifwithdstaddr()	returns	an interface address for a point-to-
     point interface whose remote ("destination") address is addr.

     ifa_ifwithnet() returns the most specific interface address which matches
     the specified address, addr, subject to its configured netmask, or	a
     point-to-point interface address whose remote address is addr if one is
     found.

     ifaof_ifpforaddr()	returns	the most specific address configured on	inter-
     face ifp which matches address addr, subject to its configured netmask.
     If	the interface is point-to-point, only an interface address whose re-
     mote address is precisely addr will be returned.

     All of these functions return a null pointer if no	such address can be
     found.

   Interface Multicast Address Functions
     The if_addmulti(),	if_delmulti(), and ifmaof_ifpforaddr() functions pro-
     vide support for requesting and relinquishing multicast group member-
     ships, and	for querying an	interface's membership list, respectively.
     The if_addmulti() function	takes a	pointer	to an interface, ifp, and a
     generic address, sa.  It also takes a pointer to a	struct ifmultiaddr *
     which is filled in	on successful return with the address of the group
     membership	control	block.	The if_addmulti() function performs the	fol-
     lowing four-step process:

	   1.	Call the interface's if_resolvemulti() entry point to deter-
		mine the link-layer address, if	any, corresponding to this
		membership request, and	also to	give the link layer an oppor-
		tunity to veto this membership request should it so desire.

	   2.	Check the interface's group membership list for	a pre-existing
		membership for this group.  If one is not found, allocate a
		new one; if one	is, increment its reference count.

	   3.	If the if_resolvemulti() routine returned a link-layer address
		corresponding to the group, repeat the previous	step for that
		address	as well.

	   4.	If the interface's multicast address filter needs to be
		changed	because	a new membership was added, call the inter-
		face's if_ioctl() routine (with	a cmd argument of
		SIOCADDMULTI) to request that it do so.

     The if_delmulti() function, given an interface ifp	and an address,	sa,
     reverses this process.  Both functions return zero	on success, or a stan-
     dard error	number on failure.

     The ifmaof_ifpforaddr() function examines the membership list of inter-
     face ifp for an address matching addr, and	returns	a pointer to that
     struct ifmultiaddr	if one is found, else it returns a null	pointer.

SEE ALSO
     ioctl(2), link_addr(3), queue(3), sysctl(3), bpf(4), ifmib(4), lo(4),
     netintro(4), config(8), ppp(8), rtentry(9)

     Gary R. Wright and	W. Richard Stevens, TCP/IP Illustrated,	Vol. 2,
     Addison-Wesley, ISBN 0-201-63354-X.

AUTHORS
     This manual page was written by Garrett A.	Wollman.

BSD			       January 15, 1997				   BSD

NAME | SYNOPSIS | DATA STRUCTURES | FUNCTIONS | SEE ALSO | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ifnet&sektion=9&manpath=FreeBSD+5.2-RELEASE>

home | help