|
@@ -651,21 +651,37 @@ int fetch_string_setting_copy ( struct settings *settings,
|
651
|
651
|
*
|
652
|
652
|
* @v settings Settings block, or NULL to search all blocks
|
653
|
653
|
* @v setting Setting to fetch
|
654
|
|
- * @v inp IPv4 address to fill in
|
|
654
|
+ * @v inp IPv4 addresses to fill in
|
|
655
|
+ * @v count Maximum number of IPv4 addresses
|
655
|
656
|
* @ret len Length of setting, or negative error
|
656
|
657
|
*/
|
657
|
|
-int fetch_ipv4_setting ( struct settings *settings, struct setting *setting,
|
658
|
|
- struct in_addr *inp ) {
|
|
658
|
+int fetch_ipv4_array_setting ( struct settings *settings,
|
|
659
|
+ struct setting *setting,
|
|
660
|
+ struct in_addr *inp, unsigned int count ) {
|
659
|
661
|
int len;
|
660
|
662
|
|
661
|
|
- len = fetch_setting ( settings, setting, inp, sizeof ( *inp ) );
|
|
663
|
+ len = fetch_setting ( settings, setting, inp,
|
|
664
|
+ ( sizeof ( *inp ) * count ) );
|
662
|
665
|
if ( len < 0 )
|
663
|
666
|
return len;
|
664
|
|
- if ( len < ( int ) sizeof ( *inp ) )
|
|
667
|
+ if ( ( len % sizeof ( *inp ) ) != 0 )
|
665
|
668
|
return -ERANGE;
|
666
|
669
|
return len;
|
667
|
670
|
}
|
668
|
671
|
|
|
672
|
+/**
|
|
673
|
+ * Fetch value of IPv4 address setting
|
|
674
|
+ *
|
|
675
|
+ * @v settings Settings block, or NULL to search all blocks
|
|
676
|
+ * @v setting Setting to fetch
|
|
677
|
+ * @v inp IPv4 address to fill in
|
|
678
|
+ * @ret len Length of setting, or negative error
|
|
679
|
+ */
|
|
680
|
+int fetch_ipv4_setting ( struct settings *settings, struct setting *setting,
|
|
681
|
+ struct in_addr *inp ) {
|
|
682
|
+ return fetch_ipv4_array_setting ( settings, setting, inp, 1 );
|
|
683
|
+}
|
|
684
|
+
|
669
|
685
|
/**
|
670
|
686
|
* Fetch value of signed integer setting
|
671
|
687
|
*
|