• Home
  • Raw
  • Download

Lines Matching refs:sta

34 static void wps_er_sta_event(struct wps_context *wps, struct wps_er_sta *sta,  in wps_er_sta_event()  argument
44 ev->uuid = sta->uuid; in wps_er_sta_event()
45 ev->mac_addr = sta->addr; in wps_er_sta_event()
46 ev->m1_received = sta->m1_received; in wps_er_sta_event()
47 ev->config_methods = sta->config_methods; in wps_er_sta_event()
48 ev->dev_passwd_id = sta->dev_passwd_id; in wps_er_sta_event()
49 ev->pri_dev_type = sta->pri_dev_type; in wps_er_sta_event()
50 ev->dev_name = sta->dev_name; in wps_er_sta_event()
51 ev->manufacturer = sta->manufacturer; in wps_er_sta_event()
52 ev->model_name = sta->model_name; in wps_er_sta_event()
53 ev->model_number = sta->model_number; in wps_er_sta_event()
54 ev->serial_number = sta->serial_number; in wps_er_sta_event()
62 struct wps_er_sta *sta; in wps_er_sta_get() local
63 dl_list_for_each(sta, &ap->sta, struct wps_er_sta, list) { in wps_er_sta_get()
65 os_memcmp(sta->addr, addr, ETH_ALEN) == 0) && in wps_er_sta_get()
67 os_memcmp(uuid, sta->uuid, WPS_UUID_LEN) == 0)) in wps_er_sta_get()
68 return sta; in wps_er_sta_get()
74 static void wps_er_sta_free(struct wps_er_sta *sta) in wps_er_sta_free() argument
76 wps_er_sta_event(sta->ap->er->wps, sta, WPS_EV_ER_ENROLLEE_REMOVE); in wps_er_sta_free()
77 if (sta->wps) in wps_er_sta_free()
78 wps_deinit(sta->wps); in wps_er_sta_free()
79 os_free(sta->manufacturer); in wps_er_sta_free()
80 os_free(sta->model_name); in wps_er_sta_free()
81 os_free(sta->model_number); in wps_er_sta_free()
82 os_free(sta->serial_number); in wps_er_sta_free()
83 os_free(sta->dev_name); in wps_er_sta_free()
84 http_client_free(sta->http); in wps_er_sta_free()
85 eloop_cancel_timeout(wps_er_sta_timeout, sta, NULL); in wps_er_sta_free()
86 os_free(sta->cred); in wps_er_sta_free()
87 os_free(sta); in wps_er_sta_free()
93 struct wps_er_sta *prev, *sta; in wps_er_sta_remove_all() local
94 dl_list_for_each_safe(sta, prev, &ap->sta, struct wps_er_sta, list) in wps_er_sta_remove_all()
95 wps_er_sta_free(sta); in wps_er_sta_remove_all()
654 dl_list_init(&ap->sta); in wps_er_ap_add()
750 struct wps_er_sta *sta = eloop_data; in wps_er_sta_timeout() local
752 dl_list_del(&sta->list); in wps_er_sta_timeout()
753 wps_er_sta_free(sta); in wps_er_sta_timeout()
762 struct wps_er_sta *sta = wps_er_sta_get(ap, addr, NULL); in wps_er_add_sta_data() local
768 if (sta == NULL) { in wps_er_add_sta_data()
777 sta = os_zalloc(sizeof(*sta)); in wps_er_add_sta_data()
778 if (sta == NULL) in wps_er_add_sta_data()
780 os_memcpy(sta->addr, addr, ETH_ALEN); in wps_er_add_sta_data()
781 sta->ap = ap; in wps_er_add_sta_data()
782 dl_list_add(&ap->sta, &sta->list); in wps_er_add_sta_data()
787 sta->m1_received = 1; in wps_er_add_sta_data()
789 if (attr->config_methods && (!probe_req || !sta->m1_received)) in wps_er_add_sta_data()
790 sta->config_methods = WPA_GET_BE16(attr->config_methods); in wps_er_add_sta_data()
791 if (attr->uuid_e && (!probe_req || !sta->m1_received)) in wps_er_add_sta_data()
792 os_memcpy(sta->uuid, attr->uuid_e, WPS_UUID_LEN); in wps_er_add_sta_data()
793 if (attr->primary_dev_type && (!probe_req || !sta->m1_received)) in wps_er_add_sta_data()
794 os_memcpy(sta->pri_dev_type, attr->primary_dev_type, 8); in wps_er_add_sta_data()
795 if (attr->dev_password_id && (!probe_req || !sta->m1_received)) in wps_er_add_sta_data()
796 sta->dev_passwd_id = WPA_GET_BE16(attr->dev_password_id); in wps_er_add_sta_data()
799 os_free(sta->manufacturer); in wps_er_add_sta_data()
800 sta->manufacturer = dup_binstr(attr->manufacturer, in wps_er_add_sta_data()
805 os_free(sta->model_name); in wps_er_add_sta_data()
806 sta->model_name = dup_binstr(attr->model_name, in wps_er_add_sta_data()
811 os_free(sta->model_number); in wps_er_add_sta_data()
812 sta->model_number = dup_binstr(attr->model_number, in wps_er_add_sta_data()
817 os_free(sta->serial_number); in wps_er_add_sta_data()
818 sta->serial_number = dup_binstr(attr->serial_number, in wps_er_add_sta_data()
823 os_free(sta->dev_name); in wps_er_add_sta_data()
824 sta->dev_name = dup_binstr(attr->dev_name, attr->dev_name_len); in wps_er_add_sta_data()
827 eloop_cancel_timeout(wps_er_sta_timeout, sta, NULL); in wps_er_add_sta_data()
828 eloop_register_timeout(300, 0, wps_er_sta_timeout, sta, NULL); in wps_er_add_sta_data()
831 wps_er_sta_event(ap->er->wps, sta, WPS_EV_ER_ENROLLEE_ADD); in wps_er_add_sta_data()
833 return sta; in wps_er_add_sta_data()
868 struct wps_er_sta *sta = ctx; in wps_er_http_put_wlan_response_cb() local
880 http_client_free(sta->http); in wps_er_http_put_wlan_response_cb()
881 sta->http = NULL; in wps_er_http_put_wlan_response_cb()
963 static void wps_er_sta_send_msg(struct wps_er_sta *sta, struct wpabuf *msg) in wps_er_sta_send_msg() argument
970 if (sta->http) { in wps_er_sta_send_msg()
977 if (sta->ap->control_url == NULL) { in wps_er_sta_send_msg()
983 url = http_client_url_parse(sta->ap->control_url, &dst, &path); in wps_er_sta_send_msg()
999 MAC2STR(sta->addr)); in wps_er_sta_send_msg()
1003 sta->http = http_client_addr(&dst, buf, 1000, in wps_er_sta_send_msg()
1004 wps_er_http_put_wlan_response_cb, sta); in wps_er_sta_send_msg()
1005 if (sta->http == NULL) in wps_er_sta_send_msg()
1010 static void wps_er_sta_process(struct wps_er_sta *sta, struct wpabuf *msg, in wps_er_sta_process() argument
1015 res = wps_process_msg(sta->wps, op_code, msg); in wps_er_sta_process()
1017 struct wpabuf *next = wps_get_msg(sta->wps, &op_code); in wps_er_sta_process()
1019 wps_er_sta_send_msg(sta, next); in wps_er_sta_process()
1024 wps_deinit(sta->wps); in wps_er_sta_process()
1025 sta->wps = NULL; in wps_er_sta_process()
1028 eloop_cancel_timeout(wps_er_sta_timeout, sta, NULL); in wps_er_sta_process()
1029 eloop_register_timeout(10, 0, wps_er_sta_timeout, sta, in wps_er_sta_process()
1036 static void wps_er_sta_start(struct wps_er_sta *sta, struct wpabuf *msg) in wps_er_sta_start() argument
1040 if (sta->wps) in wps_er_sta_start()
1041 wps_deinit(sta->wps); in wps_er_sta_start()
1044 cfg.wps = sta->ap->er->wps; in wps_er_sta_start()
1046 cfg.peer_addr = sta->addr; in wps_er_sta_start()
1048 sta->wps = wps_init(&cfg); in wps_er_sta_start()
1049 if (sta->wps == NULL) in wps_er_sta_start()
1051 sta->wps->er = 1; in wps_er_sta_start()
1052 sta->wps->use_cred = sta->ap->ap_settings; in wps_er_sta_start()
1053 if (sta->ap->ap_settings) { in wps_er_sta_start()
1054 os_free(sta->cred); in wps_er_sta_start()
1055 sta->cred = os_malloc(sizeof(*sta->cred)); in wps_er_sta_start()
1056 if (sta->cred) { in wps_er_sta_start()
1057 os_memcpy(sta->cred, sta->ap->ap_settings, in wps_er_sta_start()
1058 sizeof(*sta->cred)); in wps_er_sta_start()
1059 sta->cred->cred_attr = NULL; in wps_er_sta_start()
1060 os_memcpy(sta->cred->mac_addr, sta->addr, ETH_ALEN); in wps_er_sta_start()
1061 sta->wps->use_cred = sta->cred; in wps_er_sta_start()
1065 wps_er_sta_process(sta, msg, WSC_MSG); in wps_er_sta_start()
1073 struct wps_er_sta *sta; in wps_er_process_wlanevent_eap() local
1086 sta = wps_er_add_sta_data(ap, addr, &attr, 0); in wps_er_process_wlanevent_eap()
1087 if (sta == NULL) in wps_er_process_wlanevent_eap()
1091 wps_er_sta_start(sta, msg); in wps_er_process_wlanevent_eap()
1092 else if (sta->wps) { in wps_er_process_wlanevent_eap()
1107 wps_er_sta_process(sta, msg, op_code); in wps_er_process_wlanevent_eap()
1334 struct wps_er_sta *sta; in wps_er_refresh() local
1338 dl_list_for_each(sta, &ap->sta, struct wps_er_sta, list) in wps_er_refresh()
1339 wps_er_sta_event(er->wps, sta, WPS_EV_ER_ENROLLEE_ADD); in wps_er_refresh()
1580 struct wps_er_sta *sta = NULL; in wps_er_pbc() local
1582 sta = wps_er_sta_get(ap, addr, uuid); in wps_er_pbc()
1583 if (sta) { in wps_er_pbc()
1588 if (sta == NULL) in wps_er_pbc()
1632 struct wps_er_sta *sta; in wps_er_get_sta_uuid() local
1633 sta = wps_er_sta_get(ap, addr, NULL); in wps_er_get_sta_uuid()
1634 if (sta) in wps_er_get_sta_uuid()
1635 return sta->uuid; in wps_er_get_sta_uuid()