Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

IF_ETHER.H

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1982, 1986, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. All advertising materials mentioning features or use of this software
00014  *    must display the following acknowledgement:
00015  *      This product includes software developed by the University of
00016  *      California, Berkeley and its contributors.
00017  * 4. Neither the name of the University nor the names of its contributors
00018  *    may be used to endorse or promote products derived from this software
00019  *    without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00022  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00024  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00025  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00026  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00027  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00028  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00029  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00030  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  *      @(#)if_ether.h  8.3 (Berkeley) 5/2/95
00034  */
00035 
00036 #include <net/if_arp.h>
00037 
00038 /*
00039  * Ethernet address - 6 octets
00040  */
00041 struct ether_addr {
00042         u_char  ether_addr_octet[6];
00043 };
00044 
00045 /*
00046  * Structure of a 10Mb/s Ethernet header.
00047  */
00048 struct  ether_header {
00049         u_char  ether_dhost[6];
00050         u_char  ether_shost[6];
00051         u_short ether_type;
00052 };
00053 
00054 #define ETHERTYPE_PUP           0x0200  /* PUP protocol */
00055 #define ETHERTYPE_IP            0x0800  /* IP protocol */
00056 #define ETHERTYPE_ARP           0x0806  /* Addr. resolution protocol */
00057 #define ETHERTYPE_REVARP        0x8035  /* reverse Addr. resolution protocol */
00058 
00059 /*
00060  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
00061  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
00062  * by an ETHER type (as given above) and then the (variable-length) header.
00063  */
00064 #define ETHERTYPE_TRAIL         0x1000          /* Trailer packet */
00065 #define ETHERTYPE_NTRAILER      16
00066 
00067 #define ETHERMTU        1500
00068 #define ETHERMIN        (60-14)
00069 
00070 /*
00071  * Ethernet Address Resolution Protocol.
00072  *
00073  * See RFC 826 for protocol description.  Structure below is adapted
00074  * to resolving internet addresses.  Field names used correspond to 
00075  * RFC 826.
00076  */
00077 struct  ether_arp {
00078         struct  arphdr ea_hdr;  /* fixed-size header */
00079         u_char  arp_sha[6];     /* sender hardware address */
00080         u_char  arp_spa[4];     /* sender protocol address */
00081         u_char  arp_tha[6];     /* target hardware address */
00082         u_char  arp_tpa[4];     /* target protocol address */
00083 };
00084 #define arp_hrd ea_hdr.ar_hrd
00085 #define arp_pro ea_hdr.ar_pro
00086 #define arp_hln ea_hdr.ar_hln
00087 #define arp_pln ea_hdr.ar_pln
00088 #define arp_op  ea_hdr.ar_op

Generated on Sun May 14 14:51:20 2006 by  doxygen 1.4.2