|
|
1.1 root 1: /* if_ether.h 6.2 83/09/26 */
2:
3: /*
4: * Changes
5: * add return values of arpresolve()
6: */
7: /*
8: * Structure of a 10Mb/s Ethernet header.
9: */
10: struct ether_header {
11: u_char ether_dhost[6];
12: u_char ether_shost[6];
13: u_short ether_type;
14: };
15:
16: #define SIZEOF_ETHEADER 14 /* real sizeof(ether_header) */
17: #define ETHERPUP_PUPTYPE 0x0200 /* PUP protocol */
18: #define ETHERPUP_IPTYPE 0x0800 /* IP protocol */
19: #define ETHERPUP_ARPTYPE 0x0806 /* Addr. resolution protocol */
20:
21: /*
22: * The ETHERPUP_NTRAILER packet types starting at ETHERPUP_TRAIL have
23: * (type-ETHERPUP_TRAIL)*512 bytes of data followed
24: * by a PUP type (as given above) and then the (variable-length) header.
25: */
26: #define ETHERPUP_TRAIL 0x1000 /* Trailer PUP */
27: #define ETHERPUP_NTRAILER 16
28:
29: #define ETHERMTU 1500
30: #define ETHERMIN (60-14)
31:
32: /*
33: * Ethernet Address Resolution Protocol.
34: *
35: * See RFC 826 for protocol description. Structure below is adapted
36: * to resolving internet addresses. Field names used correspond to
37: * RFC 826.
38: */
39: struct ether_arp {
40: u_short arp_hrd; /* format of hardware address */
41: #define ARPHRD_ETHER 1 /* ethernet hardware address */
42: u_short arp_pro; /* format of proto. address (ETHERPUP_IPTYPE) */
43: u_char arp_hln; /* length of hardware address (6) */
44: u_char arp_pln; /* length of protocol address (4) */
45: u_short arp_op;
46: #define ARPOP_REQUEST 1 /* request to resolve address */
47: #define ARPOP_REPLY 2 /* response to previous request */
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:
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 arpcom *ac_ac; /* link to next ether driver */
63: };
64:
65: #ifdef KERNEL
66: u_char etherbroadcastaddr[6]; /* 6 bytes of 0xFF */
67: struct in_addr arpmyaddr();
68: struct arptab *arptnew();
69:
70: /* return value of arpresolve() */
71: #define ARPRESOLVE_WILLSEND 0
72: #define ARPRESOLVE_OK 1
73: #define ARPRESOLVE_BROADCAST 2
74: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.