|
@@ -877,6 +877,44 @@ int fetch_ipv4_setting ( struct settings *settings,
|
877
|
877
|
return fetch_ipv4_array_setting ( settings, setting, inp, 1 );
|
878
|
878
|
}
|
879
|
879
|
|
|
880
|
+/**
|
|
881
|
+ * Fetch value of IPv6 address setting
|
|
882
|
+ *
|
|
883
|
+ * @v settings Settings block, or NULL to search all blocks
|
|
884
|
+ * @v setting Setting to fetch
|
|
885
|
+ * @v inp IPv6 addresses to fill in
|
|
886
|
+ * @v count Maximum number of IPv6 addresses
|
|
887
|
+ * @ret len Length of setting, or negative error
|
|
888
|
+ */
|
|
889
|
+int fetch_ipv6_array_setting ( struct settings *settings,
|
|
890
|
+ const struct setting *setting,
|
|
891
|
+ struct in6_addr *inp, unsigned int count ) {
|
|
892
|
+ int len;
|
|
893
|
+
|
|
894
|
+ len = fetch_raw_setting ( settings, setting, inp,
|
|
895
|
+ ( sizeof ( *inp ) * count ) );
|
|
896
|
+ if ( len < 0 )
|
|
897
|
+ return len;
|
|
898
|
+ if ( ( len % sizeof ( *inp ) ) != 0 )
|
|
899
|
+ return -ERANGE;
|
|
900
|
+ return len;
|
|
901
|
+}
|
|
902
|
+
|
|
903
|
+/**
|
|
904
|
+ * Fetch value of IPv6 address setting
|
|
905
|
+ *
|
|
906
|
+ * @v settings Settings block, or NULL to search all blocks
|
|
907
|
+ * @v setting Setting to fetch
|
|
908
|
+ * @v inp IPv6 address to fill in
|
|
909
|
+ * @ret len Length of setting, or negative error
|
|
910
|
+ */
|
|
911
|
+int fetch_ipv6_setting ( struct settings *settings,
|
|
912
|
+ const struct setting *setting,
|
|
913
|
+ struct in6_addr *inp ) {
|
|
914
|
+
|
|
915
|
+ return fetch_ipv6_array_setting ( settings, setting, inp, 1 );
|
|
916
|
+}
|
|
917
|
+
|
880
|
918
|
/**
|
881
|
919
|
* Extract numeric value of setting
|
882
|
920
|
*
|