]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus_new: Add EAP logon/logoff
authorPaul Stewart <pstew@chromium.org>
Tue, 23 Apr 2013 14:57:55 +0000 (17:57 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 23 Apr 2013 14:57:55 +0000 (17:57 +0300)
Add "EAPLogoff" and "EAPLogon" interface DBus commands which
parallel the "logoff" and "logon" wpa_ctrl commands which terminate
and restart EAP authentication.  Slightly enhance the "logon" case
by expiring any running "startWhile" timer.

Signed-hostap: Paul Stewart <pstew@chromium.org>

doc/dbus.doxygen
src/eapol_supp/eapol_supp_sm.c
wpa_supplicant/dbus/dbus_new.c
wpa_supplicant/dbus/dbus_new_handlers.c
wpa_supplicant/dbus/dbus_new_handlers.h

index a737ed73d27bef12255c43c653cb6c5ef92b34af..988f769ff50b662327342d469d7599fb92812eaf 100644 (file)
@@ -331,7 +331,15 @@ fi.w1.wpa_supplicant1.CreateInterface.
          <dt>fi.w1.wpa_supplicant1.InvalidArgs</dt>
          <dd>Invalid entries were found in the passed argument.</dd>
        </dl>
-       </li>
+      </li>
+      <li>
+       <h3>EAPLogoff ( ) --> nothing</h3>
+       <p>IEEE 802.1X EAPOL state machine logoff.</p>
+      </li>
+      <li>
+       <h3>EAPLogon ( ) --> nothing</h3>
+       <p>IEEE 802.1X EAPOL state machine logon.</p>
+      </li>
     </ul>
 
 \subsection dbus_interface_properties Properties
index 2e560865ef035607091722085186f40200b6905f..9b054fcd88c6bf012c6ca4979cc2ed4f251fb943 100644 (file)
@@ -1533,6 +1533,10 @@ void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff)
 {
        if (sm) {
                sm->userLogoff = logoff;
+               if (!logoff) {
+                       /* If there is a delayed txStart queued, start now. */
+                       sm->startWhen = 0;
+               }
                eapol_sm_step(sm);
        }
 }
index 136dd1af81558af6159e5b9ac4526cf0507e63a3..e9bd51f591985cb3d559a5c3dcb46cdef7d1ae3e 100644 (file)
@@ -2654,6 +2654,18 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
          }
        },
 #endif /* CONFIG_AP */
+       { "EAPLogoff", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) &wpas_dbus_handler_eap_logoff,
+         {
+                 END_ARGS
+         }
+       },
+       { "EAPLogon", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) &wpas_dbus_handler_eap_logon,
+         {
+                 END_ARGS
+         }
+       },
        { NULL, NULL, NULL, { END_ARGS } }
 };
 
index 335c25fb8b69b1be73ba0f2332f0da0cf46675ad..478d02f63dfa1810ebf9292255250db7de034c03 100644 (file)
@@ -1938,6 +1938,38 @@ DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message,
 #endif /* CONFIG_AUTOSCAN */
 
 
+/*
+ * wpas_dbus_handler_eap_logoff - IEEE 802.1X EAPOL state machine logoff
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: NULL
+ *
+ * Handler function for "EAPLogoff" method call of network interface.
+ */
+DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message,
+                                          struct wpa_supplicant *wpa_s)
+{
+       eapol_sm_notify_logoff(wpa_s->eapol, TRUE);
+       return NULL;
+}
+
+
+/*
+ * wpas_dbus_handler_eap_logon - IEEE 802.1X EAPOL state machine logon
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: NULL
+ *
+ * Handler function for "EAPLogin" method call of network interface.
+ */
+DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message,
+                                         struct wpa_supplicant *wpa_s)
+{
+       eapol_sm_notify_logoff(wpa_s->eapol, FALSE);
+       return NULL;
+}
+
+
 /**
  * wpas_dbus_getter_capabilities - Return interface capabilities
  * @iter: Pointer to incoming dbus message iter
index aa565508f8e95aff2208656ce15b89c1dabf8d80..fbc8358be6617f7cdaf09677055e16906b3a1cfa 100644 (file)
@@ -128,6 +128,12 @@ DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message,
 DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message,
                                         struct wpa_supplicant *wpa_s);
 
+DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message,
+                                          struct wpa_supplicant *wpa_s);
+
+DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message,
+                                         struct wpa_supplicant *wpa_s);
+
 dbus_bool_t wpas_dbus_getter_capabilities(DBusMessageIter *iter,
                                          DBusError *error, void *user_data);