From c34d1518eb446d596087ed2b9dda33a513f7e980 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 19 Jul 2016 17:49:50 +0100 Subject: [ipv6] Create routing table based on IPv6 settings Use the IPv6 settings to construct the routing table, in a matter analogous to the construction of the IPv4 routing table. This allows for manual assignment of IPv6 addresses via e.g. set net0/ip6 2001:ba8:0:1d4::6950:5845 set net0/len6 64 set net0/gateway6 fe80::226:bff:fedd:d3c0 The prefix length ("len6") may be omitted, in which case a default prefix length of 64 will be assumed. Multiple IPv6 addresses may be assigned manually by implicitly creating child settings blocks. For example: set net0/ip6 2001:ba8:0:1d4::6950:5845 set net0.ula/ip6 fda4:2496:e992::6950:5845 Signed-off-by: Michael Brown --- src/include/ipxe/ipv6.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/ipv6.h b/src/include/ipxe/ipv6.h index 4dd03f058..0e5292fba 100644 --- a/src/include/ipxe/ipv6.h +++ b/src/include/ipxe/ipv6.h @@ -25,6 +25,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); /** IPv6 maximum hop limit */ #define IPV6_HOP_LIMIT 0xff +/** IPv6 default prefix length */ +#define IPV6_DEFAULT_PREFIX_LEN 64 + +/** IPv6 maximum prefix length */ +#define IPV6_MAX_PREFIX_LEN 128 + /** IPv6 header */ struct ipv6_header { /** Version (4 bits), Traffic class (8 bits), Flow label (20 bits) */ @@ -258,10 +264,6 @@ 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_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 ); extern int parse_ipv6_setting ( const struct setting_type *type, const char *value, void *buf, size_t len ); extern int format_ipv6_setting ( const struct setting_type *type, -- cgit v1.2.3-55-g7522