[PATCH autoconf v3 02/12] ipconfig: Added auto method that is used for IPv6 auto configured addresses

Jukka Rissanen jukka.rissanen at nokia.com
Fri Jan 7 04:55:09 PST 2011


---
 include/ipconfig.h |    1 +
 plugins/ofono.c    |    1 +
 src/ipconfig.c     |    9 +++++++++
 src/network.c      |    5 +++++
 4 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/ipconfig.h b/include/ipconfig.h
index e8f6de1..9bc97d5 100644
--- a/include/ipconfig.h
+++ b/include/ipconfig.h
@@ -61,6 +61,7 @@ enum connman_ipconfig_method {
 	CONNMAN_IPCONFIG_METHOD_FIXED   = 2,
 	CONNMAN_IPCONFIG_METHOD_MANUAL  = 3,
 	CONNMAN_IPCONFIG_METHOD_DHCP    = 4,
+	CONNMAN_IPCONFIG_METHOD_AUTO    = 5,
 };
 
 struct connman_ipconfig;
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 0a13b7b..9385f39 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1511,6 +1511,7 @@ static void set_connected(struct connman_network *network,
 	case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		return;
 
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
diff --git a/src/ipconfig.c b/src/ipconfig.c
index b5dc98f..3610d46 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1119,6 +1119,7 @@ int __connman_ipconfig_set_address(struct connman_ipconfig *ipconfig)
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
 	case CONNMAN_IPCONFIG_METHOD_DHCP:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		break;
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
 		if (ipconfig->type == CONNMAN_IPCONFIG_TYPE_IPV4)
@@ -1146,6 +1147,7 @@ int __connman_ipconfig_clear_address(struct connman_ipconfig *ipconfig)
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
 	case CONNMAN_IPCONFIG_METHOD_DHCP:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		break;
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
 		if (ipconfig->type == CONNMAN_IPCONFIG_TYPE_IPV4)
@@ -1329,6 +1331,8 @@ const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method
 		return "manual";
 	case CONNMAN_IPCONFIG_METHOD_DHCP:
 		return "dhcp";
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
+		return "auto";
 	}
 
 	return NULL;
@@ -1344,6 +1348,8 @@ enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method
 		return CONNMAN_IPCONFIG_METHOD_MANUAL;
 	else if (g_strcmp0(method, "dhcp") == 0)
 		return CONNMAN_IPCONFIG_METHOD_DHCP;
+	else if (g_strcmp0(method, "auto") == 0)
+		return CONNMAN_IPCONFIG_METHOD_AUTO;
 	else
 		return CONNMAN_IPCONFIG_METHOD_UNKNOWN;
 }
@@ -1439,6 +1445,7 @@ void __connman_ipconfig_append_ipv6config(struct connman_ipconfig *ipconfig,
 		return;
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		break;
 	}
 
@@ -1476,6 +1483,7 @@ void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig,
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
 	case CONNMAN_IPCONFIG_METHOD_DHCP:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		return;
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
 		break;
@@ -1584,6 +1592,7 @@ int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
 	case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		return -EINVAL;
 
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
diff --git a/src/network.c b/src/network.c
index 18e3099..612e923 100644
--- a/src/network.c
+++ b/src/network.c
@@ -757,6 +757,7 @@ static gboolean set_connected(gpointer user_data)
 		switch (ipv6_method) {
 		case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 		case CONNMAN_IPCONFIG_METHOD_OFF:
+		case CONNMAN_IPCONFIG_METHOD_AUTO:
 			break;
 		case CONNMAN_IPCONFIG_METHOD_FIXED:
 		case CONNMAN_IPCONFIG_METHOD_MANUAL:
@@ -774,6 +775,7 @@ static gboolean set_connected(gpointer user_data)
 		switch (ipv4_method) {
 		case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 		case CONNMAN_IPCONFIG_METHOD_OFF:
+		case CONNMAN_IPCONFIG_METHOD_AUTO:
 			return FALSE;
 		case CONNMAN_IPCONFIG_METHOD_FIXED:
 			if (set_connected_fixed(network) < 0) {
@@ -1026,6 +1028,7 @@ int __connman_network_clear_ipconfig(struct connman_network *network,
 	case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 	case CONNMAN_IPCONFIG_METHOD_OFF:
 	case CONNMAN_IPCONFIG_METHOD_FIXED:
+	case CONNMAN_IPCONFIG_METHOD_AUTO:
 		return -EINVAL;
 	case CONNMAN_IPCONFIG_METHOD_MANUAL:
 		connman_element_unregister_children_type(&network->element,
@@ -1056,6 +1059,7 @@ int __connman_network_set_ipconfig(struct connman_network *network,
 		switch (method) {
 		case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 		case CONNMAN_IPCONFIG_METHOD_OFF:
+		case CONNMAN_IPCONFIG_METHOD_AUTO:
 			break;
 		case CONNMAN_IPCONFIG_METHOD_FIXED:
 		case CONNMAN_IPCONFIG_METHOD_MANUAL:
@@ -1078,6 +1082,7 @@ int __connman_network_set_ipconfig(struct connman_network *network,
 		case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
 		case CONNMAN_IPCONFIG_METHOD_OFF:
 		case CONNMAN_IPCONFIG_METHOD_FIXED:
+		case CONNMAN_IPCONFIG_METHOD_AUTO:
 			return -EINVAL;
 		case CONNMAN_IPCONFIG_METHOD_MANUAL:
 			return manual_ipv4_set(network, ipconfig_ipv4);
-- 
1.7.0.4




More information about the connman mailing list