[CFLAGS="$CFLAGS -DTIZEN_EXT_WIFI_MESH"], [enable_tizen_ext_wifi_mesh="no"])
AM_CONDITIONAL(TIZEN_EXT_WIFI_MESH, test "${enable_tizen_ext_wifi_mesh}" != "no")
+AC_ARG_ENABLE(tizen-ext-eap-on-ethernet,
+ AC_HELP_STRING([--enable-tizen-ext-eap-on-ethernet], [enable TIZEN extensions for EAP on Ethernet]),
+ [CFLAGS="$CFLAGS -DTIZEN_EXT_EAP_ON_ETHERNET"], [enable_tizen_ext_eap_on_ethernet="no"])
+AM_CONDITIONAL(TIZEN_EXT_EAP_ON_ETHERNET, test "${enable_tizen_ext_eap_on_ethernet}" != "no")
+
AC_ARG_ENABLE(tizen-maintain-online,
AC_HELP_STRING([--enable-tizen-maintain-online], [enable TIZEN extensions]),
[if (test "${enableval}" = "yes"); then
#include <glib.h>
#include "dbus.h"
+#include <connman/log.h>
#define TIMEOUT 30000
const char *group);
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+typedef void (*g_supplicant_eap_callback)(GSupplicantInterface *interface, bool status);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct _GSupplicantCallbacks {
void (*system_ready) (void);
void (*system_killed) (void);
void (*mesh_peer_connected) (GSupplicantMeshPeer *mesh_peer);
void (*mesh_peer_disconnected) (GSupplicantMeshPeer *mesh_peer);
#endif
+
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ g_supplicant_eap_callback eap;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
};
typedef struct _GSupplicantCallbacks GSupplicantCallbacks;
unsigned int assoc_reject_score, int signal_level3_5ghz, int signal_level3_24ghz);
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+void g_supplicant_replace_config_file(const char *ifname, const char *config_file);
+void g_supplicant_register_eap_callback(g_supplicant_eap_callback cb);
+void g_supplicant_unregister_eap_callback(void);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+int g_supplicant_register(GSupplicantCallbacks *callbacks);
+#else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
int g_supplicant_register(const GSupplicantCallbacks *callbacks);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
void g_supplicant_unregister(const GSupplicantCallbacks *callbacks);
static inline
static DBusConnection *connection;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static GSupplicantCallbacks *callbacks_pointer;
+#else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
static const GSupplicantCallbacks *callbacks_pointer;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
static dbus_bool_t system_available = FALSE;
static dbus_bool_t system_ready = FALSE;
callbacks_pointer->sta_deauthorized(interface, addr);
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static void callback_eap(GSupplicantInterface *interface, bool status)
+{
+ if (!callbacks_pointer)
+ return;
+
+ if (!callbacks_pointer->eap)
+ return;
+
+ callbacks_pointer->eap(interface, status);
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static void callback_peer_found(GSupplicantPeer *peer)
{
if (!callbacks_pointer)
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+void g_supplicant_replace_config_file(const char *ifname, const char *config_file)
+{
+ if (!ifname)
+ return;
+
+ if (!config_file)
+ return;
+
+ SUPPLICANT_DBG("New {%s, %s}", ifname, config_file);
+ g_hash_table_replace(config_file_table,
+ g_strdup(ifname), g_strdup(config_file));
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static void interface_property(const char *key, DBusMessageIter *iter,
void *user_data)
{
callback_sta_deauthorized(interface, addr);
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static void signal_eap(const char *path, DBusMessageIter *iter)
+{
+ GSupplicantInterface *interface;
+ const char *str = NULL;
+
+ SUPPLICANT_DBG("EAPOL_DEBUG callback eap signal");
+
+ interface = g_hash_table_lookup(interface_table, path);
+ if (!interface)
+ return;
+
+ // TODO: Identify EAP fail condition, currently timeout is used for failure.
+
+ dbus_message_iter_get_basic(iter, &str);
+ if (!str)
+ return;
+
+ if (g_strcmp0("completion", str))
+ return;
+
+ dbus_message_iter_next(iter);
+
+ dbus_message_iter_get_basic(iter, &str);
+ if (!str)
+ return;
+
+ if (!g_strcmp0("success", str))
+ callback_eap(interface, true);
+ else
+ callback_eap(interface, false);
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static void signal_bss_changed(const char *path, DBusMessageIter *iter)
{
GSupplicantInterface *interface;
signal_mesh_peer_disconnected },
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ { SUPPLICANT_INTERFACE ".Interface", "EAP", signal_eap },
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
{ }
};
&data->interface->path);
}
-
int g_supplicant_interface_remove(GSupplicantInterface *interface,
GSupplicantInterfaceCallback callback,
void *user_data)
}
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+void g_supplicant_register_eap_callback(g_supplicant_eap_callback cb)
+{
+ SUPPLICANT_DBG("g_supplicant_register_eap_callback %p", cb);
+
+ if (!callbacks_pointer) {
+ SUPPLICANT_DBG("callbacks_pointer is NULL");
+ return;
+ }
+
+ callbacks_pointer->eap = cb;
+}
+
+void g_supplicant_unregister_eap_callback(void)
+{
+ SUPPLICANT_DBG("g_supplicant_unregister_eap_callback");
+
+ if (!callbacks_pointer) {
+ SUPPLICANT_DBG("callbacks_pointer is NULL");
+ return;
+ }
+
+ callbacks_pointer->eap = NULL;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+int g_supplicant_register(GSupplicantCallbacks *callbacks)
+#else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
int g_supplicant_register(const GSupplicantCallbacks *callbacks)
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
{
connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (!connection)
} else
invoke_introspect_method();
+ SUPPLICANT_DBG("supplicant dbus setup completed");
return 0;
}
#if defined TIZEN_EXT
void connman_network_set_connecting(struct connman_network *network);
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+bool connman_network_check_validity(struct connman_network *network);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
int connman_network_set_available(struct connman_network *network,
bool available);
bool connman_network_get_available(struct connman_network *network);
Name: connman
Version: 1.37
-Release: 38
+Release: 39
License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
--enable-client \
--enable-tizen-ext \
--disable-tizen-ext-ins \
+ --enable-tizen-ext-eap-on-ethernet \
--enable-pacrunner \
--enable-wifi=builtin \
%if %{with connman_openconnect}
#include <connman/mesh.h>
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+#include <connman/option.h>
+#include <gsupplicant/gsupplicant.h>
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static bool eth_tethering = false;
struct ethernet_data {
unsigned flags;
unsigned int watch;
struct connman_network *network;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ GSupplicantInterface *interface;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
};
DBG("network %p", network);
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static struct connman_network *g_network = NULL;
+
+void handle_eap_signal(GSupplicantInterface *interface, bool status)
+{
+ DBG("captured EAP signal");
+
+ if (!g_network)
+ return;
+
+ if (g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+
+ if (!connman_network_check_validity(g_network))
+ return;
+
+ DBG("network is valid");
+
+ g_supplicant_unregister_eap_callback();
+
+ if (!status) {
+ // Should we mark service as non favorite or make autoconnect as false?
+
+ g_supplicant_interface_remove(interface, NULL, NULL);
+ connman_network_set_error(g_network, CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL);
+ g_network = NULL;
+ return;
+ }
+
+ connman_network_set_connected(g_network, status);
+ g_network = NULL;
+}
+
+static void interface_create_callback(int result,
+ GSupplicantInterface *interface, void *user_data)
+{
+ struct ethernet_data *ethernet = user_data;
+
+ if (result < 0 || !interface || !ethernet)
+ return;
+
+ DBG("result %d ifname %s, ethernet %p", result,
+ g_supplicant_interface_get_ifname(interface),
+ ethernet);
+
+ ethernet->interface = interface;
+ g_supplicant_interface_set_data(interface, ethernet);
+}
+
+static int eth_network_connect(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ struct connman_service *service = connman_service_lookup_from_network(network);
+
+ if (service && __connman_service_get_use_eapol(service)) {
+ struct connman_device *device = connman_network_get_device(network);
+ struct ethernet_data *ethernet = connman_device_get_data(device);
+ const char *driver = "wired";
+ int index = connman_network_get_index(network);
+ char *ifname = connman_inet_ifname(index);;
+ char *config_file = NULL;
+
+ g_supplicant_register_eap_callback(handle_eap_signal);
+ g_network = network;
+
+ if (asprintf(&config_file, "/opt/usr/data/network/%s-eapol.conf", ifname) < 0)
+ return -ENOMEM;
+
+ DBG("config_file %s", config_file);
+
+ g_supplicant_replace_config_file(ifname, config_file);
+ free(config_file);
+
+ /*
+ * TODO: RemoveInterface if already present because
+ * already created interface will not start EAP handshake.
+ */
+ g_supplicant_interface_create(ifname, driver, NULL,
+ interface_create_callback, ethernet);
+
+ g_free(ifname);
+
+ return 0;
+ }
+
+ connman_network_set_connected(network, true);
+
+ return 0;
+}
+
+static int eth_network_disconnect(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ struct connman_service *service = connman_service_lookup_from_network(network);
+
+ if (service && __connman_service_get_use_eapol(service)) {
+ struct connman_device *device = connman_network_get_device(network);
+ struct ethernet_data *ethernet = connman_device_get_data(device);
+
+ g_network = NULL;
+ g_supplicant_unregister_eap_callback();
+ g_supplicant_interface_remove(ethernet->interface, NULL, NULL);
+ connman_network_set_associating(network, false);
+ connman_network_set_connected(network, false);
+
+ return 0;
+ }
+
+ connman_network_set_connected(network, false);
+
+ return 0;
+}
+
+#else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static int eth_network_connect(struct connman_network *network)
{
DBG("network %p", network);
return 0;
}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static struct connman_network_driver eth_network_driver = {
.name = "cable",
.type = CONNMAN_NETWORK_TYPE_ETHERNET,
ethernet->index = connman_device_get_index(device);
ethernet->flags = 0;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ ethernet->interface = NULL;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
ethernet->watch = connman_rtnl_add_newlink_watch(ethernet->index,
ethernet_newlink, device);
connman_device_set_data(device, NULL);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ g_supplicant_interface_remove(ethernet->interface, NULL, NULL);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
connman_rtnl_remove_watch(ethernet->watch);
remove_network(device, ethernet);
{
const char *ifname = g_supplicant_interface_get_ifname(interface);
const char *driver = g_supplicant_interface_get_driver(interface);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
#if defined TIZEN_EXT
bool is_5_0_ghz_supported = g_supplicant_interface_get_is_5_0_ghz_supported(interface);
#endif
struct connman_device *device;
struct wifi_data *wifi;
GSupplicantState state = g_supplicant_interface_get_state(interface);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
bool wps;
bool old_connected;
{
const char *ifname = g_supplicant_interface_get_ifname(interface);
struct wifi_data *wifi;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
DBG("ifname %s", ifname);
{
char dev_type[17] = {};
const char *hostname;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
DBG("");
static void scan_started(GSupplicantInterface *interface)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
DBG("");
}
static void scan_finished(GSupplicantInterface *interface)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
#if defined TIZEN_EXT
struct wifi_data *wifi;
bool is_associating = false;
static void ap_create_fail(GSupplicantInterface *interface)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
int ret;
#endif
interface = g_supplicant_network_get_interface(supplicant_network);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
wifi = g_supplicant_interface_get_data(interface);
name = g_supplicant_network_get_name(supplicant_network);
security = g_supplicant_network_get_security(supplicant_network);
#endif
interface = g_supplicant_network_get_interface(network);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
wifi = g_supplicant_interface_get_data(interface);
identifier = g_supplicant_network_get_identifier(network);
name = g_supplicant_network_get_name(network);
#endif
interface = g_supplicant_network_get_interface(network);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
wifi = g_supplicant_interface_get_data(interface);
identifier = g_supplicant_network_get_identifier(network);
name = g_supplicant_network_get_name(network);
interface = g_supplicant_network_get_interface(network);
if (!interface)
return;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
wifi = g_supplicant_interface_get_data(interface);
if (!wifi)
static void sta_authorized(GSupplicantInterface *interface,
const char *addr)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
DBG("wifi %p station %s authorized", wifi, addr);
static void sta_deauthorized(GSupplicantInterface *interface,
const char *addr)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
DBG("wifi %p station %s deauthorized", wifi, addr);
if (!interface)
return;
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
state = g_supplicant_interface_get_state(interface);
if (state < G_SUPPLICANT_STATE_AUTHENTICATING)
return;
static void scan_done(GSupplicantInterface *interface)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
GList *list;
int scan_type = CONNMAN_SCAN_TYPE_WPA_SUPPLICANT;
struct wifi_data *wifi;
static void disconnect_reasoncode(GSupplicantInterface *interface,
int reasoncode)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
if (wifi != NULL) {
static void assoc_status_code(GSupplicantInterface *interface, int status_code)
{
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If supplicant interface's driver is wired then skip it,
+ * because it meanti only for ethernet not Wi-Fi.
+ */
+ if (!g_strcmp0("wired", g_supplicant_interface_get_driver(interface)))
+ return;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
if (wifi != NULL) {
}
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static GSupplicantCallbacks callbacks = {
+#else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
static const GSupplicantCallbacks callbacks = {
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
.system_ready = system_ready,
.system_killed = system_killed,
.interface_added = interface_added,
void __connman_service_set_auto_connect_mode(bool enable);
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+int __connman_service_get_use_eapol(struct connman_service *service);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
bool __connman_service_remove(struct connman_service *service);
bool __connman_service_is_provider_pending(struct connman_service *service);
void __connman_service_set_provider_pending(struct connman_service *service,
}
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+bool connman_network_check_validity(struct connman_network *network)
+{
+ return (NULL == g_slist_find(network_list, network)) ? false : true;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
/**
* connman_network_set_associating:
* @network: network structure
return err;
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * Note: If EAP on Ethernet is ON, then network will be connected
+ * after EAP Success event is recieved, from plugin/ethernet.c
+ */
+ struct connman_service *service = connman_service_lookup_from_network(network);
+ if (service && __connman_service_get_use_eapol(service)) {
+ connman_network_set_associating(network, true);
+ return 0;
+ }
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
set_connected(network);
return err;
#endif
int ins_score;
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ /*
+ * To indicate use of EAP over Ethernet.
+ */
+ bool use_eapol;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
};
static bool allow_property_changed(struct connman_service *service);
#if defined TIZEN_EXT
bool internet_connection;
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ bool use_eapol;
+#endif
DBG("service %p", service);
if (!error)
service->autoconnect = autoconnect;
g_clear_error(&error);
+
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ use_eapol = g_key_file_get_boolean(keyfile,
+ service->identifier, "UseEapol", &error);
+ if (!error)
+ service->use_eapol = use_eapol;
+ g_clear_error(&error);
+#endif
break;
}
if (service->favorite)
g_key_file_set_boolean(keyfile, service->identifier,
"AutoConnect", service->autoconnect);
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ g_key_file_set_boolean(keyfile, service->identifier,
+ "UseEapol", service->use_eapol);
+#endif
break;
}
}
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static void use_eapol_changed(struct connman_service *service)
+{
+ dbus_bool_t use_eapol;
+
+ if (!service->path)
+ return;
+
+ if (!allow_property_changed(service))
+ return;
+
+ use_eapol = service->use_eapol;
+ connman_dbus_property_changed_basic(service->path,
+ CONNMAN_SERVICE_INTERFACE,
+ "UseEapol",
+ DBUS_TYPE_BOOLEAN,
+ &use_eapol);
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static void strength_changed(struct connman_service *service)
{
if (service->strength == 0)
break;
#endif
case CONNMAN_SERVICE_TYPE_ETHERNET:
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ val = service->use_eapol;
+ connman_dbus_dict_append_basic(dict, "UseEapol",
+ DBUS_TYPE_BOOLEAN, &val);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
case CONNMAN_SERVICE_TYPE_GADGET:
connman_dbus_dict_append_dict(dict, "Ethernet",
return service->passphrase;
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+int __connman_service_get_use_eapol(struct connman_service *service)
+{
+ if (!service) {
+ DBG("Service is NULL");
+ return -1;
+ }
+
+ return service->use_eapol;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
__connman_service_set_passphrase(service, passphrase);
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ } else if (g_str_equal(name, "UseEapol")) {
+ dbus_bool_t use_eapol;
+
+ if (type != DBUS_TYPE_BOOLEAN)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_get_basic(&value, &use_eapol);
+
+ service->use_eapol = use_eapol;
+ service_save(service);
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
} else
return __connman_error_invalid_property(msg);
service->user_pdn_connection_refcount = 0;
__sync_synchronize();
#endif
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+ service->use_eapol = false;
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
}
/**