diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-07-18 15:13:10 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-07-19 00:13:00 +0100 |
commit | 3b783d7fd2be053438c4fa968359f01b3c7ece8b (patch) | |
tree | d62167fcb7bce84020a41fbc3c40e5168e2dbb47 /src/net/ipv6.c | |
parent | ee54ab5be6c46adae18fc215b66d629796328b04 (diff) | |
download | ipxe-3b783d7fd2be053438c4fa968359f01b3c7ece8b.tar.gz |
[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 <hare@suse.de>
Originally-implemented-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/ipv6.c')
-rw-r--r-- | src/net/ipv6.c | 27 |
1 files changed, 27 insertions, 0 deletions
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 * |