summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2006-04-18 19:49:51 +0200
committerMichael Brown2006-04-18 19:49:51 +0200
commit42b659f92677fc2bb1068709c1a16cec16391442 (patch)
treeb28b86fd064dc4dc36af0e748ee00edd8deb1872 /src/include
parentFirst version, based on the concepts in linux/skbuff.h (diff)
downloadipxe-42b659f92677fc2bb1068709c1a16cec16391442.tar.gz
ipxe-42b659f92677fc2bb1068709c1a16cec16391442.tar.xz
ipxe-42b659f92677fc2bb1068709c1a16cec16391442.zip
First version
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/llh.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/include/gpxe/llh.h b/src/include/gpxe/llh.h
new file mode 100644
index 00000000..48c9c461
--- /dev/null
+++ b/src/include/gpxe/llh.h
@@ -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 */