home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / bsd / net / etherdefs.h < prev    next >
C/C++ Source or Header  |  1992-07-29  |  2KB  |  64 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) 1982, 1986 Regents of the University of California.
  10.  * All rights reserved.
  11.  *
  12.  * Redistribution and use in source and binary forms are permitted
  13.  * provided that this notice is preserved and that due credit is given
  14.  * to the University of California at Berkeley. The name of the University
  15.  * may not be used to endorse or promote products derived from this
  16.  * software without specific prior written permission. This software
  17.  * is provided ``as is'' without express or implied warranty.
  18.  *
  19.  * HISTORY
  20.  * 09-Apr-90  Bradley Taylor (btaylor) at NeXT, Inc.
  21.  *    Created. Originally part of <netinet/if_ether.h>.
  22.  */
  23. #ifndef _ETHERDEFS_
  24. #define _ETHERDEFS_
  25.  
  26. /*
  27.  * Ethernet address - 6 octets
  28.  */
  29. struct ether_addr {
  30.     u_char    ether_addr_octet[6];
  31. };
  32.  
  33. /*
  34.  * Structure of a 10Mb/s Ethernet header.
  35.  */
  36. struct    ether_header {
  37.     u_char    ether_dhost[6];
  38.     u_char    ether_shost[6];
  39.     u_short    ether_type;
  40. };
  41.  
  42. #define IFTYPE_ETHERNET "10MB Ethernet"
  43.  
  44. #define    ETHERTYPE_PUP    0x0200        /* PUP protocol */
  45. #define    ETHERTYPE_IP    0x0800        /* IP protocol */
  46. #define ETHERTYPE_ARP    0x0806        /* Addr. resolution protocol */
  47. #define ETHERTYPE_REVARP 0x8035        /* Reverse ARP (SUN_RPC) */
  48.  
  49. /*
  50.  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
  51.  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
  52.  * by an ETHER type (as given above) and then the (variable-length) header.
  53.  */
  54. #define    ETHERTYPE_TRAIL        0x1000        /* Trailer packet */
  55. #define    ETHERTYPE_NTRAILER    16
  56.  
  57.  
  58. #define ETHERHDRSIZE    14
  59. #define    ETHERMTU    1500
  60.  
  61. #define    ETHERMIN    (60-ETHERHDRSIZE)
  62.  
  63. #endif /* _ETHERDEFS_ */
  64.