]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Share bootstrap type to string helper function
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 4 Jul 2017 12:45:03 +0000 (15:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 4 Jul 2017 12:45:03 +0000 (15:45 +0300)
This can be used in hostapd as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/dpp.c
src/common/dpp.h
wpa_supplicant/dpp_supplicant.c

index 06e70a105c44c17c8815fbfeeea69735412faeb4..528bdb4a2529a06cd8541dd68399ab09ac741fd3 100644 (file)
@@ -564,6 +564,18 @@ void dpp_bootstrap_info_free(struct dpp_bootstrap_info *info)
 }
 
 
+const char * dpp_bootstrap_type_txt(enum dpp_bootstrap_type type)
+{
+       switch (type) {
+       case DPP_BOOTSTRAP_QR_CODE:
+               return "QRCODE";
+       case DPP_BOOTSTRAP_PKEX:
+               return "PKEX";
+       }
+       return "??";
+}
+
+
 static int dpp_uri_valid_info(const char *info)
 {
        while (*info) {
index d68cd76b57852fb499f7dbe99d1a9c417240a249..8aa78c51c77bb2d7e48b70043ad3e20de461342d 100644 (file)
@@ -210,6 +210,7 @@ struct dpp_introduction {
 };
 
 void dpp_bootstrap_info_free(struct dpp_bootstrap_info *info);
+const char * dpp_bootstrap_type_txt(enum dpp_bootstrap_type type);
 int dpp_bootstrap_key_hash(struct dpp_bootstrap_info *bi);
 int dpp_parse_uri_chan_list(struct dpp_bootstrap_info *bi,
                            const char *chan_list);
index 74233eb231bc1d9c5cb3c341a0d62f978973e953..6361b17dc9ffdb23a1187e3fb00f29212539ade0 100644 (file)
@@ -278,18 +278,6 @@ const char * wpas_dpp_bootstrap_get_uri(struct wpa_supplicant *wpa_s,
 }
 
 
-static const char * wpas_dpp_bootstrap_type(enum dpp_bootstrap_type type)
-{
-       switch (type) {
-       case DPP_BOOTSTRAP_QR_CODE:
-               return "QRCODE";
-       case DPP_BOOTSTRAP_PKEX:
-               return "PKEX";
-       }
-       return "??";
-}
-
-
 int wpas_dpp_bootstrap_info(struct wpa_supplicant *wpa_s, int id,
                            char *reply, int reply_size)
 {
@@ -303,7 +291,7 @@ int wpas_dpp_bootstrap_info(struct wpa_supplicant *wpa_s, int id,
                           "info=%s\n"
                           "num_freq=%u\n"
                           "curve=%s\n",
-                          wpas_dpp_bootstrap_type(bi->type),
+                          dpp_bootstrap_type_txt(bi->type),
                           MAC2STR(bi->mac_addr),
                           bi->info ? bi->info : "",
                           bi->num_freq,