root/include/linux/if_arp.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * INET         An implementation of the TCP/IP protocol suite for the LINUX
   3  *              operating system.  INET is implemented using the  BSD Socket
   4  *              interface as the means of communication with the user level.
   5  *
   6  *              Global definitions for the ARP (RFC 826) protocol.
   7  *
   8  * Version:     @(#)if_arp.h    1.0.1   04/16/93
   9  *
  10  * Authors:     Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
  11  *              Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
  12  *              Ross Biro, <bir7@leland.Stanford.Edu>
  13  *              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  14  *
  15  *              This program is free software; you can redistribute it and/or
  16  *              modify it under the terms of the GNU General Public License
  17  *              as published by the Free Software Foundation; either version
  18  *              2 of the License, or (at your option) any later version.
  19  */
  20 #ifndef _LINUX_IF_ARP_H
  21 #define _LINUX_IF_ARP_H
  22 
  23 /* ARP protocol HARDWARE identifiers. */
  24 #define ARPHRD_NETROM   0               /* from KA9Q: NET/ROM pseudo    */
  25 #define ARPHRD_ETHER    1               /* Ethernet 10Mbps              */
  26 #define ARPHRD_EETHER   2               /* Experimental Ethernet        */
  27 #define ARPHRD_AX25     3               /* AX.25 Level 2                */
  28 #define ARPHRD_PRONET   4               /* PROnet token ring            */
  29 #define ARPHRD_CHAOS    5               /* Chaosnet                     */
  30 #define ARPHRD_IEEE802  6               /* IEEE 802.2 Ethernet- huh?    */
  31 #define ARPHRD_ARCNET   7               /* ARCnet                       */
  32 #define ARPHRD_APPLETLK 8               /* APPLEtalk                    */
  33 
  34 /* ARP protocol opcodes. */
  35 #define ARPOP_REQUEST   1               /* ARP request                  */
  36 #define ARPOP_REPLY     2               /* ARP reply                    */
  37 #define ARPOP_RREQUEST  3               /* RARP request                 */
  38 #define ARPOP_RREPLY    4               /* RARP reply                   */
  39 
  40 
  41 /*
  42  * Address Resolution Protocol.
  43  *
  44  * See RFC 826 for protocol description.  ARP packets are variable
  45  * in size; the arphdr structure defines the fixed-length portion.
  46  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  47  * It is followed by the variable-sized fields ar_sha, arp_spa,
  48  * arp_tha and arp_tpa in that order, according to the lengths
  49  * specified.  Field names used correspond to RFC 826.
  50  */
  51 struct arphdr {
  52   unsigned short        ar_hrd;         /* format of hardware address   */
  53   unsigned short        ar_pro;         /* format of protocol address   */
  54   unsigned char         ar_hln;         /* length of hardware address   */
  55   unsigned char         ar_pln;         /* length of protocol address   */
  56   unsigned short        ar_op;          /* ARP opcode (command)         */
  57 
  58   /* The rest is variable in size, according to the sizes above. */
  59 #if 0
  60   unsigned char         ar_sha[];       /* sender hardware address      */
  61   unsigned char         ar_spa[];       /* sender protocol address      */
  62   unsigned char         ar_tha[];       /* target hardware address      */
  63   unsigned char         ar_tpa[];       /* target protocol address      */
  64 #endif  /* not actually included! */
  65 };
  66 
  67 
  68 /* ARP ioctl request. */
  69 struct arpreq {
  70   struct sockaddr       arp_pa;         /* protocol address             */
  71   struct sockaddr       arp_ha;         /* hardware address             */
  72   int                   arp_flags;      /* flags                        */
  73 };
  74 
  75 /* ARP Flag values. */
  76 #define ATF_INUSE       0x01            /* entry in use                 */
  77 #define ATF_COM         0x02            /* completed entry (ha valid)   */
  78 #define ATF_PERM        0x04            /* permanent entry              */
  79 #define ATF_PUBL        0x08            /* publish entry                */
  80 #define ATF_USETRAILERS 0x10            /* has requested trailers       */
  81 
  82 
  83 #endif  /* _LINUX_IF_ARP_H */

/* [previous][next][first][last][top][bottom][index][help] */