| 1 | /* Modified for emx by hv 1994,1996
|
|---|
| 2 | *
|
|---|
| 3 | * Copyright (c) 1982, 1986 Regents of the University of California.
|
|---|
| 4 | * All rights reserved.
|
|---|
| 5 | *
|
|---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | * modification, are permitted provided that the following conditions
|
|---|
| 8 | * are met:
|
|---|
| 9 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 11 | * 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 13 | * documentation and/or other materials provided with the distribution.
|
|---|
| 14 | * 3. All advertising materials mentioning features or use of this software
|
|---|
| 15 | * must display the following acknowledgement:
|
|---|
| 16 | * This product includes software developed by the University of
|
|---|
| 17 | * California, Berkeley and its contributors.
|
|---|
| 18 | * 4. Neither the name of the University nor the names of its contributors
|
|---|
| 19 | * may be used to endorse or promote products derived from this software
|
|---|
| 20 | * without specific prior written permission.
|
|---|
| 21 | *
|
|---|
| 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|---|
| 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|---|
| 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|---|
| 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|---|
| 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|---|
| 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|---|
| 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|---|
| 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|---|
| 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|---|
| 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|---|
| 32 | * SUCH DAMAGE.
|
|---|
| 33 | *
|
|---|
| 34 | * from: @(#)if_ether.h 7.5 (Berkeley) 6/28/90
|
|---|
| 35 | * $Id: if_ether.h,v 1.8 1994/02/02 05:58:54 hpeyerl Exp $
|
|---|
| 36 | */
|
|---|
| 37 |
|
|---|
| 38 | #ifndef _NETINET_IF_ETHER_H_
|
|---|
| 39 | #define _NETINET_IF_ETHER_H_
|
|---|
| 40 |
|
|---|
| 41 | /*
|
|---|
| 42 | * Ethernet address - 6 octets
|
|---|
| 43 | * this is only used by the ethers(3) functions.
|
|---|
| 44 | */
|
|---|
| 45 | struct ether_addr {
|
|---|
| 46 | u_char ether_addr_octet[6];
|
|---|
| 47 | };
|
|---|
| 48 |
|
|---|
| 49 | /*
|
|---|
| 50 | * Structure of a 10Mb/s Ethernet header.
|
|---|
| 51 | */
|
|---|
| 52 | struct ether_header {
|
|---|
| 53 | u_char ether_dhost[6];
|
|---|
| 54 | u_char ether_shost[6];
|
|---|
| 55 | u_short ether_type;
|
|---|
| 56 | };
|
|---|
| 57 |
|
|---|
| 58 | #define ETHERTYPE_PUP 0x0200 /* PUP protocol */
|
|---|
| 59 | /* the IBM header corrects the following to 0x608 for OS/2 but I believe
|
|---|
| 60 | * this is just a dirty hack
|
|---|
| 61 | */
|
|---|
| 62 | #define ETHERTYPE_ARP 0x0806 /* address resolution protocol */
|
|---|
| 63 | #define ETHERTYPE_IP 0x0800 /* IP protocol */
|
|---|
| 64 | #define ETHERTYPE_REVARP 0x8035 /* reverse addr resolution protocol */
|
|---|
| 65 |
|
|---|
| 66 | /*
|
|---|
| 67 | * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
|
|---|
| 68 | * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
|
|---|
| 69 | * by an ETHER type (as given above) and then the (variable-length) header.
|
|---|
| 70 | */
|
|---|
| 71 | #define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
|
|---|
| 72 | #define ETHERTYPE_NTRAILER 16
|
|---|
| 73 |
|
|---|
| 74 | #define ETHERMTU 1500
|
|---|
| 75 | #define ETHERMIN (60-14)
|
|---|
| 76 |
|
|---|
| 77 | /*
|
|---|
| 78 | * Ethernet Address Resolution Protocol.
|
|---|
| 79 | *
|
|---|
| 80 | * See RFC 826 for protocol description. Structure below is adapted
|
|---|
| 81 | * to resolving internet addresses. Field names used correspond to
|
|---|
| 82 | * RFC 826.
|
|---|
| 83 | */
|
|---|
| 84 | struct ether_arp {
|
|---|
| 85 | struct arphdr ea_hdr; /* fixed-size header */
|
|---|
| 86 | u_char arp_sha[6]; /* sender hardware address */
|
|---|
| 87 | u_char arp_spa[4]; /* sender protocol address */
|
|---|
| 88 | u_char arp_tha[6]; /* target hardware address */
|
|---|
| 89 | u_char arp_tpa[4]; /* target protocol address */
|
|---|
| 90 | };
|
|---|
| 91 | #define arp_hrd ea_hdr.ar_hrd
|
|---|
| 92 | #define arp_pro ea_hdr.ar_pro
|
|---|
| 93 | #define arp_hln ea_hdr.ar_hln
|
|---|
| 94 | #define arp_pln ea_hdr.ar_pln
|
|---|
| 95 | #define arp_op ea_hdr.ar_op
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | /*
|
|---|
| 99 | * Structure shared between the ethernet driver modules and
|
|---|
| 100 | * the address resolution code. For example, each ec_softc or il_softc
|
|---|
| 101 | * begins with this structure.
|
|---|
| 102 | */
|
|---|
| 103 | struct arpcom {
|
|---|
| 104 | struct ifnet ac_if; /* network-visible interface */
|
|---|
| 105 | u_char ac_enaddr[6]; /* ethernet hardware address */
|
|---|
| 106 | struct in_addr ac_ipaddr; /* copy of ip address- XXX */
|
|---|
| 107 | /* not os2 */
|
|---|
| 108 | /* struct ether_multi *ac_multiaddrs;*/ /* list of ether multicast addrs */
|
|---|
| 109 | /* int ac_multicnt;*/ /* length of ac_multiaddrs list */
|
|---|
| 110 | };
|
|---|
| 111 |
|
|---|
| 112 | /*
|
|---|
| 113 | * Internet to ethernet address resolution table.
|
|---|
| 114 | */
|
|---|
| 115 | #ifdef TCPIPV4
|
|---|
| 116 | #pragma pack(1)
|
|---|
| 117 | #else
|
|---|
| 118 | #pragma pack(4)
|
|---|
| 119 | #endif
|
|---|
| 120 | struct arptab {
|
|---|
| 121 | struct in_addr at_iaddr; /* internet address */
|
|---|
| 122 | u_char at_enaddr[6]; /* ethernet address */
|
|---|
| 123 | u_char at_timer; /* minutes since last reference */
|
|---|
| 124 | u_char at_flags; /* flags */
|
|---|
| 125 | struct mbuf *at_hold; /* last packet until resolved/timeout */
|
|---|
| 126 | /* only os2 */
|
|---|
| 127 | u_short at_rcf; /* token ring routing control field */
|
|---|
| 128 | u_short at_rseg[8]; /* token ring routing segments */
|
|---|
| 129 | u_long at_millisec; /* TOD millsecons of last update */
|
|---|
| 130 | #ifdef TCPIPV4
|
|---|
| 131 | short at_interface; /* interface index */
|
|---|
| 132 | #else
|
|---|
| 133 | int at_interface; /* interface index */
|
|---|
| 134 | #endif
|
|---|
| 135 | };
|
|---|
| 136 | #pragma pack()
|
|---|
| 137 |
|
|---|
| 138 | #endif /* !_NETINET_IF_ETHER_H_ */
|
|---|