home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.2 (Developer)
/
NS_dev_3.2.iso
/
NextDeveloper
/
Headers
/
bsd
/
net
/
etherdefs.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-19
|
2KB
|
80 lines
/*
* Mach Operating System
* Copyright (c) 1987 Carnegie-Mellon University
* All rights reserved. The CMU software License Agreement specifies
* the terms and conditions for use and redistribution.
*/
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* HISTORY
* 09-Apr-90 Bradley Taylor (btaylor) at NeXT, Inc.
* Created. Originally part of <netinet/if_ether.h>.
*/
#ifndef _ETHERDEFS_
#define _ETHERDEFS_
/*
* Ethernet address - 6 octets
*/
#define NUM_EN_ADDR_BYTES 6
struct ether_addr {
u_char ether_addr_octet[NUM_EN_ADDR_BYTES];
};
#define ea_byte ether_addr_octet
typedef struct ether_addr enet_addr_t;
/*
* Structure of a 10Mb/s Ethernet header.
*/
struct ether_header {
u_char ether_dhost[6];
u_char ether_shost[6];
u_short ether_type;
};
typedef struct ether_header ether_header_t;
#define IFTYPE_ETHERNET "10MB Ethernet"
#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
#define ETHERTYPE_IP 0x0800 /* IP protocol */
#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP (SUN_RPC) */
/*
* The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
* (type-ETHERTYPE_TRAIL)*512 bytes of data followed
* by an ETHER type (as given above) and then the (variable-length) header.
*/
#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
#define ETHERTYPE_NTRAILER 16
#define ETHERHDRSIZE 14
#define ETHERMTU 1500
#define ETHERMAXPACKET (ETHERHDRSIZE + ETHERMTU)
#define ETHERMINPACKET 64
#define ETHERCRC 4
#define ETHERMIN (ETHERMINPACKET-ETHERCRC-ETHERHDRSIZE)
/*
* Byte and bit in an enet_addr_t defining individual/group destination.
*/
#define EA_GROUP_BYTE 0
#define EA_GROUP_BIT 0x01
#endif /* _ETHERDEFS_ */