home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / stack16 / netinet / if_ether.h next >
Text File  |  1999-05-11  |  4KB  |  114 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_ETHER_32H
  14. #define __IF_ETHER_32H
  15. /*
  16.  * Copyright (c) 1982, 1986 Regents of the University of California.
  17.  * All rights reserved.
  18.  *
  19.  * Redistribution and use in source and binary forms are permitted
  20.  * provided that this notice is preserved and that due credit is given
  21.  * to the University of California at Berkeley. The name of the University
  22.  * may not be used to endorse or promote products derived from this
  23.  * software without specific prior written permission. This software
  24.  * is provided ``as is'' without express or implied warranty.
  25.  *
  26.  *      @(#)ip.h        7.6.1.1 (Berkeley) 3/15/88
  27.  */
  28.  
  29. /*
  30.  * Structure of a 10Mb/s Ethernet header.
  31.  */
  32. struct  ether_header {
  33.         u_char  ether_dhost[6];
  34.         u_char  ether_shost[6];
  35.         u_short ether_type;
  36. };
  37.  
  38. #define ETHERTYPE_PUP   0x0200          /* PUP protocol */
  39. #define ETHERTYPE_IP    0x0800          /* IP protocol */
  40. #ifdef OS2
  41. #define ETHERTYPE_ARP   0x0608          /* Addr. resolution protocol */
  42. #else
  43. #define ETHERTYPE_ARP   0x0806          /* Addr. resolution protocol */
  44. #endif
  45. /*
  46.  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
  47.  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
  48.  * by an ETHER type (as given above) and then the (variable-length) header.
  49.  */
  50. #define ETHERTYPE_TRAIL         0x1000          /* Trailer packet */
  51. #define ETHERTYPE_NTRAILER      16
  52.  
  53. #define ETHERMTU        1500
  54. #define ETHERMIN        (60-14)
  55.  
  56. /*
  57.  * Ethernet Address Resolution Protocol.
  58.  *
  59.  * See RFC 826 for protocol description.  Structure below is adapted
  60.  * to resolving internet addresses.  Field names used correspond to
  61.  * RFC 826.
  62.  */
  63. struct  ether_arp {
  64.         struct  arphdr ea_hdr;  /* fixed-size header */
  65.         u_char  arp_sha[6];     /* sender hardware address */
  66.         u_char  arp_spa[4];     /* sender protocol address */
  67.         u_char  arp_tha[6];     /* target hardware address */
  68.         u_char  arp_tpa[4];     /* target protocol address */
  69. };
  70. #define arp_hrd ea_hdr.ar_hrd
  71. #define arp_pro ea_hdr.ar_pro
  72. #define arp_hln ea_hdr.ar_hln
  73. #define arp_pln ea_hdr.ar_pln
  74. #define arp_op  ea_hdr.ar_op
  75.  
  76.  
  77. /*
  78.  * Structure shared between the ethernet driver modules and
  79.  * the address resolution code.  For example, each ec_softc or il_softc
  80.  * begins with this structure.
  81.  */
  82. struct  arpcom {
  83.         struct  ifnet ac_if;            /* network-visible interface */
  84.         u_char  ac_enaddr[6];           /* ethernet hardware address */
  85.         struct in_addr ac_ipaddr;       /* copy of ip address- XXX */
  86. };
  87.  
  88. /*
  89.  * Internet to ethernet address resolution table.
  90.  */
  91. #pragma pack(1) /* force on doubleword boundary */
  92. struct  arptab {
  93.         struct  in_addr at_iaddr;       /* internet address */
  94.         u_char  at_enaddr[6];           /* ethernet address */
  95.         u_char  at_timer;               /* minutes since last reference */
  96.         u_char  at_flags;               /* flags */
  97.         struct  mbuf *at_hold;          /* last packet until resolved/timeout */
  98.         u_short at_rcf;                 /* token ring routing control field */
  99.         u_short at_rseg[8];             /* token ring routing segments */
  100. #ifdef OS2
  101.         u_long  at_millisec;            /* TOD milliseconds of last update */
  102.         short   at_interface;           /* interface index */
  103. #endif
  104. };
  105. #pragma pack()   /* reset to default packing */
  106.  
  107. #ifdef  KERNEL
  108. u_char etherbroadcastaddr[6];
  109. struct  arptab *arptnew();
  110. char *ether_sprintf();
  111. #endif
  112.  
  113. #endif /* __IF_ETHER_32H */
  114.