home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / net / if_arp.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  2KB  |  71 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7.  
  8. /*
  9.  * Copyright (c) 1986 Regents of the University of California.
  10.  * All rights reserved.  The Berkeley software License Agreement
  11.  * specifies the terms and conditions for redistribution.
  12.  *
  13.  *    @(#)if_arp.h    7.1 (Berkeley) 6/4/86
  14.  */
  15.  
  16. /*
  17.  * HISTORY
  18.  * 20-Oct-87  Peter King (king) at NeXT, Inc.
  19.  *    SUN_RPC:  Added Sun's RARP support.
  20.  */
  21.  
  22. /*    @(#)if_arp.h    2.1 88/05/18 4.0NFSSRC SMI;    from UCB 7.1 6/5/86    */
  23.  
  24. /*
  25.  * Address Resolution Protocol.
  26.  *
  27.  * See RFC 826 for protocol description.  ARP packets are variable
  28.  * in size; the arphdr structure defines the fixed-length portion.
  29.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  30.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  31.  * arp_tha and arp_tpa in that order, according to the lengths
  32.  * specified.  Field names used correspond to RFC 826.
  33.  */
  34. struct    arphdr {
  35.     u_short    ar_hrd;        /* format of hardware address */
  36. #define ARPHRD_ETHER     1    /* ethernet hardware address */
  37.     u_short    ar_pro;        /* format of protocol address */
  38.     u_char    ar_hln;        /* length of hardware address */
  39.     u_char    ar_pln;        /* length of protocol address */
  40.     u_short    ar_op;        /* one of: */
  41. #define    ARPOP_REQUEST    1    /* request to resolve address */
  42. #define    ARPOP_REPLY    2    /* response to previous request */
  43. #define REVARP_REQUEST  3    /* Reverse ARP request (SUN_RPC) */
  44. #define REVARP_REPLY    4     /* Reverse ARP reply (SUN_RPC) */
  45. /*
  46.  * The remaining fields are variable in size,
  47.  * according to the sizes above.
  48.  */
  49. #ifdef notdef
  50.     u_char    ar_sha[];    /* sender hardware address */
  51.     u_char    ar_spa[];    /* sender protocol address */
  52.     u_char    ar_tha[];    /* target hardware address */
  53.     u_char    ar_tpa[];    /* target protocol address */
  54. #endif
  55. };
  56.  
  57. /*
  58.  * ARP ioctl request
  59.  */
  60. struct arpreq {
  61.     struct    sockaddr arp_pa;        /* protocol address */
  62.     struct    sockaddr arp_ha;        /* hardware address */
  63.     int    arp_flags;            /* flags */
  64. };
  65. /*  arp_flags and at_flags field values */
  66. #define    ATF_INUSE    0x01    /* entry in use */
  67. #define ATF_COM        0x02    /* completed entry (enaddr valid) */
  68. #define    ATF_PERM    0x04    /* permanent entry */
  69. #define    ATF_PUBL    0x08    /* publish entry (respond for other host) */
  70. #define    ATF_USETRAILERS    0x10    /* has requested trailers */
  71.