[settings] Allow for IPv6 setting types in non-IPv6 builds

Allow for the existence of references to IPv6 setting types without
dragging in the whole IPv6 stack, by placing the definition of
setting_type_ipv6 in core/settings.c and providing weak stub methods
for parse_ipv6_setting() and format_ipv6_setting().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-12-04 22:06:10 +00:00
parent 22001cb206
commit 17451b53e2
7 changed files with 132 additions and 51 deletions

View File

@@ -75,5 +75,10 @@ extern struct list_head ipv4_miniroutes;
extern struct net_protocol ipv4_protocol __net_protocol;
extern int ipv4_has_any_addr ( struct net_device *netdev );
extern int parse_ipv4_setting ( const struct setting_type *type,
const char *value, void *buf, size_t len );
extern int format_ipv4_setting ( const struct setting_type *type,
const void *raw, size_t raw_len, char *buf,
size_t len );
#endif /* _IPXE_IP_H */

View File

@@ -247,5 +247,10 @@ extern int ipv6_set_prefix ( struct net_device *netdev, struct in6_addr *prefix,
unsigned int prefix_len, struct in6_addr *router );
extern int ipv6_set_address ( struct net_device *netdev,
struct in6_addr *address );
extern int parse_ipv6_setting ( const struct setting_type *type,
const char *value, void *buf, size_t len );
extern int format_ipv6_setting ( const struct setting_type *type,
const void *raw, size_t raw_len, char *buf,
size_t len );
#endif /* _IPXE_IPV6_H */

View File

@@ -62,16 +62,18 @@ struct setting {
#define SETTING_NETDEV_EXTRA 02 /**< Network device additional settings */
#define SETTING_IPv4 03 /**< IPv4 settings */
#define SETTING_IPv4_EXTRA 04 /**< IPv4 additional settings */
#define SETTING_BOOT 05 /**< Generic boot settings */
#define SETTING_BOOT_EXTRA 06 /**< Generic boot additional settings */
#define SETTING_SANBOOT 07 /**< SAN boot settings */
#define SETTING_SANBOOT_EXTRA 08 /**< SAN boot additional settings */
#define SETTING_HOST 09 /**< Host identity settings */
#define SETTING_HOST_EXTRA 10 /**< Host identity additional settings */
#define SETTING_AUTH 11 /**< Authentication settings */
#define SETTING_AUTH_EXTRA 12 /**< Authentication additional settings */
#define SETTING_CRYPTO 13 /**< Cryptography settings */
#define SETTING_MISC 14 /**< Miscellaneous settings */
#define SETTING_IPv6 05 /**< IPv6 settings */
#define SETTING_IPv6_EXTRA 06 /**< IPv6 additional settings */
#define SETTING_BOOT 07 /**< Generic boot settings */
#define SETTING_BOOT_EXTRA 08 /**< Generic boot additional settings */
#define SETTING_SANBOOT 09 /**< SAN boot settings */
#define SETTING_SANBOOT_EXTRA 10 /**< SAN boot additional settings */
#define SETTING_HOST 11 /**< Host identity settings */
#define SETTING_HOST_EXTRA 12 /**< Host identity additional settings */
#define SETTING_AUTH 13 /**< Authentication settings */
#define SETTING_AUTH_EXTRA 14 /**< Authentication additional settings */
#define SETTING_CRYPTO 15 /**< Cryptography settings */
#define SETTING_MISC 16 /**< Miscellaneous settings */
/** @} */
@@ -277,6 +279,9 @@ struct builtin_setting {
/** Built-in setting scope */
extern const struct settings_scope builtin_scope;
/** IPv6 setting scope */
extern const struct settings_scope ipv6_scope;
/**
* A generic settings block
*