SUMMARY: Interface Flags Numeric codes

From: Nevin <nevin.smgr_at_gmail.com>
Date: Sat Aug 14 2010 - 02:53:51 EDT
Thanks to all who responded. Special thanks to Michael Maciolek and Donald H
Locker.

Straight answer is : these codes are defined in /usr/include/net/if.h

~~~~~~~~~~~~~~~~
from Michael Maciolek <sunman@noop.org>
toNevin <nevin.smgr@gmail.com>

dateFri, Aug 13, 2010 at 10:35 PM
subjectRe: Interface Flags Numeric codes
mailed-bynoop.org

10:35 PM (13 hours ago)


The codes are listed and (briefly) explained in /usr/include/net/if.h
starting around line 100.  Excerpt:

 #define IFF_UP          0x0000000001    /* interface is up */
 #define IFF_BROADCAST   0x0000000002    /* broadcast address valid */
 #define IFF_DEBUG       0x0000000004    /* turn on debugging */
 #define IFF_LOOPBACK    0x0000000008    /* is a loopback net */
The codes are listed and (briefly) explained in /usr/include/net/if.h
starting around line 100.  Excerpt:

 #define IFF_UP          0x0000000001    /* interface is up */
 #define IFF_BROADCAST   0x0000000002    /* broadcast address valid */
 #define IFF_DEBUG       0x0000000004    /* turn on debugging */
 #define IFF_LOOPBACK    0x0000000008    /* is a loopback net */


~~~~~~~~~~~~~~~
fromDonald H Locker <dhlocker@comcast.net>
toNevin <nevin.smgr@gmail.com>

dateSat, Aug 14, 2010 at 7:14 AM
subjectRe: Interface Flags Numeric codes
mailed-bycomcast.nefromDonald H Locker <dhlocker@comcast.net>
toNevin <nevin.smgr@gmail.com>

dateSat, Aug 14, 2010 at 7:14 AM
subjectRe: Interface Flags Numeric codes
mailed-bycomcast.ne


I like puzzles.  In all, there are seven unique bits set here:
(bitwise OR of all network codes = 0x300084B  = 0000 0011 0000 0000 0000
1000 0100 1011)

Everyone has MULTICAST and everyone is RUNNING, and everyone have the
0x0000840 bits so each one of these bits must represent one of those states;
no way to know from this evidence (and I'm not about to look at the
documentation "We don't need no steenkin' documentation!")

Of the remaining five bits,
* 2000849 and 2000841 have IPV6 and high order 2 in common that no one else
have; leading 2 is IPV6 (0x02000000 = IPV6)
* first four listings are UP and lsNybble is odd (leading 2 and the 840
don't count anymore) so least significant 1 is UP (0x00000001 = UP)
* 2000849 and 1000849 have least significant 8 and LOOPBACK in common that
no one else has; least significant 8 is LOOPBACK (0x00000008)
* 1000843 and 1000842 have least significant 2 and BROADCAST in common that
no one else has; least significant 2 is BROADCAST (0x00000002)
* 1000843, 1000849, 1000842 have IPV1 and high order 1 in common that no one
else have; leading 1 is IPV4 (0x01000000)

To verify, I searched for the definition of BROADCAST in my filesystem

~ $ (cd /; for m in `find . -fstype ufs -name '*.h' -print 2>/dev/null`; do
grep BROADCAST $m /dev/null; done)
turned up a bunch of #define ... IFF_BROADCAST, so I looked for a #define
IFF_BROADCAST, then dug up /usr/include/net/if.h

/*
 * NOTE : These flags are not directly used within IP.
 * ip_if.h has definitions derived from this which is used within IP.
 * If you define a flag here, you need to define one in ip_if.h before
 * using the new flag in IP. Don't use these flags directly in IP.
 */
#define IFF_UP          0x0000000001    /* interface is up */
#define IFF_BROADCAST   0x0000000002    /* broadcast address valid */
#define IFF_DEBUG       0x0000000004    /* turn on debugging */
#define IFF_LOOPBACK    0x0000000008    /* is a loopback net */

#define IFF_POINTOPOINT 0x0000000010    /* interface is point-to-point link
*/
#define IFF_NOTRAILERS  0x0000000020    /* avoid use of trailers */
#define IFF_RUNNING     0x0000000040    /* resources allocated */
#define IFF_NOARP       0x0000000080    /* no address resolution protocol */

#define IFF_PROMISC     0x0000000100    /* receive all packets */
#define IFF_ALLMULTI    0x0000000200    /* receive all multicast packets */
#define IFF_INTELLIGENT 0x0000000400    /* protocol code on board */
#define IFF_MULTICAST   0x0000000800    /* supports multicast */

#define IFF_MULTI_BCAST 0x0000001000    /* multicast using broadcast address
*/
#define IFF_UNNUMBERED  0x0000002000    /* non-unique address */
#define IFF_DHCPRUNNING 0x0000004000    /* DHCP controls this interface */
#define IFF_PRIVATE     0x0000008000    /* do not advertise */

/*
 * The following flags can't be grabbed or altered by SIOC[GS]IFFLAGS.
 * Should use SIOC[GS]LIFFLAGS which has a larger flags field.
 */
#define IFF_NOXMIT      0x0000010000    /* Do not transmit packets */
#define IFF_NOLOCAL     0x0000020000    /* No address - just on-link subnet
*/
#define IFF_DEPRECATED  0x0000040000    /* interface address deprecated */
#define IFF_ADDRCONF    0x0000080000    /* address from stateless addrconf
*/

#define IFF_ROUTER      0x0000100000    /* router on this interface */
#define IFF_NONUD       0x0000200000    /* No NUD on this interface */
#define IFF_ANYCAST     0x0000400000    /* Anycast address */
#define IFF_NORTEXCH    0x0000800000    /* Do not exchange routing info */

#define IFF_IPV4        0x0001000000    /* IPv4 interface */
#define IFF_IPV6        0x0002000000    /* IPv6 interface */
#define IFF_MIPRUNNING  0x0004000000    /* Mobile IP controls this interface
*/
#define IFF_NOFAILOVER  0x0008000000    /* Don't failover on NIC failure */

#define IFF_FAILED      0x0010000000    /* NIC has failed */
#define IFF_STANDBY     0x0020000000    /* Standby NIC to be used on
failures */
#define IFF_INACTIVE    0x0040000000    /* NIC active or not ? */
                                       /* Used for Standby NIC or */
                                       /* when FAILBACK is disabled by user
*/
#define IFF_OFFLINE     0x0080000000    /* NIC has been offlined */

/*
 * The IFF_XRESOLV flag is an evolving interface and is subject
 * to change without notice.
 */
#define IFF_XRESOLV     0x0100000000    /* IPv6 external resolver */
#define IFF_COS_ENABLED 0x0200000000    /* If interface supports CoS marking
*/
#define IFF_PREFERRED   0x0400000000    /* Prefer as source address */
#define IFF_TEMPORARY   0x0800000000    /* RFC3041 */

#define IFF_FIXEDMTU    0x1000000000    /* MTU manually set with SIOCSLIFMTU
*/

#define IFF_VIRTUAL     0x2000000000    /* Does not send or receive packets
*/
#define IFF_DUPLICATE   0x4000000000    /* Local address already in use */
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Sat Aug 14 02:55:01 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:17 EST