Added Dbus method 'IsEapolEnabled'.
[platform/upstream/connman.git] / src / service.c
index 5a73d09..c7088d2 100755 (executable)
@@ -7452,6 +7452,26 @@ static DBusMessage *reset_counters(DBusConnection *conn,
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static DBusMessage *is_eapol_enabled(DBusConnection *conn,
+                                       DBusMessage *msg, void *user_data)
+{
+       struct connman_service *service = user_data;
+       DBG("service: %p path: %s UseEapol: %d", service, service->path, service->use_eapol);
+
+       dbus_bool_t eapol_status = service->use_eapol;
+
+       DBusMessage *reply = dbus_message_new_method_return(msg);
+       if (!reply) {
+               DBG("Failed to initialize reply");
+               return NULL;
+       }
+
+       dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &eapol_status, DBUS_TYPE_INVALID);
+       return reply;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
 #if defined TIZEN_MAINTAIN_ONLINE
 static DBusMessage *downgrade_service(DBusConnection *conn,
                                        DBusMessage *msg, void *user_data)
@@ -7529,6 +7549,9 @@ static const GDBusMethodTable service_methods[] = {
                        GDBUS_ARGS({ "service", "o" }), NULL,
                        move_after) },
        { GDBUS_METHOD("ResetCounters", NULL, NULL, reset_counters) },
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+       { GDBUS_METHOD("IsEapolEnabled", NULL, GDBUS_ARGS({ "eapol", "b" }), is_eapol_enabled) },
+#endif
 #if defined TIZEN_MAINTAIN_ONLINE
        { GDBUS_METHOD("Downgrade", NULL, NULL, downgrade_service) },
 #endif