summaryrefslogtreecommitdiffstats
path: root/src/net/ipv6.c
diff options
context:
space:
mode:
authorMichael Brown2013-12-04 23:06:10 +0100
committerMichael Brown2013-12-05 01:41:49 +0100
commit17451b53e2fc696730586edb9d0a858bcc0b2ec8 (patch)
treee885da23313491fc49f6fcefaef6ac34107c146b /src/net/ipv6.c
parent[settings] Explicitly separate the concept of a completed fetched setting (diff)
downloadipxe-17451b53e2fc696730586edb9d0a858bcc0b2ec8.tar.gz
ipxe-17451b53e2fc696730586edb9d0a858bcc0b2ec8.tar.xz
ipxe-17451b53e2fc696730586edb9d0a858bcc0b2ec8.zip
[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>
Diffstat (limited to 'src/net/ipv6.c')
-rw-r--r--src/net/ipv6.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index 68a0c89b..621b4ff1 100644
--- a/src/net/ipv6.c
+++ b/src/net/ipv6.c
@@ -954,8 +954,8 @@ struct sockaddr_converter ipv6_sockaddr_converter __sockaddr_converter = {
* @v len Length of buffer
* @ret len Length of raw value, or negative error
*/
-static int parse_ipv6_setting ( const struct setting_type *type __unused,
- const char *value, void *buf, size_t len ) {
+int parse_ipv6_setting ( const struct setting_type *type __unused,
+ const char *value, void *buf, size_t len ) {
struct in6_addr ipv6;
int rc;
@@ -981,9 +981,9 @@ static int parse_ipv6_setting ( const struct setting_type *type __unused,
* @v len Length of buffer
* @ret len Length of formatted value, or negative error
*/
-static int format_ipv6_setting ( const struct setting_type *type __unused,
- const void *raw, size_t raw_len, char *buf,
- size_t len ) {
+int format_ipv6_setting ( const struct setting_type *type __unused,
+ const void *raw, size_t raw_len, char *buf,
+ size_t len ) {
const struct in6_addr *ipv6 = raw;
if ( raw_len < sizeof ( *ipv6 ) )
@@ -991,13 +991,6 @@ static int format_ipv6_setting ( const struct setting_type *type __unused,
return snprintf ( buf, len, "%s", inet6_ntoa ( ipv6 ) );
}
-/** An IPv6 address setting type */
-const struct setting_type setting_type_ipv6 __setting_type = {
- .name = "ipv6",
- .parse = parse_ipv6_setting,
- .format = format_ipv6_setting,
-};
-
/**
* Create IPv6 network device
*