From: Marcel Holtmann Date: Mon, 21 Dec 2009 03:11:20 +0000 (-0800) Subject: Add IP configured method for fixed addresses X-Git-Tag: 2.0_alpha~2989 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c2364ac041ffb80d9bd0d8d298effa647119d6b;p=framework%2Fconnectivity%2Fconnman.git Add IP configured method for fixed addresses --- diff --git a/include/ipconfig.h b/include/ipconfig.h index 0e1a483..7aaa7c0 100644 --- a/include/ipconfig.h +++ b/include/ipconfig.h @@ -56,8 +56,9 @@ enum connman_ipconfig_type { enum connman_ipconfig_method { CONNMAN_IPCONFIG_METHOD_UNKNOWN = 0, CONNMAN_IPCONFIG_METHOD_OFF = 1, - CONNMAN_IPCONFIG_METHOD_MANUAL = 2, - CONNMAN_IPCONFIG_METHOD_DHCP = 3, + CONNMAN_IPCONFIG_METHOD_FIXED = 2, + CONNMAN_IPCONFIG_METHOD_MANUAL = 3, + CONNMAN_IPCONFIG_METHOD_DHCP = 4, }; struct connman_ipconfig; diff --git a/plugins/ofono.c b/plugins/ofono.c index 9aa71f0..162028b 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -1224,7 +1224,7 @@ static void update_settings(DBusMessageIter *array, if (g_strcmp0(method, "static") == 0) { parent->ipv4.method = - CONNMAN_IPCONFIG_METHOD_MANUAL; + CONNMAN_IPCONFIG_METHOD_FIXED; } else if (g_strcmp0(method, "dhcp") == 0) { parent->ipv4.method = @@ -1367,8 +1367,9 @@ static void pri_context_changed(DBusConnection *connection, switch (parent->ipv4.method) { case CONNMAN_IPCONFIG_METHOD_UNKNOWN: case CONNMAN_IPCONFIG_METHOD_OFF: - break; case CONNMAN_IPCONFIG_METHOD_MANUAL: + break; + case CONNMAN_IPCONFIG_METHOD_FIXED: if (static_network_set_connected( pending_network, parent, active) < 0) set_network_active(pending_network, FALSE); diff --git a/src/ipconfig.c b/src/ipconfig.c index df023c2..2fff6c7 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -288,6 +288,7 @@ static void __connman_ipconfig_lower_up(struct connman_ipdevice *ipdevice) switch (ipdevice->config->method) { case CONNMAN_IPCONFIG_METHOD_UNKNOWN: case CONNMAN_IPCONFIG_METHOD_OFF: + case CONNMAN_IPCONFIG_METHOD_FIXED: case CONNMAN_IPCONFIG_METHOD_MANUAL: return; case CONNMAN_IPCONFIG_METHOD_DHCP: @@ -929,6 +930,8 @@ const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method break; case CONNMAN_IPCONFIG_METHOD_OFF: return "off"; + case CONNMAN_IPCONFIG_METHOD_FIXED: + return "fixed"; case CONNMAN_IPCONFIG_METHOD_MANUAL: return "manual"; case CONNMAN_IPCONFIG_METHOD_DHCP: @@ -942,6 +945,8 @@ enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method { if (g_strcmp0(method, "off") == 0) return CONNMAN_IPCONFIG_METHOD_OFF; + else if (g_strcmp0(method, "fixed") == 0) + return CONNMAN_IPCONFIG_METHOD_FIXED; else if (g_strcmp0(method, "manual") == 0) return CONNMAN_IPCONFIG_METHOD_MANUAL; else if (g_strcmp0(method, "dhcp") == 0) @@ -994,6 +999,7 @@ void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig, switch (ipconfig->method) { case CONNMAN_IPCONFIG_METHOD_UNKNOWN: case CONNMAN_IPCONFIG_METHOD_OFF: + case CONNMAN_IPCONFIG_METHOD_FIXED: case CONNMAN_IPCONFIG_METHOD_DHCP: return; case CONNMAN_IPCONFIG_METHOD_MANUAL: @@ -1076,6 +1082,7 @@ int __connman_ipconfig_set_ipv4config(struct connman_ipconfig *ipconfig, switch (method) { case CONNMAN_IPCONFIG_METHOD_UNKNOWN: case CONNMAN_IPCONFIG_METHOD_OFF: + case CONNMAN_IPCONFIG_METHOD_FIXED: return -EINVAL; case CONNMAN_IPCONFIG_METHOD_MANUAL: