home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / net / h / if_arp < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.9 KB  |  87 lines

  1. /*
  2.  * $Header: /ax/networking:include/net/if_arp.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/net/if_arp.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    if_arp.h,v $
  8.  * Revision 1.1  95/01/11  10:14:47  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:24:57  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)if_arp.h 1.2 87/06/16 3.2/4.3NFSSRC */
  16. /*
  17.  * Copyright (c) 1986 Regents of the University of California.
  18.  * All rights reserved.  The Berkeley software License Agreement
  19.  * specifies the terms and conditions for redistribution.
  20.  *
  21.  *      @(#)if_arp.h    7.1 (Berkeley) 6/4/86
  22.  */
  23.  
  24. #ifndef __if_arp_h
  25. #define __if_arp_h
  26.  
  27. #include "sys/socket.h"
  28.  
  29. /*
  30.  * Address Resolution Protocol.
  31.  *
  32.  * See RFC 826 for protocol description.  ARP packets are variable
  33.  * in size; the arphdr structure defines the fixed-length portion.
  34.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  35.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  36.  * arp_tha and arp_tpa in that order, according to the lengths
  37.  * specified.  Field names used correspond to RFC 826.
  38.  */
  39. struct  arphdr {
  40.         u_short ar_hrd;         /* format of hardware address */
  41. #define ARPHRD_ETHER    1       /* ethernet hardware address */
  42.         u_short ar_pro;         /* format of protocol address */
  43.         u_char  ar_hln;         /* length of hardware address */
  44.         u_char  ar_pln;         /* length of protocol address */
  45.         u_short ar_op;          /* one of: */
  46. #define ARPOP_REQUEST   1       /* request to resolve address */
  47. #define ARPOP_REPLY     2       /* response to previous request */
  48. #define REVARP_REQUEST  3       /* Reverse ARP request */
  49. #define REVARP_REPLY    4   /* Reverse ARP reply */
  50. /*
  51.  * The remaining fields are variable in size,
  52.  * according to the sizes above.
  53.  */
  54. /*      u_char  ar_sha[];       * sender hardware address */
  55. /*      u_char  ar_spa[];       * sender protocol address */
  56. /*      u_char  ar_tha[];       * target hardware address */
  57. /*      u_char  ar_tpa[];       * target protocol address */
  58. };
  59.  
  60. /*
  61.  * ARP ioctl request
  62.  */
  63. struct arpreq {
  64.         struct  sockaddr arp_pa;                /* protocol address */
  65.         struct  sockaddr arp_ha;                /* hardware address */
  66.         int     arp_flags;                      /* flags */
  67. };
  68. /*  arp_flags and at_flags field values */
  69. #define ATF_INUSE       0x01    /* entry in use */
  70. #define ATF_COM         0x02    /* completed entry (enaddr valid) */
  71. #define ATF_PERM        0x04    /* permanent entry */
  72. #define ATF_PUBL        0x08    /* publish entry (respond for other host) */
  73. #define ATF_USETRAILERS 0x10    /* has requested trailers */
  74.  
  75. #ifdef __riscos
  76.  
  77. struct arptinfo {
  78.         int    a_arptsize;      /* size of arp table */
  79.         char   *a_arptab;       /* pointer to arp table */
  80. };
  81.  
  82. #endif
  83.  
  84. #endif /* __if_arp_h */
  85.  
  86. /* EOF if_arp.h */
  87.