Lines Matching refs:hk

50 static int wpa_config_read_blobs(struct wpa_config *config, HKEY hk)  in wpa_config_read_blobs()  argument
58 ret = RegOpenKeyEx(hk, TEXT("blobs"), 0, KEY_QUERY_VALUE, &bhk); in wpa_config_read_blobs()
119 static int wpa_config_read_reg_dword(HKEY hk, const TCHAR *name, int *_val) in wpa_config_read_reg_dword() argument
125 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) &val, &buflen); in wpa_config_read_reg_dword()
136 static char * wpa_config_read_reg_string(HKEY hk, const TCHAR *name) in wpa_config_read_reg_string() argument
143 ret = RegQueryValueEx(hk, name, NULL, NULL, NULL, &buflen); in wpa_config_read_reg_string()
150 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) val, &buflen); in wpa_config_read_reg_string()
163 static int wpa_config_read_global_uuid(struct wpa_config *config, HKEY hk) in wpa_config_read_global_uuid() argument
168 str = wpa_config_read_reg_string(hk, TEXT("uuid")); in wpa_config_read_global_uuid()
182 HKEY hk) in wpa_config_read_global_os_version() argument
187 str = wpa_config_read_reg_string(hk, TEXT("os_version")); in wpa_config_read_global_os_version()
201 static int wpa_config_read_global(struct wpa_config *config, HKEY hk) in wpa_config_read_global() argument
206 wpa_config_read_reg_dword(hk, TEXT("ap_scan"), &config->ap_scan); in wpa_config_read_global()
207 wpa_config_read_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_read_global()
209 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_read_global()
211 wpa_config_read_reg_dword(hk, in wpa_config_read_global()
215 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_read_global()
217 wpa_config_read_reg_dword(hk, TEXT("update_config"), in wpa_config_read_global()
220 if (wpa_config_read_reg_dword(hk, TEXT("eapol_version"), in wpa_config_read_global()
231 hk, TEXT("ctrl_interface")); in wpa_config_read_global()
234 if (wpa_config_read_global_uuid(config, hk)) in wpa_config_read_global()
236 wpa_config_read_reg_dword(hk, TEXT("auto_uuid"), &config->auto_uuid); in wpa_config_read_global()
238 hk, TEXT("device_name")); in wpa_config_read_global()
240 hk, TEXT("manufacturer")); in wpa_config_read_global()
242 hk, TEXT("model_name")); in wpa_config_read_global()
244 hk, TEXT("serial_number")); in wpa_config_read_global()
247 hk, TEXT("device_type")); in wpa_config_read_global()
253 hk, TEXT("config_methods")); in wpa_config_read_global()
254 if (wpa_config_read_global_os_version(config, hk)) in wpa_config_read_global()
256 wpa_config_read_reg_dword(hk, TEXT("wps_cred_processing"), in wpa_config_read_global()
258 wpa_config_read_reg_dword(hk, TEXT("wps_cred_add_sae"), in wpa_config_read_global()
263 hk, TEXT("p2p_ssid_postfix")); in wpa_config_read_global()
264 wpa_config_read_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_read_global()
268 wpa_config_read_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_read_global()
270 wpa_config_read_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_read_global()
272 wpa_config_read_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_read_global()
274 wpa_config_read_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_read_global()
277 wpa_config_read_reg_dword(hk, TEXT("okc"), &config->okc); in wpa_config_read_global()
278 wpa_config_read_reg_dword(hk, TEXT("pmf"), &val); in wpa_config_read_global()
280 if (wpa_config_read_reg_dword(hk, TEXT("extended_key_id"), in wpa_config_read_global()
294 static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw, in wpa_config_read_network() argument
303 ret = RegOpenKeyEx(hk, netw, 0, KEY_QUERY_VALUE, &nhk); in wpa_config_read_network()
383 static int wpa_config_read_networks(struct wpa_config *config, HKEY hk) in wpa_config_read_networks() argument
391 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_ENUMERATE_SUB_KEYS, in wpa_config_read_networks()
455 HKEY hk; in wpa_config_read() local
474 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_QUERY_VALUE, &hk); in wpa_config_read()
482 if (wpa_config_read_global(config, hk)) in wpa_config_read()
485 if (wpa_config_read_networks(config, hk)) in wpa_config_read()
488 if (wpa_config_read_blobs(config, hk)) in wpa_config_read()
493 RegCloseKey(hk); in wpa_config_read()
504 static int wpa_config_write_reg_dword(HKEY hk, const TCHAR *name, int val, in wpa_config_write_reg_dword() argument
511 RegDeleteValue(hk, name); in wpa_config_write_reg_dword()
515 ret = RegSetValueEx(hk, name, 0, REG_DWORD, (LPBYTE) &_val, in wpa_config_write_reg_dword()
527 static int wpa_config_write_reg_string(HKEY hk, const char *name, in wpa_config_write_reg_string() argument
538 RegDeleteValue(hk, _name); in wpa_config_write_reg_string()
548 ret = RegSetValueEx(hk, _name, 0, REG_SZ, (BYTE *) _val, in wpa_config_write_reg_string()
564 static int wpa_config_write_global(struct wpa_config *config, HKEY hk) in wpa_config_write_global() argument
567 wpa_config_write_reg_string(hk, "ctrl_interface", in wpa_config_write_global()
571 wpa_config_write_reg_dword(hk, TEXT("eapol_version"), in wpa_config_write_global()
574 wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan, in wpa_config_write_global()
576 wpa_config_write_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_write_global()
578 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_write_global()
580 wpa_config_write_reg_dword(hk, in wpa_config_write_global()
584 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_write_global()
586 wpa_config_write_reg_dword(hk, TEXT("update_config"), in wpa_config_write_global()
593 wpa_config_write_reg_string(hk, "uuid", buf); in wpa_config_write_global()
595 wpa_config_write_reg_dword(hk, TEXT("auto_uuid"), config->auto_uuid, in wpa_config_write_global()
597 wpa_config_write_reg_string(hk, "device_name", config->device_name); in wpa_config_write_global()
598 wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer); in wpa_config_write_global()
599 wpa_config_write_reg_string(hk, "model_name", config->model_name); in wpa_config_write_global()
600 wpa_config_write_reg_string(hk, "model_number", config->model_number); in wpa_config_write_global()
601 wpa_config_write_reg_string(hk, "serial_number", in wpa_config_write_global()
607 wpa_config_write_reg_string(hk, "device_type", buf); in wpa_config_write_global()
609 wpa_config_write_reg_string(hk, "config_methods", in wpa_config_write_global()
615 wpa_config_write_reg_string(hk, "os_version", vbuf); in wpa_config_write_global()
617 wpa_config_write_reg_dword(hk, TEXT("wps_cred_processing"), in wpa_config_write_global()
619 wpa_config_write_reg_dword(hk, TEXT("wps_cred_add_sae"), in wpa_config_write_global()
623 wpa_config_write_reg_string(hk, "p2p_ssid_postfix", in wpa_config_write_global()
625 wpa_config_write_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_write_global()
629 wpa_config_write_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_write_global()
632 wpa_config_write_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_write_global()
634 wpa_config_write_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_write_global()
636 wpa_config_write_reg_dword(hk, TEXT("ap_isolate"), in wpa_config_write_global()
638 wpa_config_write_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_write_global()
641 wpa_config_write_reg_dword(hk, TEXT("okc"), config->okc, 0); in wpa_config_write_global()
642 wpa_config_write_reg_dword(hk, TEXT("pmf"), config->pmf, 0); in wpa_config_write_global()
644 wpa_config_write_reg_dword(hk, TEXT("external_sim"), in wpa_config_write_global()
651 static int wpa_config_delete_subkeys(HKEY hk, const TCHAR *key) in wpa_config_delete_subkeys() argument
657 ret = RegOpenKeyEx(hk, key, 0, KEY_ENUMERATE_SUB_KEYS | DELETE, &nhk); in wpa_config_delete_subkeys()
700 static void write_str(HKEY hk, const char *field, struct wpa_ssid *ssid) in write_str() argument
705 wpa_config_write_reg_string(hk, field, value); in write_str()
710 static void write_int(HKEY hk, const char *field, int value, int def) in write_int() argument
716 wpa_config_write_reg_string(hk, field, val); in write_int()
720 static void write_bssid(HKEY hk, struct wpa_ssid *ssid) in write_bssid() argument
725 wpa_config_write_reg_string(hk, "bssid", value); in write_bssid()
730 static void write_psk(HKEY hk, struct wpa_ssid *ssid) in write_psk() argument
735 wpa_config_write_reg_string(hk, "psk", value); in write_psk()
740 static void write_proto(HKEY hk, struct wpa_ssid *ssid) in write_proto() argument
751 wpa_config_write_reg_string(hk, "proto", value); in write_proto()
756 static void write_key_mgmt(HKEY hk, struct wpa_ssid *ssid) in write_key_mgmt() argument
767 wpa_config_write_reg_string(hk, "key_mgmt", value); in write_key_mgmt()
772 static void write_pairwise(HKEY hk, struct wpa_ssid *ssid) in write_pairwise() argument
783 wpa_config_write_reg_string(hk, "pairwise", value); in write_pairwise()
788 static void write_group(HKEY hk, struct wpa_ssid *ssid) in write_group() argument
799 wpa_config_write_reg_string(hk, "group", value); in write_group()
804 static void write_auth_alg(HKEY hk, struct wpa_ssid *ssid) in write_auth_alg() argument
815 wpa_config_write_reg_string(hk, "auth_alg", value); in write_auth_alg()
821 static void write_eap(HKEY hk, struct wpa_ssid *ssid) in write_eap() argument
830 wpa_config_write_reg_string(hk, "eap", value); in write_eap()
837 static void write_wep_key(HKEY hk, int idx, struct wpa_ssid *ssid) in write_wep_key() argument
844 wpa_config_write_reg_string(hk, field, value); in write_wep_key()
851 static int wpa_config_write_network(HKEY hk, struct wpa_ssid *ssid, int id) in wpa_config_write_network() argument
858 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_CREATE_SUB_KEY, &nhk); in wpa_config_write_network()
975 static int wpa_config_write_blob(HKEY hk, struct wpa_config_blob *blob) in wpa_config_write_blob() argument
981 ret = RegCreateKeyEx(hk, TEXT("blobs"), 0, NULL, 0, KEY_WRITE, NULL, in wpa_config_write_blob()
1012 HKEY hk; in wpa_config_write() local
1027 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_SET_VALUE | DELETE, &hk); in wpa_config_write()
1035 if (wpa_config_write_global(config, hk)) { in wpa_config_write()
1041 wpa_config_delete_subkeys(hk, TEXT("networks")); in wpa_config_write()
1045 if (wpa_config_write_network(hk, ssid, id)) in wpa_config_write()
1049 RegDeleteKey(hk, TEXT("blobs")); in wpa_config_write()
1051 if (wpa_config_write_blob(hk, blob)) in wpa_config_write()
1055 RegCloseKey(hk); in wpa_config_write()