1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)if_ether.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: /*
10: * Structure of a 10Mb/s Ethernet header.
11: */
12: struct {
13: u_char ether_dhost[6];
14: u_char ether_shost[6];
15: u_short ether_type;
16: };
17:
18: #define ETHERTYPE_PUP 0x0200 /* PUP protocol */
19: #define ETHERTYPE_IP 0x0800 /* IP protocol */
20: #define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
21:
22: /*
23: * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
24: * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
25: * by an ETHER type (as given above) and then the (variable-length) header.
26: */
27: #define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
28: #define ETHERTYPE_NTRAILER 16
29:
30: #define ETHERMTU 1500
31: #define ETHERMIN (60-14)
32:
33: /*
34: * Ethernet Address Resolution Protocol.
35: *
36: * See RFC 826 for protocol description. Structure below is adapted
37: * to resolving internet addresses. Field names used correspond to
38: * RFC 826.
39: */
40: struct ether_arp {
41: struct arphdr ea_hdr; /* fixed-size header */
42: u_char arp_sha[6]; /* sender hardware address */
43: u_char arp_spa[4]; /* sender protocol address */
44: u_char arp_tha[6]; /* target hardware address */
45: u_char arp_tpa[4]; /* target protocol address */
46: };
47: #define arp_hrd ea_hdr.ar_hrd
48: #define arp_pro ea_hdr.ar_pro
49: #define arp_hln ea_hdr.ar_hln
50: #define arp_pln ea_hdr.ar_pln
51: #define arp_op ea_hdr.ar_op
52:
53:
54: /*
55: * Structure shared between the ethernet driver modules and
56: * the address resolution code. For example, each ec_softc or il_softc
57: * begins with this structure.
58: */
59: struct arpcom {
60: struct ifnet ac_if; /* network-visible interface */
61: u_char ac_enaddr[6]; /* ethernet hardware address */
62: struct in_addr ac_ipaddr; /* copy of ip address- XXX */
63: };
64:
65: /*
66: * Internet to ethernet address resolution table.
67: */
68: struct arptab {
69: struct in_addr at_iaddr; /* internet address */
70: u_char at_enaddr[6]; /* ethernet address */
71: u_char at_timer; /* minutes since last reference */
72: u_char at_flags; /* flags */
73: struct mbuf *at_hold; /* last packet until resolved/timeout */
74: };
75:
76: #ifdef KERNEL
77: u_char etherbroadcastaddr[6];
78: struct arptab *arptnew();
79: char *ether_sprintf();
80: #endif
Defined struct's
arpcom
defined in line
59; used 38 times
arptab
defined in line
68; used 20 times
defined in line
12; used 130 times
- in /usr/src/sys/netinet/if_ether.c line
91(2),
100(2),
265(2),
373(2)
- in /usr/src/sys/vaxif/if_de.c line
233(2),
413(2),
457(2),
493(2),
504(2),
590(2),
629(2),
659(2),
667-672(8)
- in /usr/src/sys/vaxif/if_ec.c line
433(2),
461-462(4),
554(2),
608(2),
638(2),
646-651(8),
700-701(4),
750(2),
761(2),
807(2)
- in /usr/src/sys/vaxif/if_ex.c line
263-264(4),
445-446(4),
554(2),
560(2),
567(2),
677(2),
716(2),
746(2),
754-759(8)
- in /usr/src/sys/vaxif/if_il.c line
327-328(4),
540(2),
579(2),
609(2),
617-622(8)
- in /usr/src/sys/vaxif/if_qe.c line
390(2),
665(2),
694(2),
735(2),
765(2),
773-778(8),
938(2),
949(2)
Defined macros
ETHERMTU
defined in line
30; used 17 times
- in /usr/src/sys/vaxif/if_de.c line
152,
233,
463,
510
- in /usr/src/sys/vaxif/if_ec.c line
208,
468
- in /usr/src/sys/vaxif/if_ex.c line
184,
579
- in /usr/src/sys/vaxif/if_il.c line
127,
214,
280,
368,
424,
443,
515
- in /usr/src/sys/vaxif/if_qe.c line
318,
955
Usage of this include