diff options
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/in.h | 2 | ||||
-rw-r--r-- | src/include/ipxe/ip.h | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/include/ipxe/in.h b/src/include/ipxe/in.h index 3044d6316..05a8122ef 100644 --- a/src/include/ipxe/in.h +++ b/src/include/ipxe/in.h @@ -33,6 +33,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define IN_IS_MULTICAST( addr ) \ ( ( (addr) & htonl ( 0xf0000000 ) ) == htonl ( 0xe0000000 ) ) +#define IN_IS_SMALL( mask ) ( (mask) & htonl ( 0x00000003 ) ) + /** * IP address structure */ diff --git a/src/include/ipxe/ip.h b/src/include/ipxe/ip.h index 285be6dcd..b1b5cb2e7 100644 --- a/src/include/ipxe/ip.h +++ b/src/include/ipxe/ip.h @@ -64,9 +64,27 @@ struct ipv4_miniroute { /** IPv4 address */ struct in_addr address; - /** Subnet mask */ + /** Subnet mask + * + * An address with all of these bits in common with our IPv4 + * address is in the local subnet. + */ struct in_addr netmask; - /** Gateway address */ + /** Host mask + * + * An address in the local subnet with all of these bits set + * to zero represents the network address, and an address in + * the local subnet with all of these bits set to one + * represents the directed broadcast address. All other + * addresses in the local subnet are valid host addresses. + * + * For most subnets, this is the inverse of the subnet mask. + * In a small subnet (/31 or /32) there is no network address + * or directed broadcast address, and all addresses in the + * subnet are valid host addresses. + */ + struct in_addr hostmask; + /** Gateway address, or zero for no gateway */ struct in_addr gateway; }; |