From 3b783d7fd2be053438c4fa968359f01b3c7ece8b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 18 Jul 2016 15:13:10 +0100 Subject: [ipv6] Expose IPv6 settings acquired through NDP Expose the IPv6 address (or prefix) as ${ip6}, the prefix length as ${len6}, and the router address as ${gateway6}. Originally-implemented-by: Hannes Reinecke Originally-implemented-by: Marin Hannache Signed-off-by: Michael Brown --- src/net/ipv6.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/net/ipv6.c') diff --git a/src/net/ipv6.c b/src/net/ipv6.c index bbc00d33e..78d61369f 100644 --- a/src/net/ipv6.c +++ b/src/net/ipv6.c @@ -1061,6 +1061,33 @@ int format_ipv6_setting ( const struct setting_type *type __unused, return snprintf ( buf, len, "%s", inet6_ntoa ( ipv6 ) ); } +/** IPv6 settings scope */ +const struct settings_scope ipv6_scope; + +/** IPv6 address setting */ +const struct setting ip6_setting __setting ( SETTING_IP6, ip6 ) = { + .name = "ip6", + .description = "IPv6 address", + .type = &setting_type_ipv6, + .scope = &ipv6_scope, +}; + +/** IPv6 prefix length setting */ +const struct setting len6_setting __setting ( SETTING_IP6, len6 ) = { + .name = "len6", + .description = "IPv6 prefix length", + .type = &setting_type_int8, + .scope = &ipv6_scope, +}; + +/** Default gateway setting */ +const struct setting gateway6_setting __setting ( SETTING_IP6, gateway6 ) = { + .name = "gateway6", + .description = "IPv6 gateway", + .type = &setting_type_ipv6, + .scope = &ipv6_scope, +}; + /** * Create IPv6 network device * -- cgit v1.2.3-55-g7522