char *passphrase;
char *eap;
char *identity;
+ char *anonymous_identity;
char *agent_identity;
char *ca_cert_path;
+ char *subject_match;
+ char *altsubject_match;
+ char *domain_suffix_match;
+ char *domain_match;
char *client_cert_path;
char *private_key_path;
char *private_key_passphrase;
char encryption_mode[WIFI_ENCYPTION_MODE_LEN_MAX];
unsigned char bssid[WIFI_BSSID_LEN_MAX];
unsigned int maxrate;
+ int maxspeed;
bool isHS20AP;
unsigned int keymgmt;
char *keymgmt_type;
bool rsn_mode;
int disconnect_reason;
int assoc_status_code;
- void *wifi_vsie;
- unsigned int wifi_vsie_len;
+ GSList *vsie_list;
+ /*
+ * Only for EAP-FAST
+ */
+ char *phase1;
+ unsigned char country_code[WIFI_COUNTRY_CODE_LEN];
+ GSList *bssid_list;
+ ieee80211_modes_e phy_mode;
+ connection_mode_e connection_mode;
#endif
} wifi;
__connman_device_set_network(network->device, network);
- connman_device_set_disconnected(network->device, false);
-
service = connman_service_lookup_from_network(network);
__connman_service_ipconfig_indicate_state(service,
CONNMAN_SERVICE_STATE_CONFIGURATION,
if (err < 0)
goto err;
+ __connman_service_save(service);
+
return;
err:
network->connecting = false;
service = connman_service_lookup_from_network(network);
-
ipconfig = __connman_service_get_ip4config(service);
+ __connman_ipconfig_enable(ipconfig);
if (!__connman_ipconfig_get_local(ipconfig))
__connman_service_read_ip4config(service);
service = connman_service_lookup_from_network(network);
ipconfig_ipv4 = __connman_service_get_ip4config(service);
+ __connman_ipconfig_enable(ipconfig_ipv4);
err = __connman_dhcp_start(ipconfig_ipv4, network,
dhcp_callback, NULL);
if (err < 0)
return err;
- __connman_connection_gateway_activate(service,
- CONNMAN_IPCONFIG_TYPE_IPV6);
-
__connman_device_set_network(network->device, network);
- connman_device_set_disconnected(network->device, false);
-
connman_network_set_associating(network, false);
network->connecting = false;
__connman_device_set_network(network->device, network);
- connman_device_set_disconnected(network->device, false);
-
#if defined TIZEN_EXT
if(network->type == CONNMAN_NETWORK_TYPE_CELLULAR)
return;
if (!ipconfig)
return;
+ __connman_ipconfig_enable(ipconfig);
+
__connman_ipconfig_enable_ipv6(ipconfig);
__connman_ipconfig_address_remove(ipconfig);
switch (ipv4_method) {
case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
case CONNMAN_IPCONFIG_METHOD_OFF:
- case CONNMAN_IPCONFIG_METHOD_AUTO:
case CONNMAN_IPCONFIG_METHOD_FIXED:
case CONNMAN_IPCONFIG_METHOD_MANUAL:
break;
+ case CONNMAN_IPCONFIG_METHOD_AUTO:
+ /*
+ * If the current method is AUTO then next time we
+ * try first DHCP. DHCP also needs to be stopped
+ * in this case because if we fell in AUTO means
+ * that DHCP was launched for IPv4 but it failed.
+ */
+ __connman_ipconfig_set_method(ipconfig_ipv4,
+ CONNMAN_IPCONFIG_METHOD_DHCP);
+ __connman_service_notify_ipv4_configuration(service);
+ /* fall through */
case CONNMAN_IPCONFIG_METHOD_DHCP:
__connman_dhcp_stop(ipconfig_ipv4);
break;
}
}
-static void remove_driver(struct connman_network_driver *driver)
-{
- GSList *list;
-
- DBG("driver %p name %s", driver, driver->name);
-
- for (list = network_list; list; list = list->next) {
- struct connman_network *network = list->data;
-
- if (network->driver == driver)
- network_remove(network);
- }
-}
-
static gint compare_priority(gconstpointer a, gconstpointer b)
{
const struct connman_network_driver *driver1 = a;
*/
void connman_network_driver_unregister(struct connman_network_driver *driver)
{
+ GSList *list;
+
DBG("driver %p name %s", driver, driver->name);
driver_list = g_slist_remove(driver_list, driver);
- remove_driver(driver);
+ for (list = network_list; list; list = list->next) {
+ struct connman_network *network = list->data;
+
+ if (network->driver == driver)
+ network_remove(network);
+ }
}
static void network_destruct(struct connman_network *network)
g_free(network->wifi.passphrase);
g_free(network->wifi.eap);
g_free(network->wifi.identity);
+ g_free(network->wifi.anonymous_identity);
g_free(network->wifi.agent_identity);
g_free(network->wifi.ca_cert_path);
+ g_free(network->wifi.subject_match);
+ g_free(network->wifi.altsubject_match);
+ g_free(network->wifi.domain_suffix_match);
+ g_free(network->wifi.domain_match);
g_free(network->wifi.client_cert_path);
g_free(network->wifi.private_key_path);
g_free(network->wifi.private_key_passphrase);
g_free(network->wifi.phase2_auth);
g_free(network->wifi.pin_wps);
#if defined TIZEN_EXT
- g_free(network->wifi.wifi_vsie);
+ g_slist_free_full(network->wifi.vsie_list, g_free);
+ g_slist_free_full(network->wifi.bssid_list, g_free);
#endif
g_free(network->path);
g_free(network->group);
struct connman_network *network;
char *ident;
- DBG("identifier %s type %d", identifier, type);
-
network = g_try_new0(struct connman_network, 1);
if (!network)
return NULL;
- DBG("network %p", network);
-
network->refcount = 1;
ident = g_strdup(identifier);
network_list = g_slist_prepend(network_list, network);
+ DBG("network %p identifier %s type %s", network, identifier,
+ type2string(type));
return network;
}
return (unsigned char *)network->wifi.bssid;
}
+int connman_network_set_maxspeed(struct connman_network *network,
+ int maxspeed)
+{
+ network->wifi.maxspeed = maxspeed;
+ return 0;
+}
+
+int connman_network_get_maxspeed(struct connman_network *network)
+{
+ if (!network->driver)
+ return 0;
+
+ if (network->connected)
+ return network->wifi.maxspeed;
+
+ return 0;
+}
+
int connman_network_set_maxrate(struct connman_network *network,
unsigned int maxrate)
{
return network->wifi.disconnect_reason;
}
-
-int connman_network_set_assoc_status_code(struct connman_network *network,
- int assoc_status_code)
+int connman_network_get_assoc_status_code(struct connman_network *network)
{
-
if (network == NULL)
return 0;
- network->wifi.assoc_status_code = assoc_status_code;
+ return network->wifi.assoc_status_code;
+}
+
+int connman_network_set_countrycode(struct connman_network *network,
+ const unsigned char *country_code)
+{
+ int i = 0;
+
+ if (country_code == NULL)
+ return -EINVAL;
+
+ DBG("network %p Country Code %02x:%02x",network,
+ country_code[0],country_code[1]);
+
+ for (; i < WIFI_COUNTRY_CODE_LEN; i++)
+ network->wifi.country_code[i] = country_code[i];
+
return 0;
}
-int connman_network_get_assoc_status_code(struct connman_network *network)
+unsigned char *connman_network_get_countrycode(struct connman_network *network)
{
- if (network == NULL)
- return 0;
+ return (unsigned char *)network->wifi.country_code;
+}
- return network->wifi.assoc_status_code;
+int connman_network_set_bssid_list(struct connman_network *network,
+ GSList *bssids)
+{
+ g_slist_free_full(network->wifi.bssid_list, g_free);
+ network->wifi.bssid_list = bssids;
+
+ return 0;
}
+int connman_network_set_phy_mode(struct connman_network *network,
+ ieee80211_modes_e mode)
+{
+ DBG("network %p phy mode %d", network, mode);
+ network->wifi.phy_mode = mode;
+
+ return 0;
+}
+
+ieee80211_modes_e connman_network_get_phy_mode(struct connman_network *network)
+{
+ return network->wifi.phy_mode;
+}
+
+int connman_network_set_connection_mode(struct connman_network *network,
+ connection_mode_e mode)
+{
+ DBG("network %p connection mode %d", network, mode);
+ network->wifi.connection_mode = mode;
+
+ return 0;
+}
+
+connection_mode_e connman_network_get_connection_mode(struct connman_network *network)
+{
+ return network->wifi.connection_mode;
+}
+
+void *connman_network_get_bssid_list(struct connman_network *network)
+{
+ return network->wifi.bssid_list;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,
int connman_network_set_strength(struct connman_network *network,
uint8_t strength)
{
-#if !defined TIZEN_EXT
- DBG("network %p strengh %d", network, strength);
-#endif
-
network->strength = strength;
return 0;
int connman_network_set_frequency(struct connman_network *network,
uint16_t frequency)
{
-#if !defined TIZEN_EXT
- DBG("network %p frequency %d", network, frequency);
-#endif
-
network->frequency = frequency;
return 0;
int connman_network_set_wifi_channel(struct connman_network *network,
uint16_t channel)
{
- DBG("network %p wifi channel %d", network, channel);
-
network->wifi.channel = channel;
return 0;
int connman_network_set_string(struct connman_network *network,
const char *key, const char *value)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s value %s", network, key, value);
-#endif
-
if (g_strcmp0(key, "Name") == 0)
return connman_network_set_name(network, value);
} else if (g_str_equal(key, "WiFi.Identity")) {
g_free(network->wifi.identity);
network->wifi.identity = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.AnonymousIdentity")) {
+ g_free(network->wifi.anonymous_identity);
+ network->wifi.anonymous_identity = g_strdup(value);
} else if (g_str_equal(key, "WiFi.AgentIdentity")) {
g_free(network->wifi.agent_identity);
network->wifi.agent_identity = g_strdup(value);
} else if (g_str_equal(key, "WiFi.CACertFile")) {
g_free(network->wifi.ca_cert_path);
network->wifi.ca_cert_path = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.SubjectMatch")) {
+ g_free(network->wifi.subject_match);
+ network->wifi.subject_match = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.AltSubjectMatch")) {
+ g_free(network->wifi.altsubject_match);
+ network->wifi.altsubject_match = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.DomainSuffixMatch")) {
+ g_free(network->wifi.domain_suffix_match);
+ network->wifi.domain_suffix_match = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.DomainMatch")) {
+ g_free(network->wifi.domain_match);
+ network->wifi.domain_match = g_strdup(value);
} else if (g_str_equal(key, "WiFi.ClientCertFile")) {
g_free(network->wifi.client_cert_path);
network->wifi.client_cert_path = g_strdup(value);
const char *connman_network_get_string(struct connman_network *network,
const char *key)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s", network, key);
-#endif
-
if (g_str_equal(key, "Path"))
return network->path;
else if (g_str_equal(key, "Name"))
return network->wifi.eap;
else if (g_str_equal(key, "WiFi.Identity"))
return network->wifi.identity;
+ else if (g_str_equal(key, "WiFi.AnonymousIdentity"))
+ return network->wifi.anonymous_identity;
else if (g_str_equal(key, "WiFi.AgentIdentity"))
return network->wifi.agent_identity;
else if (g_str_equal(key, "WiFi.CACertFile"))
return network->wifi.ca_cert_path;
+ else if (g_str_equal(key, "WiFi.SubjectMatch"))
+ return network->wifi.subject_match;
+ else if (g_str_equal(key, "WiFi.AltSubjectMatch"))
+ return network->wifi.altsubject_match;
+ else if (g_str_equal(key, "WiFi.DomainSuffixMatch"))
+ return network->wifi.domain_suffix_match;
+ else if (g_str_equal(key, "WiFi.DomainMatch"))
+ return network->wifi.domain_match;
else if (g_str_equal(key, "WiFi.ClientCertFile"))
return network->wifi.client_cert_path;
else if (g_str_equal(key, "WiFi.PrivateKeyFile"))
int connman_network_set_bool(struct connman_network *network,
const char *key, bool value)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s value %d", network, key, value);
-#endif
-
if (g_strcmp0(key, "Roaming") == 0)
network->roaming = value;
else if (g_strcmp0(key, "WiFi.WPS") == 0)
bool connman_network_get_bool(struct connman_network *network,
const char *key)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s", network, key);
-#endif
-
if (g_str_equal(key, "Roaming"))
return network->roaming;
else if (g_str_equal(key, "WiFi.WPS"))
return false;
}
+#if defined TIZEN_EXT
+/**
+ * connman_network_set_vsie_list:
+ * @network: network structure
+ * @vsie_list: GSList pointer
+ *
+ * Set vendor specific list pointer
+ */
+void connman_network_set_vsie_list(struct connman_network *network, GSList *vsie_list)
+{
+ g_slist_free_full(network->wifi.vsie_list, g_free);
+ network->wifi.vsie_list = vsie_list;
+}
+
+/**
+ * connman_network_get_vsie_list:
+ * @network: network structure
+ *
+ * Get vendor specific list pointer
+ */
+void *connman_network_get_vsie_list(struct connman_network *network)
+{
+ return network->wifi.vsie_list;
+}
+#endif
+
/**
* connman_network_set_blob:
* @network: network structure
int connman_network_set_blob(struct connman_network *network,
const char *key, const void *data, unsigned int size)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s size %d", network, key, size);
-#endif
-
if (g_str_equal(key, "WiFi.SSID")) {
g_free(network->wifi.ssid);
network->wifi.ssid = g_try_malloc(size);
network->wifi.ssid_len = size;
} else
network->wifi.ssid_len = 0;
-#if defined TIZEN_EXT
- } else if (g_str_equal(key, "WiFi.Vsie")){
- g_free(network->wifi.wifi_vsie);
- network->wifi.wifi_vsie = g_try_malloc(size);
- if (network->wifi.wifi_vsie) {
- memcpy(network->wifi.wifi_vsie, data, size);
- network->wifi.wifi_vsie_len = size;
- } else
- network->wifi.wifi_vsie_len = 0;
-#endif
} else {
return -EINVAL;
}
const void *connman_network_get_blob(struct connman_network *network,
const char *key, unsigned int *size)
{
-#if !defined TIZEN_EXT
- DBG("network %p key %s", network, key);
-#endif
-
if (g_str_equal(key, "WiFi.SSID")) {
if (size)
*size = network->wifi.ssid_len;
return network->wifi.ssid;
}
-#if defined TIZEN_EXT
- if (g_str_equal(key, "WiFi.Vsie")) {
- if (size)
- *size = network->wifi.wifi_vsie_len;
- return network->wifi.wifi_vsie;
- }
-#endif
-
return NULL;
}