|
@@ -0,0 +1,56 @@
|
|
1
|
+#ifndef _LLH_H
|
|
2
|
+#define _LLH_H
|
|
3
|
+
|
|
4
|
+/** @file
|
|
5
|
+ *
|
|
6
|
+ * Link-layer headers
|
|
7
|
+ *
|
|
8
|
+ * This file defines a media-independent link-layer header, used for
|
|
9
|
+ * communication between the network and link layers of the stack.
|
|
10
|
+ *
|
|
11
|
+ */
|
|
12
|
+
|
|
13
|
+#include <stdint.h>
|
|
14
|
+
|
|
15
|
+/** Maximum length of a link-layer address */
|
|
16
|
+#define MAX_LLH_ADDR_LEN 6
|
|
17
|
+
|
|
18
|
+/** Maximum length of a network-layer address */
|
|
19
|
+#define MAX_NET_ADDR_LEN 4
|
|
20
|
+
|
|
21
|
+/** A media-independent link-layer header
|
|
22
|
+ *
|
|
23
|
+ * This structure represents a generic link-layer header. It never
|
|
24
|
+ * appears on the wire, but is used to communicate between different
|
|
25
|
+ * layers within the gPXE protocol stack.
|
|
26
|
+ */
|
|
27
|
+struct gpxehdr {
|
|
28
|
+ /** The network-layer protocol
|
|
29
|
+ *
|
|
30
|
+ * This is the network-layer protocol expressed as an
|
|
31
|
+ * ETH_P_XXX constant, in network-byte order.
|
|
32
|
+ */
|
|
33
|
+ uint16_t net_proto;
|
|
34
|
+ /** Broadcast flag
|
|
35
|
+ *
|
|
36
|
+ * Filled in only on outgoing packets.
|
|
37
|
+ */
|
|
38
|
+ int broadcast : 1;
|
|
39
|
+ /** Multicast flag
|
|
40
|
+ *
|
|
41
|
+ * Filled in only on outgoing packets.
|
|
42
|
+ */
|
|
43
|
+ int multicast : 1;
|
|
44
|
+ /** Network-layer address length
|
|
45
|
+ *
|
|
46
|
+ * Filled in only on outgoing packets.
|
|
47
|
+ */
|
|
48
|
+ uint8_t net_addr_len;
|
|
49
|
+ /** Network-layer address
|
|
50
|
+ *
|
|
51
|
+ * Filled in only on outgoing packets.
|
|
52
|
+ */
|
|
53
|
+ uint8_t net_addr[MAX_NET_ADDR_LEN];
|
|
54
|
+} __attribute__ (( packed ));
|
|
55
|
+
|
|
56
|
+#endif /* _LLH_H */
|