From 6b1eee04527969f21ab65245b67cf9efa4b4aea8 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 15 Nov 2013 15:12:25 +0000 Subject: [ipv6] Separate the concepts of prefix and address creation Allow for IPv6 routing table entries to be created for an on-link prefix where a local address has not yet been assigned to the network device. Signed-off-by: Michael Brown --- src/include/ipxe/ipv6.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/ipv6.h b/src/include/ipxe/ipv6.h index 3cb878262..c4a9f15e3 100644 --- a/src/include/ipxe/ipv6.h +++ b/src/include/ipxe/ipv6.h @@ -160,16 +160,24 @@ struct ipv6_miniroute { /** Network device */ struct net_device *netdev; - /** IPv6 address */ + /** IPv6 address (or prefix if no address is defined) */ struct in6_addr address; /** Prefix length */ unsigned int prefix_len; /** IPv6 prefix mask (derived from prefix length) */ struct in6_addr prefix_mask; - /** Router address is present */ - int has_router; /** Router address */ struct in6_addr router; + /** Flags */ + unsigned int flags; +}; + +/** IPv6 address/routing table entry flags */ +enum ipv6_miniroute_flags { + /** Routing table entry address is valid */ + IPV6_HAS_ADDRESS = 0x0001, + /** Routing table entry router address is valid */ + IPV6_HAS_ROUTER = 0x0002, }; /** @@ -235,7 +243,9 @@ extern struct list_head ipv6_miniroutes; extern struct net_protocol ipv6_protocol __net_protocol; extern int ipv6_has_addr ( struct net_device *netdev, struct in6_addr *addr ); -extern int ipv6_slaac ( struct net_device *netdev, struct in6_addr *prefix, - unsigned int prefix_len, struct in6_addr *router ); +extern int ipv6_set_prefix ( struct net_device *netdev, struct in6_addr *prefix, + unsigned int prefix_len, struct in6_addr *router ); +extern int ipv6_set_address ( struct net_device *netdev, + struct in6_addr *address ); #endif /* _IPXE_IPV6_H */ -- cgit v1.2.3-55-g7522