linux/proc/net/arp文件


/proc/net/arp
This  holds  an ASCII readable dump of the kernel ARP table used for address resolutions. 
It will show both dynamically  learned and preprogrammed ARP entries. 
The format is:
IP address     HW type   Flags     HW address          Mask   Device
192.168.0.50   0x1       0x2       00:50:BF:25:68:F3   *      eth0
192.168.0.250  0x1       0xc       00:00:00:00:00:00   *      eth0

Here "IP address" is the IPv4 address of the machine 
and the "HW type" is the hardware type of the  address  from  RFC 826.   
The flags are the internal 
flags of the ARP structure (as defined in /usr/include/linux/if_arp.h) and 
the "HW address"  is  the  data link layer mapping for that IP address if it is known.

/* ARP protocol HARDWARE identifiers. */
#define ARPHRD_NETROM   0               /* from KA9Q: NET/ROM pseudo    */
#define ARPHRD_ETHER    1               /* Ethernet 10Mbps              */
#define ARPHRD_EETHER   2               /* Experimental Ethernet        */
#define ARPHRD_AX25     3               /* AX.25 Level 2                */
#define ARPHRD_PRONET   4               /* PROnet token ring            */
#define ARPHRD_CHAOS    5               /* Chaosnet                     */
#define ARPHRD_IEEE802  6               /* IEEE 802.2 Ethernet/TR/TB    */
#define ARPHRD_ARCNET   7               /* ARCnet                       */
#define ARPHRD_APPLETLK 8               /* APPLEtalk                    */
#define ARPHRD_DLCI     15              /* Frame Relay DLCI             */
#define ARPHRD_ATM      19              /* ATM                          */
#define ARPHRD_METRICOM 23              /* Metricom STRIP (new IANA id) */
#define ARPHRD_IEEE1394 24              /* IEEE 1394 IPv4 - RFC 2734    */
#define ARPHRD_EUI64    27              /* EUI-64                       */
#define ARPHRD_INFINIBAND 32            /* InfiniBand                   */


/* ARP Flag values. */
#define ATF_COM         0x02            /* completed entry (ha valid)   */
#define ATF_PERM        0x04            /* permanent entry              */
#define ATF_PUBL        0x08            /* publish entry                */
#define ATF_USETRAILERS 0x10            /* has requested trailers       */
#define ATF_NETMASK     0x20            /* want to use a netmask (only
                                           for proxy entries) */
#define ATF_DONTPUB     0x40            /* don't answer this addresses  */

 

相关内容