1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that this notice is preserved and that due credit is given
7: * to the University of California at Berkeley. The name of the University
8: * may not be used to endorse or promote products derived from this
9: * software without specific prior written permission. This software
10: * is provided ``as is'' without express or implied warranty.
11: *
12: * @(#)if_ether.h 7.2 (Berkeley) 12/7/87
13: */
14:
15: /*
16: * Structure of a 10Mb/s Ethernet header.
17: */
18: struct {
19: u_char ether_dhost[6];
20: u_char ether_shost[6];
21: u_short ether_type;
22: };
23:
24: #define ETHERTYPE_PUP 0x0200 /* PUP protocol */
25: #define ETHERTYPE_IP 0x0800 /* IP protocol */
26: #define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
27:
28: /*
29: * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
30: * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
31: * by an ETHER type (as given above) and then the (variable-length) header.
32: */
33: #define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
34: #define ETHERTYPE_NTRAILER 16
35:
36: #define ETHERMTU 1500
37: #define ETHERMIN (60-14)
38:
39: /*
40: * Ethernet Address Resolution Protocol.
41: *
42: * See RFC 826 for protocol description. Structure below is adapted
43: * to resolving internet addresses. Field names used correspond to
44: * RFC 826.
45: */
46: struct ether_arp {
47: struct arphdr ea_hdr; /* fixed-size header */
48: u_char arp_sha[6]; /* sender hardware address */
49: u_char arp_spa[4]; /* sender protocol address */
50: u_char arp_tha[6]; /* target hardware address */
51: u_char arp_tpa[4]; /* target protocol address */
52: };
53: #define arp_hrd ea_hdr.ar_hrd
54: #define arp_pro ea_hdr.ar_pro
55: #define arp_hln ea_hdr.ar_hln
56: #define arp_pln ea_hdr.ar_pln
57: #define arp_op ea_hdr.ar_op
58:
59:
60: /*
61: * Structure shared between the ethernet driver modules and
62: * the address resolution code. For example, each ec_softc or il_softc
63: * begins with this structure.
64: */
65: struct arpcom {
66: struct ifnet ac_if; /* network-visible interface */
67: u_char ac_enaddr[6]; /* ethernet hardware address */
68: struct in_addr ac_ipaddr; /* copy of ip address- XXX */
69: };
70:
71: /*
72: * Internet to ethernet address resolution table.
73: */
74: struct arptab {
75: struct in_addr at_iaddr; /* internet address */
76: u_char at_enaddr[6]; /* ethernet address */
77: u_char at_timer; /* minutes since last reference */
78: u_char at_flags; /* flags */
79: struct mbuf *at_hold; /* last packet until resolved/timeout */
80: };
81:
82: #ifdef SUPERVISOR
83: u_char etherbroadcastaddr[6];
84: struct arptab *arptnew();
85: char *ether_sprintf();
86: #endif
Defined struct's
arpcom
defined in line
65; used 36 times
arptab
defined in line
74; used 26 times
defined in line
18; used 128 times
- in /usr/src/sys/netinet/if_ether.c line
107(2),
116(2),
296(2),
412(2)
- in /usr/src/sys/pdpif/if_de.c line
283(2),
528(2),
566-571(4),
594(2),
623(2),
638(2),
762(2),
805(2),
857(2),
865-870(8)
- in /usr/src/sys/pdpif/if_ec.c line
336(2),
374-375(4),
480(2),
533(2),
559(2),
569-576(8),
625-626(4),
657(2),
666(2),
702(2)
- in /usr/src/sys/pdpif/if_il.c line
364-365(4),
573(2),
602(2),
620(2),
628-633(8)
- in /usr/src/sys/pdpif/if_qe.c line
554(2),
582(2),
615(2),
633(2),
641-646(8),
809(2),
823(2),
945(2)
- in /usr/src/sys/pdpif/if_qt.c line
562(2),
610(2),
642(2),
656(2),
668-675(8),
786(2),
794(2),
882(2)
Defined macros
ETHERMTU
defined in line
36; used 17 times
- in /usr/src/sys/pdpif/if_de.c line
71,
204,
284,
578,
646
- in /usr/src/sys/pdpif/if_ec.c line
127,
383
- in /usr/src/sys/pdpif/if_il.c line
145,
224,
305,
410,
469,
480,
542
- in /usr/src/sys/pdpif/if_qe.c line
233
- in /usr/src/sys/pdpif/if_qt.c line
145,
184
Usage of this include