Lines Matching defs:dpp
26 #include "dpp.h"
769 dpp_alloc_auth(struct dpp_global *dpp, void *msg_ctx)
776 auth->global = dpp;
1082 else if (bin_str_eq(type, len, "sae-dpp") ||
1083 bin_str_eq(type, len, "dpp+sae"))
1085 else if (bin_str_eq(type, len, "psk-sae-dpp") ||
1086 bin_str_eq(type, len, "dpp+psk+sae"))
1088 else if (bin_str_eq(type, len, "dpp"))
1369 dpp_configurator_get_id(struct dpp_global *dpp, unsigned int id)
1373 if (!dpp)
1376 dl_list_for_each(conf, &dpp->configurator,
3046 return "dpp";
3054 return "dpp+sae";
3056 return "dpp+psk+sae";
3091 int dpp = 0, psk = 0, sae = 0, dot1x = 0;
3099 if (os_strcmp(akm, "dpp") == 0)
3101 if (os_strcmp(akm, "dpp+sae") == 0)
3103 if (os_strcmp(akm, "dpp+psk+sae") == 0)
3113 dpp = 1;
3130 if (dpp && psk && sae)
3132 if (dpp && sae)
3134 if (dpp)
4320 unsigned int dpp_next_id(struct dpp_global *dpp)
4325 dl_list_for_each(bi, &dpp->bootstrap, struct dpp_bootstrap_info, list) {
4333 static int dpp_bootstrap_del(struct dpp_global *dpp, unsigned int id)
4338 if (!dpp)
4341 dl_list_for_each_safe(bi, tmp, &dpp->bootstrap,
4347 if (dpp->remove_bi)
4348 dpp->remove_bi(dpp->cb_ctx, bi);
4360 struct dpp_bootstrap_info * dpp_add_qr_code(struct dpp_global *dpp,
4365 if (!dpp)
4373 bi->id = dpp_next_id(dpp);
4374 dl_list_add(&dpp->bootstrap, &bi->list);
4379 struct dpp_bootstrap_info * dpp_add_nfc_uri(struct dpp_global *dpp,
4384 if (!dpp)
4392 bi->id = dpp_next_id(dpp);
4393 dl_list_add(&dpp->bootstrap, &bi->list);
4435 int dpp_bootstrap_gen(struct dpp_global *dpp, const char *cmd)
4444 if (!dpp)
4485 bi->id = dpp_next_id(dpp);
4486 dl_list_add(&dpp->bootstrap, &bi->list);
4503 dpp_bootstrap_get_id(struct dpp_global *dpp, unsigned int id)
4507 if (!dpp)
4510 dl_list_for_each(bi, &dpp->bootstrap, struct dpp_bootstrap_info, list) {
4518 int dpp_bootstrap_remove(struct dpp_global *dpp, const char *id)
4530 return dpp_bootstrap_del(dpp, id_val);
4534 const char * dpp_bootstrap_get_uri(struct dpp_global *dpp, unsigned int id)
4538 bi = dpp_bootstrap_get_id(dpp, id);
4545 int dpp_bootstrap_info(struct dpp_global *dpp, int id,
4554 bi = dpp_bootstrap_get_id(dpp, id);
4620 int dpp_bootstrap_set(struct dpp_global *dpp, int id, const char *params)
4624 bi = dpp_bootstrap_get_id(dpp, id);
4640 void dpp_bootstrap_find_pair(struct dpp_global *dpp, const u8 *i_bootstrap,
4649 if (!dpp)
4652 dl_list_for_each(bi, &dpp->bootstrap, struct dpp_bootstrap_info, list) {
4676 struct dpp_bootstrap_info * dpp_bootstrap_find_chirp(struct dpp_global *dpp,
4681 if (!dpp)
4684 dl_list_for_each(bi, &dpp->bootstrap, struct dpp_bootstrap_info, list) {
4777 static unsigned int dpp_next_configurator_id(struct dpp_global *dpp)
4782 dl_list_for_each(conf, &dpp->configurator, struct dpp_configurator,
4791 int dpp_configurator_add(struct dpp_global *dpp, const char *cmd)
4839 conf->id = dpp_next_configurator_id(dpp);
4840 dl_list_add(&dpp->configurator, &conf->list);
4854 int dpp_configurator_set(struct dpp_global *dpp, const char *cmd)
4861 conf = dpp_configurator_get_id(dpp, id);
4880 static int dpp_configurator_del(struct dpp_global *dpp, unsigned int id)
4885 if (!dpp)
4888 dl_list_for_each_safe(conf, tmp, &dpp->configurator,
4903 int dpp_configurator_remove(struct dpp_global *dpp, const char *id)
4915 return dpp_configurator_del(dpp, id_val);
4919 int dpp_configurator_get_key_id(struct dpp_global *dpp, unsigned int id,
4924 conf = dpp_configurator_get_id(dpp, id);
4934 int dpp_configurator_from_backup(struct dpp_global *dpp,
4975 conf->id = dpp_next_configurator_id(dpp);
4976 dl_list_add(&dpp->configurator, &conf->list);
4981 struct dpp_configurator * dpp_configurator_find_kid(struct dpp_global *dpp,
4986 if (!dpp)
4989 dl_list_for_each(conf, &dpp->configurator,
5002 struct dpp_global *dpp;
5004 dpp = os_zalloc(sizeof(*dpp));
5005 if (!dpp)
5008 dpp->cb_ctx = config->cb_ctx;
5009 dpp->remove_bi = config->remove_bi;
5012 dl_list_init(&dpp->bootstrap);
5013 dl_list_init(&dpp->configurator);
5015 dl_list_init(&dpp->controllers);
5016 dl_list_init(&dpp->tcp_init);
5017 dpp->relay_sock = -1;
5020 return dpp;
5024 void dpp_global_clear(struct dpp_global *dpp)
5026 if (!dpp)
5029 dpp_bootstrap_del(dpp, 0);
5030 dpp_configurator_del(dpp, 0);
5032 dpp_tcp_init_flush(dpp);
5033 dpp_relay_flush_controllers(dpp);
5034 dpp_controller_stop(dpp);
5039 void dpp_global_deinit(struct dpp_global *dpp)
5041 dpp_global_clear(dpp);
5042 os_free(dpp);