home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcp30tkt.zip / PGMG1.ZIP / INCLUDE / NET / IF_ARP.H next >
Text File  |  1995-12-04  |  4KB  |  76 lines

  1. /********************************************************copyrite.xmc***/
  2. /*                                                                     */
  3. /*   Licensed Materials - Property of IBM                              */
  4. /*                                                                     */
  5. /*   This module is "Restricted Materials of IBM":                     */
  6. /*      Program Number:   5798RXW                                      */
  7. /*      Program Name:     IBM TCP/IP Version 1.2 for OS/2              */
  8. /*   (C) Copyright IBM Corporation. 1990, 1991.                        */
  9. /*                                                                     */
  10. /*   See IBM Copyright Instructions.                                   */
  11. /*                                                                     */
  12. /********************************************************copyrite.xmc***/
  13. #ifndef __IF_ARP_32H
  14. #define __IF_ARP_32H
  15.  
  16. /*
  17.  * Copyright (c) 1986 Regents of the University of California.
  18.  * All rights reserved.
  19.  *
  20.  * Redistribution and use in source and binary forms are permitted
  21.  * provided that this notice is preserved and that due credit is given
  22.  * to the University of California at Berkeley. The name of the University
  23.  * may not be used to endorse or promote products derived from this
  24.  * software without specific prior written permission. This software
  25.  * is provided ``as is'' without express or implied warranty.
  26.  *
  27.  *      @(#)if_arp.h    7.2 (Berkeley) 12/30/87
  28.  */
  29.  
  30. /*
  31.  * Address Resolution Protocol.
  32.  *
  33.  * See RFC 826 for protocol description.  ARP packets are variable
  34.  * in size; the arphdr structure defines the fixed-length portion.
  35.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  36.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  37.  * arp_tha and arp_tpa in that order, according to the lengths
  38.  * specified.  Field names used correspond to RFC 826.
  39.  */
  40. struct  arphdr {
  41.         u_short ar_hrd;         /* format of hardware address */
  42. #define ARPHRD_ETHER    1       /* ethernet hardware address */
  43. #define ARPHRD_802      6       /* 802 net hardware address */
  44.         u_short ar_pro;         /* format of protocol address */
  45.         u_char  ar_hln;         /* length of hardware address */
  46.         u_char  ar_pln;         /* length of protocol address */
  47.         u_short ar_op;          /* one of: */
  48. #define ARPOP_REQUEST   1       /* request to resolve address */
  49. #define ARPOP_REPLY     2       /* response to previous request */
  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. #endif /* __IF_ARP_32H */
  76.