summaryrefslogtreecommitdiffstats
path: root/src/net/ipv6.c
diff options
context:
space:
mode:
authorMichael Brown2016-07-18 16:13:10 +0200
committerMichael Brown2016-07-19 01:13:00 +0200
commit3b783d7fd2be053438c4fa968359f01b3c7ece8b (patch)
treed62167fcb7bce84020a41fbc3c40e5168e2dbb47 /src/net/ipv6.c
parent[ipv6] Allow settings to comprise arbitrary subsets of NDP options (diff)
downloadipxe-3b783d7fd2be053438c4fa968359f01b3c7ece8b.tar.gz
ipxe-3b783d7fd2be053438c4fa968359f01b3c7ece8b.tar.xz
ipxe-3b783d7fd2be053438c4fa968359f01b3c7ece8b.zip
[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.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index bbc00d33..78d61369 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
*