First version
authorMichael Brown <mcb30@etherboot.org>
Tue, 18 Apr 2006 17:49:51 +0000 (17:49 +0000)
committerMichael Brown <mcb30@etherboot.org>
Tue, 18 Apr 2006 17:49:51 +0000 (17:49 +0000)
src/include/gpxe/llh.h [new file with mode: 0644]

diff --git a/src/include/gpxe/llh.h b/src/include/gpxe/llh.h
new file mode 100644 (file)
index 0000000..48c9c46
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _LLH_H
+#define _LLH_H
+
+/** @file
+ *
+ * Link-layer headers
+ *
+ * This file defines a media-independent link-layer header, used for
+ * communication between the network and link layers of the stack.
+ *
+ */
+
+#include <stdint.h>
+
+/** Maximum length of a link-layer address */
+#define MAX_LLH_ADDR_LEN 6
+
+/** Maximum length of a network-layer address */
+#define MAX_NET_ADDR_LEN 4
+
+/** A media-independent link-layer header
+ *
+ * This structure represents a generic link-layer header.  It never
+ * appears on the wire, but is used to communicate between different
+ * layers within the gPXE protocol stack.
+ */
+struct gpxehdr {
+       /** The network-layer protocol
+        *
+        * This is the network-layer protocol expressed as an
+        * ETH_P_XXX constant, in network-byte order.
+        */
+       uint16_t net_proto;
+       /** Broadcast flag
+        *
+        * Filled in only on outgoing packets.
+        */
+       int broadcast : 1;
+       /** Multicast flag
+        *
+        * Filled in only on outgoing packets.
+        */
+       int multicast : 1;
+       /** Network-layer address length 
+        *
+        * Filled in only on outgoing packets.
+        */
+       uint8_t net_addr_len;
+       /** Network-layer address
+        *
+        * Filled in only on outgoing packets.
+        */
+       uint8_t net_addr[MAX_NET_ADDR_LEN];
+} __attribute__ (( packed ));
+
+#endif /* _LLH_H */