]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Remove unused WFA WLANConfig Service actions
authorJouni Malinen <j@w1.fi>
Sat, 14 Nov 2009 12:08:58 +0000 (14:08 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 14 Nov 2009 12:08:58 +0000 (14:08 +0200)
This removes following WFA WLANConfig Service actions and the related
state variables: GetAPSettings, SetAPSettings, DelAPSettings,
GetSTASettings, SetSTASettings, DelSTASettings, RebootAP,
ResetAP, RebootSTA, ResetSTA.

While WFA WLANConfig Service version 1.0 claims that some of these are
mandatory to implement for an AP, there are no known implementations
supporting these actions neither in an AP/proxy or an External Registrar
that would use them. These are unlikely to be supported in the future
either and as such, it is just simpler to get rid of them to clean up
the implementation and reduce code size.

hostapd/wps_hostapd.c
src/wps/wps_upnp.h
src/wps/wps_upnp_web.c

index 1e9aeae3a564ae969cd7aca00a3d98d75ba1f1ca..5de4d3cb52374bb356d0faf1a9d8d62747491d1e 100644 (file)
@@ -874,52 +874,6 @@ hostapd_rx_req_put_message(void *priv, struct upnp_wps_peer *peer,
 }
 
 
-static struct wpabuf *
-hostapd_rx_req_get_ap_settings(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return NULL;
-}
-
-
-static int hostapd_rx_req_set_ap_settings(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static int hostapd_rx_req_del_ap_settings(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static struct wpabuf *
-hostapd_rx_req_get_sta_settings(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return NULL;
-}
-
-
-static int hostapd_rx_req_set_sta_settings(void *priv,
-                                          const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static int hostapd_rx_req_del_sta_settings(void *priv,
-                                          const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
 static int hostapd_rx_req_put_wlan_response(
        void *priv, enum upnp_wps_wlanevent_type ev_type,
        const u8 *mac_addr, const struct wpabuf *msg,
@@ -985,34 +939,6 @@ static int hostapd_rx_req_set_selected_registrar(void *priv,
 }
 
 
-static int hostapd_rx_req_reboot_ap(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static int hostapd_rx_req_reset_ap(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static int hostapd_rx_req_reboot_sta(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
-static int hostapd_rx_req_reset_sta(void *priv, const struct wpabuf *msg)
-{
-       wpa_printf(MSG_DEBUG, "WPS UPnP: TODO %s", __func__);
-       return -1;
-}
-
-
 static int hostapd_wps_upnp_init(struct hostapd_data *hapd,
                                 struct wps_context *wps)
 {
@@ -1026,19 +952,9 @@ static int hostapd_wps_upnp_init(struct hostapd_data *hapd,
 
        ctx->rx_req_get_device_info = hostapd_rx_req_get_device_info;
        ctx->rx_req_put_message = hostapd_rx_req_put_message;
-       ctx->rx_req_get_ap_settings = hostapd_rx_req_get_ap_settings;
-       ctx->rx_req_set_ap_settings = hostapd_rx_req_set_ap_settings;
-       ctx->rx_req_del_ap_settings = hostapd_rx_req_del_ap_settings;
-       ctx->rx_req_get_sta_settings = hostapd_rx_req_get_sta_settings;
-       ctx->rx_req_set_sta_settings = hostapd_rx_req_set_sta_settings;
-       ctx->rx_req_del_sta_settings = hostapd_rx_req_del_sta_settings;
        ctx->rx_req_put_wlan_response = hostapd_rx_req_put_wlan_response;
        ctx->rx_req_set_selected_registrar =
                hostapd_rx_req_set_selected_registrar;
-       ctx->rx_req_reboot_ap = hostapd_rx_req_reboot_ap;
-       ctx->rx_req_reset_ap = hostapd_rx_req_reset_ap;
-       ctx->rx_req_reboot_sta = hostapd_rx_req_reboot_sta;
-       ctx->rx_req_reset_sta = hostapd_rx_req_reset_sta;
 
        hapd->wps_upnp = upnp_wps_device_init(ctx, wps, hapd);
        if (hapd->wps_upnp == NULL) {
index 31b055628bd6b61b17335ef7a516c66eada72d99..063e68c75095ee9a534a03dda838dd25c36d0352 100644 (file)
@@ -30,24 +30,12 @@ struct upnp_wps_device_ctx {
        struct wpabuf * (*rx_req_put_message)(
                void *priv, struct upnp_wps_peer *peer,
                const struct wpabuf *msg);
-       struct wpabuf * (*rx_req_get_ap_settings)(void *priv,
-                                                 const struct wpabuf *msg);
-       int (*rx_req_set_ap_settings)(void *priv, const struct wpabuf *msg);
-       int (*rx_req_del_ap_settings)(void *priv, const struct wpabuf *msg);
-       struct wpabuf * (*rx_req_get_sta_settings)(void *priv,
-                                                  const struct wpabuf *msg);
-       int (*rx_req_set_sta_settings)(void *priv, const struct wpabuf *msg);
-       int (*rx_req_del_sta_settings)(void *priv, const struct wpabuf *msg);
        int (*rx_req_put_wlan_response)(
                void *priv, enum upnp_wps_wlanevent_type ev_type,
                const u8 *mac_addr, const struct wpabuf *msg,
                enum wps_msg_type msg_type);
        int (*rx_req_set_selected_registrar)(void *priv,
                                             const struct wpabuf *msg);
-       int (*rx_req_reboot_ap)(void *priv, const struct wpabuf *msg);
-       int (*rx_req_reset_ap)(void *priv, const struct wpabuf *msg);
-       int (*rx_req_reboot_sta)(void *priv, const struct wpabuf *msg);
-       int (*rx_req_reset_sta)(void *priv, const struct wpabuf *msg);
 };
 
 struct upnp_wps_device_sm *
index 07a004c68134db7e78dae07d537fbbe7ede1ade9..4332ea3c7235c0751080c26a3935f334c8b984a4 100644 (file)
@@ -73,76 +73,6 @@ static const char wps_scpd_xml[] =
 "</argumentList>\n"
 "</action>\n"
 "<action>\n"
-"<name>GetAPSettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewMessage</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>Message</relatedStateVariable>\n"
-"</argument>\n"
-"<argument>\n"
-"<name>NewAPSettings</name>\n"
-"<direction>out</direction>\n"
-"<relatedStateVariable>APSettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>SetAPSettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>APSettings</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>APSettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>DelAPSettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewAPSettings</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>APSettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>GetSTASettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewMessage</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>Message</relatedStateVariable>\n"
-"</argument>\n"
-"<argument>\n"
-"<name>NewSTASettings</name>\n"
-"<direction>out</direction>\n"
-"<relatedStateVariable>STASettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>SetSTASettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewSTASettings</name>\n"
-"<direction>out</direction>\n"
-"<relatedStateVariable>STASettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>DelSTASettings</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewSTASettings</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>STASettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
 "<name>PutWLANResponse</name>\n"
 "<argumentList>\n"
 "<argument>\n"
@@ -172,46 +102,6 @@ static const char wps_scpd_xml[] =
 "</argument>\n"
 "</argumentList>\n"
 "</action>\n"
-"<action>\n"
-"<name>RebootAP</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewAPSettings</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>APSettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>ResetAP</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewMessage</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>Message</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>RebootSTA</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewSTASettings</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>APSettings</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
-"<action>\n"
-"<name>ResetSTA</name>\n"
-"<argumentList>\n"
-"<argument>\n"
-"<name>NewMessage</name>\n"
-"<direction>in</direction>\n"
-"<relatedStateVariable>Message</relatedStateVariable>\n"
-"</argument>\n"
-"</argumentList>\n"
-"</action>\n"
 "</actionList>\n"
 "<serviceStateTable>\n"
 "<stateVariable sendEvents=\"no\">\n"
@@ -230,18 +120,10 @@ static const char wps_scpd_xml[] =
 "<name>DeviceInfo</name>\n"
 "<dataType>bin.base64</dataType>\n"
 "</stateVariable>\n"
-"<stateVariable sendEvents=\"no\">\n"
-"<name>APSettings</name>\n"
-"<dataType>bin.base64</dataType>\n"
-"</stateVariable>\n"
 "<stateVariable sendEvents=\"yes\">\n"
 "<name>APStatus</name>\n"
 "<dataType>ui1</dataType>\n"
 "</stateVariable>\n"
-"<stateVariable sendEvents=\"no\">\n"
-"<name>STASettings</name>\n"
-"<dataType>bin.base64</dataType>\n"
-"</stateVariable>\n"
 "<stateVariable sendEvents=\"yes\">\n"
 "<name>STAStatus</name>\n"
 "<dataType>ui1</dataType>\n"
@@ -567,144 +449,6 @@ web_process_put_message(struct upnp_wps_device_sm *sm, char *data,
 }
 
 
-static enum http_reply_code
-web_process_get_ap_settings(struct upnp_wps_device_sm *sm, char *data,
-                           struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       static const char *name = "NewAPSettings";
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: GetAPSettings");
-       if (sm->ctx->rx_req_get_ap_settings == NULL)
-               return HTTP_INTERNAL_SERVER_ERROR;
-       msg = xml_get_base64_item(data, "NewMessage", &ret);
-       if (msg == NULL)
-               return ret;
-       *reply = sm->ctx->rx_req_get_ap_settings(sm->priv, msg);
-       wpabuf_free(msg);
-       if (*reply == NULL)
-               return HTTP_INTERNAL_SERVER_ERROR;
-       *replyname = name;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_set_ap_settings(struct upnp_wps_device_sm *sm, char *data,
-                           struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: SetAPSettings");
-       msg = xml_get_base64_item(data, "NewAPSettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_set_ap_settings ||
-           sm->ctx->rx_req_set_ap_settings(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_del_ap_settings(struct upnp_wps_device_sm *sm, char *data,
-                           struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: DelAPSettings");
-       msg = xml_get_base64_item(data, "NewAPSettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_del_ap_settings ||
-           sm->ctx->rx_req_del_ap_settings(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_get_sta_settings(struct upnp_wps_device_sm *sm, char *data,
-                            struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       static const char *name = "NewSTASettings";
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: GetSTASettings");
-       if (sm->ctx->rx_req_get_sta_settings == NULL)
-               return HTTP_INTERNAL_SERVER_ERROR;
-       msg = xml_get_base64_item(data, "NewMessage", &ret);
-       if (msg == NULL)
-               return ret;
-       *reply = sm->ctx->rx_req_get_sta_settings(sm->priv, msg);
-       wpabuf_free(msg);
-       if (*reply == NULL)
-               return HTTP_INTERNAL_SERVER_ERROR;
-       *replyname = name;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_set_sta_settings(struct upnp_wps_device_sm *sm, char *data,
-                            struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: SetSTASettings");
-       msg = xml_get_base64_item(data, "NewSTASettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_set_sta_settings ||
-           sm->ctx->rx_req_set_sta_settings(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_del_sta_settings(struct upnp_wps_device_sm *sm, char *data,
-                            struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: DelSTASettings");
-       msg = xml_get_base64_item(data, "NewSTASettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_del_sta_settings ||
-           sm->ctx->rx_req_del_sta_settings(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
 static enum http_reply_code
 web_process_put_wlan_response(struct upnp_wps_device_sm *sm, char *data,
                              struct wpabuf **reply, const char **replyname)
@@ -788,98 +532,6 @@ web_process_set_selected_registrar(struct upnp_wps_device_sm *sm, char *data,
 }
 
 
-static enum http_reply_code
-web_process_reboot_ap(struct upnp_wps_device_sm *sm, char *data,
-                     struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: RebootAP");
-       msg = xml_get_base64_item(data, "NewAPSettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_reboot_ap ||
-           sm->ctx->rx_req_reboot_ap(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_reset_ap(struct upnp_wps_device_sm *sm, char *data,
-                    struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: ResetAP");
-       msg = xml_get_base64_item(data, "NewMessage", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_reset_ap ||
-           sm->ctx->rx_req_reset_ap(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_reboot_sta(struct upnp_wps_device_sm *sm, char *data,
-                      struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: RebootSTA");
-       msg = xml_get_base64_item(data, "NewSTASettings", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_reboot_sta ||
-           sm->ctx->rx_req_reboot_sta(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
-static enum http_reply_code
-web_process_reset_sta(struct upnp_wps_device_sm *sm, char *data,
-                     struct wpabuf **reply, const char **replyname)
-{
-       struct wpabuf *msg;
-       enum http_reply_code ret;
-
-       wpa_printf(MSG_DEBUG, "WPS UPnP: ResetSTA");
-       msg = xml_get_base64_item(data, "NewMessage", &ret);
-       if (msg == NULL)
-               return ret;
-       if (!sm->ctx->rx_req_reset_sta ||
-           sm->ctx->rx_req_reset_sta(sm->priv, msg)) {
-               wpabuf_free(msg);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-       wpabuf_free(msg);
-       *replyname = NULL;
-       *reply = NULL;
-       return HTTP_OK;
-}
-
-
 static const char *soap_prefix =
        "<?xml version=\"1.0\"?>\n"
        "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
@@ -1093,38 +745,12 @@ static void web_connection_parse_post(struct upnp_wps_device_sm *sm,
                ret = web_process_get_device_info(sm, &reply, &replyname);
        else if (!os_strncasecmp("PutMessage", action, action_len))
                ret = web_process_put_message(sm, data, &reply, &replyname);
-       else if (!os_strncasecmp("GetAPSettings", action, action_len))
-               ret = web_process_get_ap_settings(sm, data, &reply,
-                                                 &replyname);
-       else if (!os_strncasecmp("SetAPSettings", action, action_len))
-               ret = web_process_set_ap_settings(sm, data, &reply,
-                                                 &replyname);
-       else if (!os_strncasecmp("DelAPSettings", action, action_len))
-               ret = web_process_del_ap_settings(sm, data, &reply,
-                                                 &replyname);
-       else if (!os_strncasecmp("GetSTASettings", action, action_len))
-               ret = web_process_get_sta_settings(sm, data, &reply,
-                                                  &replyname);
-       else if (!os_strncasecmp("SetSTASettings", action, action_len))
-               ret = web_process_set_sta_settings(sm, data, &reply,
-                                                  &replyname);
-       else if (!os_strncasecmp("DelSTASettings", action, action_len))
-               ret = web_process_del_sta_settings(sm, data, &reply,
-                                                 &replyname);
        else if (!os_strncasecmp("PutWLANResponse", action, action_len))
                ret = web_process_put_wlan_response(sm, data, &reply,
                                                    &replyname);
        else if (!os_strncasecmp("SetSelectedRegistrar", action, action_len))
                ret = web_process_set_selected_registrar(sm, data, &reply,
                                                         &replyname);
-       else if (!os_strncasecmp("RebootAP", action, action_len))
-               ret = web_process_reboot_ap(sm, data, &reply, &replyname);
-       else if (!os_strncasecmp("ResetAP", action, action_len))
-               ret = web_process_reset_ap(sm, data, &reply, &replyname);
-       else if (!os_strncasecmp("RebootSTA", action, action_len))
-               ret = web_process_reboot_sta(sm, data, &reply, &replyname);
-       else if (!os_strncasecmp("ResetSTA", action, action_len))
-               ret = web_process_reset_sta(sm, data, &reply, &replyname);
        else
                wpa_printf(MSG_INFO, "WPS UPnP: Unknown POST type");