diff options
| author | Michael Brown | 2006-04-19 03:53:49 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-04-19 03:53:49 +0200 |
| commit | 744b8950770884447e09a444d38492da7f72fa1e (patch) | |
| tree | c8ddc130f71e7936353dcc65125b326bb4e95de4 | |
| parent | Moved if_ether.h and if_arp.h to include/gpxe, for consistency with Linux (diff) | |
| download | ipxe-744b8950770884447e09a444d38492da7f72fa1e.tar.gz ipxe-744b8950770884447e09a444d38492da7f72fa1e.tar.xz ipxe-744b8950770884447e09a444d38492da7f72fa1e.zip | |
Make flags more efficient.
Add 'raw' net_addr facility (needed for ARP).
| -rw-r--r-- | src/include/gpxe/llh.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/include/gpxe/llh.h b/src/include/gpxe/llh.h index 48c9c4616..f60078149 100644 --- a/src/include/gpxe/llh.h +++ b/src/include/gpxe/llh.h @@ -18,6 +18,12 @@ /** Maximum length of a network-layer address */ #define MAX_NET_ADDR_LEN 4 +/* Network-layer address may be required to contain a raw link-layer address */ +#if MAX_NET_ADDR_LEN < MAX_LLH_ADDR_LEN +#undef MAX_NET_ADDR_LEN +#define MAX_NET_ADDR_LEN MAX_LLH_ADDR_LEN +#endif + /** A media-independent link-layer header * * This structure represents a generic link-layer header. It never @@ -31,16 +37,12 @@ struct gpxehdr { * 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 + /** Flags * - * Filled in only on outgoing packets. + * Filled in only on outgoing packets. Value is the + * bitwise-OR of zero or more GPXE_FL_XXX constants. */ - int multicast : 1; + uint8_t flags; /** Network-layer address length * * Filled in only on outgoing packets. @@ -53,4 +55,9 @@ struct gpxehdr { uint8_t net_addr[MAX_NET_ADDR_LEN]; } __attribute__ (( packed )); +/* Media-independent link-layer header flags */ +#define GPXE_FL_BROADCAST 0x01 +#define GPXE_FL_MULTICAST 0x02 +#define GPXE_FL_RAW 0x04 + #endif /* _LLH_H */ |
