Explorar el Código

Make flags more efficient.

Add 'raw' net_addr facility (needed for ARP).
tags/v0.9.3
Michael Brown hace 18 años
padre
commit
744b895077
Se han modificado 1 ficheros con 15 adiciones y 8 borrados
  1. 15
    8
      src/include/gpxe/llh.h

+ 15
- 8
src/include/gpxe/llh.h Ver fichero

18
 /** Maximum length of a network-layer address */
18
 /** Maximum length of a network-layer address */
19
 #define MAX_NET_ADDR_LEN 4
19
 #define MAX_NET_ADDR_LEN 4
20
 
20
 
21
+/* Network-layer address may be required to contain a raw link-layer address */
22
+#if MAX_NET_ADDR_LEN < MAX_LLH_ADDR_LEN
23
+#undef MAX_NET_ADDR_LEN
24
+#define MAX_NET_ADDR_LEN MAX_LLH_ADDR_LEN
25
+#endif
26
+
21
 /** A media-independent link-layer header
27
 /** A media-independent link-layer header
22
  *
28
  *
23
  * This structure represents a generic link-layer header.  It never
29
  * This structure represents a generic link-layer header.  It never
31
 	 * ETH_P_XXX constant, in network-byte order.
37
 	 * ETH_P_XXX constant, in network-byte order.
32
 	 */
38
 	 */
33
 	uint16_t net_proto;
39
 	uint16_t net_proto;
34
-	/** Broadcast flag
35
-	 *
36
-	 * Filled in only on outgoing packets.
37
-	 */
38
-	int broadcast : 1;
39
-	/** Multicast flag
40
+	/** Flags
40
 	 *
41
 	 *
41
-	 * Filled in only on outgoing packets.
42
+	 * Filled in only on outgoing packets.  Value is the
43
+	 * bitwise-OR of zero or more GPXE_FL_XXX constants.
42
 	 */
44
 	 */
43
-	int multicast : 1;
45
+	uint8_t flags;
44
 	/** Network-layer address length 
46
 	/** Network-layer address length 
45
 	 *
47
 	 *
46
 	 * Filled in only on outgoing packets.
48
 	 * Filled in only on outgoing packets.
53
 	uint8_t net_addr[MAX_NET_ADDR_LEN];
55
 	uint8_t net_addr[MAX_NET_ADDR_LEN];
54
 } __attribute__ (( packed ));
56
 } __attribute__ (( packed ));
55
 
57
 
58
+/* Media-independent link-layer header flags */
59
+#define GPXE_FL_BROADCAST	0x01
60
+#define GPXE_FL_MULTICAST	0x02
61
+#define GPXE_FL_RAW		0x04
62
+
56
 #endif /* _LLH_H */
63
 #endif /* _LLH_H */

Loading…
Cancelar
Guardar