diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-07-21 14:54:11 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-07-28 13:48:29 +0100 |
commit | 2bcf13f13aff503c47041caaab7cb42bb7ed1484 (patch) | |
tree | 0df326f4fb82e26babc7ce5d55a2e8b84ac996e1 /src/include/ipxe/in.h | |
parent | 6efcabd4151538781053716bec1c7eccd759df26 (diff) | |
download | ipxe-2bcf13f13aff503c47041caaab7cb42bb7ed1484.tar.gz |
[ipv4] Allow IPv4 socket addresses to include a scope ID
Extend the IPv6 concept of "scope ID" (indicating the network device
index) to IPv4 socket addresses, so that IPv4 multicast transmissions
may specify the transmitting network device.
The scope ID is not (currently) exposed via the string representation
of the socket address, since IPv4 does not use the IPv6 concept of
link-local addresses (which could legitimately be specified in a URI).
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/in.h')
-rw-r--r-- | src/include/ipxe/in.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/ipxe/in.h b/src/include/ipxe/in.h index 2a49b00bb..0ebf441c2 100644 --- a/src/include/ipxe/in.h +++ b/src/include/ipxe/in.h @@ -85,6 +85,11 @@ struct sockaddr_in { uint16_t sin_flags; /** TCP/IP port (part of struct @c sockaddr_tcpip) */ uint16_t sin_port; + /** Scope ID (part of struct @c sockaddr_tcpip) + * + * For multicast addresses, this is the network device index. + */ + uint16_t sin_scope_id; /** IPv4 address */ struct in_addr sin_addr; /** Padding @@ -96,6 +101,7 @@ struct sockaddr_in { ( sizeof ( sa_family_t ) /* sin_family */ + sizeof ( uint16_t ) /* sin_flags */ + sizeof ( uint16_t ) /* sin_port */ + + sizeof ( uint16_t ) /* sin_scope_id */ + sizeof ( struct in_addr ) /* sin_addr */ ) ]; } __attribute__ (( packed, may_alias )); @@ -112,9 +118,10 @@ struct sockaddr_in6 { uint16_t sin6_flags; /** TCP/IP port (part of struct @c sockaddr_tcpip) */ uint16_t sin6_port; - /** Scope ID + /** Scope ID (part of struct @c sockaddr_tcpip) * - * For link-local addresses, this is the network device index. + * For link-local or multicast addresses, this is the network + * device index. */ uint16_t sin6_scope_id; /** IPv6 address */ |