ether.h revision 127668
11556Srgrimes/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.8 2002/12/11 07:13:51 guy Exp $ (LBL) */
21556Srgrimes/*
31556Srgrimes * Copyright (c) 1982, 1986, 1993
41556Srgrimes *	The Regents of the University of California.  All rights reserved.
51556Srgrimes *
61556Srgrimes * Redistribution and use in source and binary forms, with or without
71556Srgrimes * modification, are permitted provided that the following conditions
81556Srgrimes * are met:
91556Srgrimes * 1. Redistributions of source code must retain the above copyright
101556Srgrimes *    notice, this list of conditions and the following disclaimer.
111556Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
121556Srgrimes *    notice, this list of conditions and the following disclaimer in the
131556Srgrimes *    documentation and/or other materials provided with the distribution.
141556Srgrimes * 3. All advertising materials mentioning features or use of this software
151556Srgrimes *    must display the following acknowledgement:
161556Srgrimes *	This product includes software developed by the University of
171556Srgrimes *	California, Berkeley and its contributors.
181556Srgrimes * 4. Neither the name of the University nor the names of its contributors
191556Srgrimes *    may be used to endorse or promote products derived from this software
201556Srgrimes *    without specific prior written permission.
211556Srgrimes *
221556Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
231556Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
241556Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
251556Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
261556Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
271556Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
281556Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
291556Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
301556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
311556Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
321556Srgrimes * SUCH DAMAGE.
331556Srgrimes *
341556Srgrimes *	@(#)if_ether.h	8.3 (Berkeley) 5/2/95
351556Srgrimes */
361556Srgrimes
371556Srgrimes#define	ETHERMTU	1500
381556Srgrimes
391556Srgrimes/*
401556Srgrimes * The number of bytes in an ethernet (MAC) address.
411556Srgrimes */
421556Srgrimes#define	ETHER_ADDR_LEN		6
431556Srgrimes
441556Srgrimes/*
451556Srgrimes * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
461556Srgrimes */
471556Srgrimesstruct	ether_header {
481556Srgrimes	u_int8_t	ether_dhost[ETHER_ADDR_LEN];
491556Srgrimes	u_int8_t	ether_shost[ETHER_ADDR_LEN];
501556Srgrimes	u_int16_t	ether_type;
511556Srgrimes};
521556Srgrimes
531556Srgrimes/*
541556Srgrimes * Length of a DEC/Intel/Xerox or 802.3 Ethernet header; note that some
551556Srgrimes * compilers may pad "struct ether_header" to a multiple of 4 bytes,
561556Srgrimes * for example, so "sizeof (struct ether_header)" may not give the right
571556Srgrimes * answer.
581556Srgrimes */
591556Srgrimes#define ETHER_HDRLEN		14
601556Srgrimes