if.h revision 550b6e4083768ca350e9e7c3a1ebbf720b23dcad
2N/A * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * Copyright (c) 1982, 1986 Regents of the University of California. 2N/A * All rights reserved. The Berkeley software License Agreement 2N/A * specifies the terms and conditions for redistribution. 2N/A/* if.h 1.26 90/05/29 SMI; from UCB 7.1 6/4/86 */ 127N/A * Structures defining a network interface, providing a packet 127N/A * transport mechanism (ala level 0 of the PUP protocols). 145N/A * Each interface accepts output datagrams of a specified maximum 26N/A * length, and provides higher level routines with input datagrams 38N/A * received from its medium. 29N/A * Output occurs when the routine if_output is called, with three parameters: 93N/A * (*ifp->if_output)(ifp, m, dst) 29N/A * Here m is the mbuf chain to be sent and dst is the destination address. 29N/A * The output routine encapsulates the supplied datagram if necessary, 26N/A * and then transmits it on its medium. 29N/A * On input, each interface unwraps the data received by it, and either 26N/A * places it on the input queue of a internetwork datagram routine 2N/A * and posts the associated software interrupt, or passes the datagram to a raw 38N/A * packet input routine. 6N/A * Routines exist for locating interfaces by their addresses 2N/A * or for locating a interface on a certain network, as well as more general 58N/A * routing and gateway routines maintaining information used to locate 49N/A * Structure defining a queue for a network interface. 2N/A * (Would like to call this struct ``if'', but C isn't PL/1.) 61N/A/* procedure handles */ 61N/A/* generic interface statistics */ 61N/A/* end statistics */ 61N/A * NOTE : These flags are not directly used within IP. 43N/A * ip_if.h has definitions derived from this which is used within IP. 43N/A * If you define a flag here, you need to define one in ip_if.h before 120N/A * using the new flag in IP. Don't use these flags directly in IP. 64N/A#
define IFF_NOARP 0x0000000080 /* no address resolution protocol */ 64N/A * The IFF_MULTICAST flag indicates that the network can support the 64N/A * transmission and reception of higher-level (e.g., IP) multicast packets. 64N/A * It is independent of hardware support for multicasting; for example, 43N/A * point-to-point links or pure broadcast networks may well support 16N/A * higher-level multicasts. 12N/A * The following flags can't be grabbed or altered by SIOC[GS]IFFLAGS. 12N/A * Should use SIOC[GS]LIFFLAGS which has a larger flags field. 40N/A * The IFF_XRESOLV flag is an evolving interface and is subject 40N/A * to change without notice. 2N/A#
define IFF_VIRTUAL 0x2000000000ll /* Does not send or receive packets */ 151N/A/* flags that cannot be changed by userland on any interface */ 61N/A/* flags that cannot be changed by userland on an IPMP interface */ 16N/A/* flags that can never be set on an IPMP interface */ 2N/A * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1) 47N/A * input routines have queues of messages stored on ifqueue structures 2N/A * (defined above). Entries are added to and deleted from these structures 2N/A * by these macros, which should be called with ipl raised to splimp(). 2N/A * Packets destined for level-1 protocol input routines 160N/A * have a pointer to the receiving interface prepended to the data. 160N/A * IF_DEQUEUEIF extracts and returns this pointer when dequeuing the packet. 160N/A * IF_ADJ should be used otherwise to adjust for its presence. 99N/A * The ifaddr structure contains information about one address 99N/A * of an interface. They are maintained by the different address families, 61N/A * are allocated and attached when an address is set, and are linked 61N/A * together so all addresses for an interface can be located. 99N/A * For SIOCLIF*ND ioctls. 99N/A * The lnr_state_* fields use the ND_* neighbor reachability states. 99N/A * The 3 different fields are for use with SIOCLIFSETND to cover the cases 99N/A * A new entry is created 102N/A * The entry already exists and the link-layer address is the same 108N/A * The entry already exists and the link-layer address differs 61N/A * Use ND_UNCHANGED and ND_ISROUTER_UNCHANGED to not change any state. 99N/A /* padding because ia32 "long long"s are only 4-byte aligned. */ 99N/A * Neighbor reachability states 99N/A * Used with SIOCLIF*ND ioctls. 102N/A * lnr_flags value of lif_nd_req. 99N/A * Used with SIOCLIF*ND ioctls. 102N/A * the NDF_STATIC entry ensures that an NCE will not be deleted, and is 99N/A * used by non-ON applications like IPv6 test suites. 99N/A/* For SIOC[GS]LIFLNKINFO */ 109N/A#
endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */ 109N/A * Maximum lengths of interface name and IPMP group name; these are the same 109N/A * for historical reasons. Note that the actual maximum length of a name is 109N/A * one byte less than these constants since the kernel always sets the final 109N/A * byte of lifr_name and lifr_groupname to NUL. 99N/A * Interface request structure used for socket 99N/A * ioctl's. All interface ioctl's must have parameter 109N/A * definitions which begin with ifr_name. The 109N/A * remainder may be interface specific. 61N/A * Note: This data structure uses 64bit type uint64_t which is not 99N/A * a valid type for strict ANSI/ISO C compilation for ILP32. 99N/A * Applications with ioctls using this structure that insist on 99N/A * building with strict ANSI/ISO C (-Xc) will need to be LP64. 99N/A#
endif /* defined(_INT64_TYPE) */ 170N/A * Argument structure for SIOCT* address testing ioctls. 99N/A * Argument structure used by mrouted to get src-grp pkt counts using 99N/A/* Argument structure for SIOCGLIFDADSTATE ioctl */ 99N/A * OBSOLETE: Replaced by struct lifreq. Supported for compatibility. 99N/A * Interface request structure used for socket 99N/A * ioctl's. All interface ioctl's must have parameter 99N/A * definitions which begin with ifr_name. The 102N/A * remainder may be interface specific. int if_muxid[
2];
/* mux id's for arp and ip */ /* Struct for FDDI ioctl's */ /* Struct for FDDI stats */ /* Field for generic ioctl for fddi */ /* Used by SIOCGLIFNUM. Uses same flags as in struct lifconf */ * Structure used in SIOCGLIFCONF request. * Used to retrieve interface configuration * for machine (useful for programs which * must know all networks accessible) for a given address family. * Using AF_UNSPEC will retrieve all address families. int lifc_len;
/* size of associated buffer */ * Structure used in SIOCGLIFSRCOF to get the interface * configuration list for those interfaces that use an address * hosted on the interface (set in lifs_ifindex), as the source #
define LIFC_NOXMIT 0x01 /* Include IFF_NOXMIT interfaces */ /* be used to communicate outside the */ /* node (exclude interfaces which are */ /* IFF_NOXMIT, IFF_NOLOCAL, */ /* IFF_LOOPBACK, IFF_DEPRECATED, or */ /* not IFF_UP). Has priority over */ /* (must be issued from global zone) */ #
define LIFC_ENABLED 0x20 /* Include only IFF_UP interfaces */ * IPMP group information, for use with SIOCGLIFGROUPINFO. * OBSOLETE: Structure used in SIOCGIFCONF request. * Used to retrieve interface configuration * for machine (useful for programs which * must know all networks accessible). int ifc_len;
/* size of associated buffer */ /* generic interface information */ /* volatile statistics */ * Message format for use in obtaining information about interfaces * from the routing socket * Message format for use in obtaining information about interface addresses * from the routing socket #
endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */ * The if_nameindex structure holds the interface index value about * a single interface. An array of this structure is used to return * all interfaces and indexes. unsigned if_index;
/* positive interface index */ char *
if_name;
/* if name, e.g. "en0" */ /* Interface index identification API definitions */