DPP: Share bootstrap type to string helper function
This can be used in hostapd as well. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
623f95685d
commit
484788b875
3 changed files with 14 additions and 13 deletions
|
@ -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)
|
static int dpp_uri_valid_info(const char *info)
|
||||||
{
|
{
|
||||||
while (*info) {
|
while (*info) {
|
||||||
|
|
|
@ -210,6 +210,7 @@ struct dpp_introduction {
|
||||||
};
|
};
|
||||||
|
|
||||||
void dpp_bootstrap_info_free(struct dpp_bootstrap_info *info);
|
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_bootstrap_key_hash(struct dpp_bootstrap_info *bi);
|
||||||
int dpp_parse_uri_chan_list(struct dpp_bootstrap_info *bi,
|
int dpp_parse_uri_chan_list(struct dpp_bootstrap_info *bi,
|
||||||
const char *chan_list);
|
const char *chan_list);
|
||||||
|
|
|
@ -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,
|
int wpas_dpp_bootstrap_info(struct wpa_supplicant *wpa_s, int id,
|
||||||
char *reply, int reply_size)
|
char *reply, int reply_size)
|
||||||
{
|
{
|
||||||
|
@ -303,7 +291,7 @@ int wpas_dpp_bootstrap_info(struct wpa_supplicant *wpa_s, int id,
|
||||||
"info=%s\n"
|
"info=%s\n"
|
||||||
"num_freq=%u\n"
|
"num_freq=%u\n"
|
||||||
"curve=%s\n",
|
"curve=%s\n",
|
||||||
wpas_dpp_bootstrap_type(bi->type),
|
dpp_bootstrap_type_txt(bi->type),
|
||||||
MAC2STR(bi->mac_addr),
|
MAC2STR(bi->mac_addr),
|
||||||
bi->info ? bi->info : "",
|
bi->info ? bi->info : "",
|
||||||
bi->num_freq,
|
bi->num_freq,
|
||||||
|
|
Loading…
Reference in a new issue