Lines Matching refs:entry
32 static int wpas_dbus_validate_dbus_ipaddr(struct wpa_dbus_dict_entry entry)
34 if (entry.type != DBUS_TYPE_ARRAY ||
35 entry.array_type != DBUS_TYPE_BYTE ||
36 entry.array_len != 4)
84 struct wpa_dbus_dict_entry entry;
96 entry.key = NULL;
102 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
105 if (os_strcmp(entry.key, "Timeout") == 0 &&
106 entry.type == DBUS_TYPE_INT32) {
107 timeout = entry.uint32_value;
108 } else if (os_strcmp(entry.key, "RequestedDeviceTypes") == 0) {
109 if (entry.type != DBUS_TYPE_ARRAY ||
110 entry.array_type != WPAS_DBUS_TYPE_BINARRAY)
115 os_malloc(WPS_DEV_TYPE_LEN * entry.array_len);
119 for (i = 0; i < entry.array_len; i++) {
120 if (wpabuf_len(entry.binarray_value[i]) !=
124 wpabuf_head(entry.binarray_value[i]),
127 num_req_dev_types = entry.array_len;
128 } else if (os_strcmp(entry.key, "DiscoveryType") == 0 &&
129 entry.type == DBUS_TYPE_STRING) {
130 if (os_strcmp(entry.str_value, "start_with_full") == 0)
132 else if (os_strcmp(entry.str_value, "social") == 0)
134 else if (os_strcmp(entry.str_value, "progressive") == 0)
138 } else if (os_strcmp(entry.key, "freq") == 0 &&
139 (entry.type == DBUS_TYPE_INT32 ||
140 entry.type == DBUS_TYPE_UINT32)) {
141 freq = entry.uint32_value;
144 wpa_dbus_dict_entry_clear(&entry);
158 wpa_dbus_dict_entry_clear(&entry);
161 reply = wpas_dbus_error_invalid_args(message, entry.key);
222 struct wpa_dbus_dict_entry entry;
227 entry.key = NULL;
233 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
236 if (os_strcmp(entry.key, "period") == 0 &&
237 entry.type == DBUS_TYPE_INT32)
238 period = entry.uint32_value;
239 else if (os_strcmp(entry.key, "interval") == 0 &&
240 entry.type == DBUS_TYPE_INT32)
241 interval = entry.uint32_value;
244 wpa_dbus_dict_entry_clear(&entry);
256 wpa_dbus_dict_entry_clear(&entry);
258 return wpas_dbus_error_invalid_args(message, entry.key);
266 struct wpa_dbus_dict_entry entry;
271 entry.key = NULL;
277 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
280 if (os_strcmp(entry.key, "duration1") == 0 &&
281 entry.type == DBUS_TYPE_INT32)
282 dur1 = entry.uint32_value;
283 else if (os_strcmp(entry.key, "interval1") == 0 &&
284 entry.type == DBUS_TYPE_INT32)
285 int1 = entry.uint32_value;
286 else if (os_strcmp(entry.key, "duration2") == 0 &&
287 entry.type == DBUS_TYPE_INT32)
288 dur2 = entry.uint32_value;
289 else if (os_strcmp(entry.key, "interval2") == 0 &&
290 entry.type == DBUS_TYPE_INT32)
291 int2 = entry.uint32_value;
295 wpa_dbus_dict_entry_clear(&entry);
305 wpa_dbus_dict_entry_clear(&entry);
307 return wpas_dbus_error_invalid_args(message, entry.key);
317 struct wpa_dbus_dict_entry entry;
331 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
334 if (os_strcmp(entry.key, "persistent") == 0 &&
335 entry.type == DBUS_TYPE_BOOLEAN) {
336 persistent_group = entry.bool_value;
337 } else if (os_strcmp(entry.key, "frequency") == 0 &&
338 entry.type == DBUS_TYPE_INT32) {
339 freq = entry.int32_value;
342 } else if (os_strcmp(entry.key, "persistent_group_object") ==
344 entry.type == DBUS_TYPE_OBJECT_PATH)
345 pg_object_path = os_strdup(entry.str_value);
349 wpa_dbus_dict_entry_clear(&entry);
402 wpa_dbus_dict_entry_clear(&entry);
446 struct wpa_dbus_dict_entry entry;
460 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
463 if (os_strcmp(entry.key, "peer") == 0 &&
464 entry.type == DBUS_TYPE_OBJECT_PATH) {
466 peer_object_path = os_strdup(entry.str_value);
467 wpa_dbus_dict_entry_clear(&entry);
468 } else if (os_strcmp(entry.key, "iface") == 0 &&
469 entry.type == DBUS_TYPE_STRING) {
471 interface_addr = os_strdup(entry.str_value);
472 wpa_dbus_dict_entry_clear(&entry);
474 wpa_dbus_dict_entry_clear(&entry);
523 struct wpa_dbus_dict_entry entry;
547 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
550 if (os_strcmp(entry.key, "peer") == 0 &&
551 entry.type == DBUS_TYPE_OBJECT_PATH) {
552 peer_object_path = os_strdup(entry.str_value);
553 } else if (os_strcmp(entry.key, "persistent") == 0 &&
554 entry.type == DBUS_TYPE_BOOLEAN) {
555 persistent_group = entry.bool_value;
556 } else if (os_strcmp(entry.key, "join") == 0 &&
557 entry.type == DBUS_TYPE_BOOLEAN) {
558 join = entry.bool_value;
559 } else if (os_strcmp(entry.key, "authorize_only") == 0 &&
560 entry.type == DBUS_TYPE_BOOLEAN) {
561 authorize_only = entry.bool_value;
562 } else if (os_strcmp(entry.key, "frequency") == 0 &&
563 entry.type == DBUS_TYPE_INT32) {
564 freq = entry.int32_value;
567 } else if (os_strcmp(entry.key, "go_intent") == 0 &&
568 entry.type == DBUS_TYPE_INT32) {
569 go_intent = entry.int32_value;
572 } else if (os_strcmp(entry.key, "wps_method") == 0 &&
573 entry.type == DBUS_TYPE_STRING) {
574 if (os_strcmp(entry.str_value, "pbc") == 0)
576 else if (os_strcmp(entry.str_value, "pin") == 0)
578 else if (os_strcmp(entry.str_value, "display") == 0)
580 else if (os_strcmp(entry.str_value, "keypad") == 0)
584 } else if (os_strcmp(entry.key, "pin") == 0 &&
585 entry.type == DBUS_TYPE_STRING) {
586 pin = os_strdup(entry.str_value);
590 wpa_dbus_dict_entry_clear(&entry);
658 wpa_dbus_dict_entry_clear(&entry);
691 struct wpa_dbus_dict_entry entry;
709 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
712 if (os_strcmp(entry.key, "peer") == 0 &&
713 entry.type == DBUS_TYPE_OBJECT_PATH) {
714 peer_object_path = os_strdup(entry.str_value);
715 wpa_dbus_dict_entry_clear(&entry);
716 } else if (os_strcmp(entry.key, "persistent_group_object") ==
718 entry.type == DBUS_TYPE_OBJECT_PATH) {
719 pg_object_path = os_strdup(entry.str_value);
721 wpa_dbus_dict_entry_clear(&entry);
723 wpa_dbus_dict_entry_clear(&entry);
983 struct wpa_dbus_dict_entry entry = {.type = DBUS_TYPE_STRING };
996 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) {
1002 if (os_strcmp(entry.key, "DeviceName") == 0) {
1005 if (entry.type != DBUS_TYPE_STRING ||
1006 os_strlen(entry.str_value) > WPS_DEV_NAME_MAX_LEN)
1009 devname = os_strdup(entry.str_value);
1018 } else if (os_strcmp(entry.key, "PrimaryDeviceType") == 0) {
1019 if (entry.type != DBUS_TYPE_ARRAY ||
1020 entry.array_type != DBUS_TYPE_BYTE ||
1021 entry.array_len != WPS_DEV_TYPE_LEN)
1025 entry.bytearray_value,
1029 } else if (os_strcmp(entry.key, "SecondaryDeviceTypes") == 0) {
1030 if (entry.type != DBUS_TYPE_ARRAY ||
1031 entry.array_type != WPAS_DBUS_TYPE_BINARRAY ||
1032 entry.array_len > MAX_SEC_DEVICE_TYPES)
1035 for (i = 0; i < entry.array_len; i++)
1036 if (wpabuf_len(entry.binarray_value[i]) !=
1039 for (i = 0; i < entry.array_len; i++)
1041 wpabuf_head(entry.binarray_value[i]),
1043 wpa_s->conf->num_sec_device_types = entry.array_len;
1046 } else if (os_strcmp(entry.key, "VendorExtension") == 0) {
1047 if (entry.type != DBUS_TYPE_ARRAY ||
1048 entry.array_type != WPAS_DBUS_TYPE_BINARRAY ||
1049 (entry.array_len > P2P_MAX_WPS_VENDOR_EXT))
1057 if (i < entry.array_len) {
1059 entry.binarray_value[i];
1060 entry.binarray_value[i] = NULL;
1064 } else if (os_strcmp(entry.key, "GOIntent") == 0 &&
1065 entry.type == DBUS_TYPE_UINT32 &&
1066 (entry.uint32_value <= 15))
1067 wpa_s->conf->p2p_go_intent = entry.uint32_value;
1068 else if (os_strcmp(entry.key, "PersistentReconnect") == 0 &&
1069 entry.type == DBUS_TYPE_BOOLEAN)
1070 wpa_s->conf->persistent_reconnect = entry.bool_value;
1071 else if (os_strcmp(entry.key, "ListenRegClass") == 0 &&
1072 entry.type == DBUS_TYPE_UINT32) {
1073 wpa_s->conf->p2p_listen_reg_class = entry.uint32_value;
1076 } else if (os_strcmp(entry.key, "ListenChannel") == 0 &&
1077 entry.type == DBUS_TYPE_UINT32) {
1078 wpa_s->conf->p2p_listen_channel = entry.uint32_value;
1081 } else if (os_strcmp(entry.key, "OperRegClass") == 0 &&
1082 entry.type == DBUS_TYPE_UINT32) {
1083 wpa_s->conf->p2p_oper_reg_class = entry.uint32_value;
1086 } else if (os_strcmp(entry.key, "OperChannel") == 0 &&
1087 entry.type == DBUS_TYPE_UINT32) {
1088 wpa_s->conf->p2p_oper_channel = entry.uint32_value;
1091 } else if (os_strcmp(entry.key, "SsidPostfix") == 0) {
1094 if (entry.type != DBUS_TYPE_STRING)
1097 postfix = os_strdup(entry.str_value);
1106 } else if (os_strcmp(entry.key, "IntraBss") == 0 &&
1107 entry.type == DBUS_TYPE_BOOLEAN) {
1108 wpa_s->conf->p2p_intra_bss = entry.bool_value;
1111 } else if (os_strcmp(entry.key, "IpAddrGo") == 0) {
1112 if (!wpas_dbus_validate_dbus_ipaddr(entry))
1115 entry.bytearray_value, 4);
1116 } else if (os_strcmp(entry.key, "IpAddrMask") == 0) {
1117 if (!wpas_dbus_validate_dbus_ipaddr(entry))
1120 entry.bytearray_value, 4);
1121 } else if (os_strcmp(entry.key, "IpAddrStart") == 0) {
1122 if (!wpas_dbus_validate_dbus_ipaddr(entry))
1125 entry.bytearray_value, 4);
1126 } else if (os_strcmp(entry.key, "IpAddrEnd") == 0) {
1127 if (!wpas_dbus_validate_dbus_ipaddr(entry))
1130 entry.bytearray_value, 4);
1131 } else if (os_strcmp(entry.key, "GroupIdle") == 0 &&
1132 entry.type == DBUS_TYPE_UINT32)
1133 wpa_s->conf->p2p_group_idle = entry.uint32_value;
1134 else if (os_strcmp(entry.key, "disassoc_low_ack") == 0 &&
1135 entry.type == DBUS_TYPE_UINT32)
1136 wpa_s->conf->disassoc_low_ack = entry.uint32_value;
1137 else if (os_strcmp(entry.key, "NoGroupIface") == 0 &&
1138 entry.type == DBUS_TYPE_BOOLEAN)
1139 wpa_s->conf->p2p_no_group_iface = entry.bool_value;
1140 else if (os_strcmp(entry.key, "p2p_search_delay") == 0 &&
1141 entry.type == DBUS_TYPE_UINT32)
1142 wpa_s->conf->p2p_search_delay = entry.uint32_value;
1146 wpa_dbus_dict_entry_clear(&entry);
1159 wpa_dbus_dict_entry_clear(&entry);
1164 wpa_dbus_dict_entry_clear(&entry);
2462 struct wpa_dbus_dict_entry entry = { .type = DBUS_TYPE_STRING };
2553 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) {
2559 if (os_strcmp(entry.key, "WPSVendorExtensions") == 0) {
2560 if (entry.type != DBUS_TYPE_ARRAY ||
2561 entry.array_type != WPAS_DBUS_TYPE_BINARRAY ||
2562 entry.array_len > MAX_WPS_VENDOR_EXTENSIONS)
2567 if (i < entry.array_len) {
2569 entry.binarray_value[i];
2570 entry.binarray_value[i] = NULL;
2579 wpa_dbus_dict_entry_clear(&entry);
2585 wpa_dbus_dict_entry_clear(&entry);
2598 struct wpa_dbus_dict_entry entry;
2612 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
2615 if (os_strcmp(entry.key, "service_type") == 0 &&
2616 entry.type == DBUS_TYPE_STRING) {
2617 if (os_strcmp(entry.str_value, "upnp") == 0)
2619 else if (os_strcmp(entry.str_value, "bonjour") == 0)
2623 } else if (os_strcmp(entry.key, "version") == 0 &&
2624 entry.type == DBUS_TYPE_INT32) {
2625 version = entry.uint32_value;
2626 } else if (os_strcmp(entry.key, "service") == 0 &&
2627 entry.type == DBUS_TYPE_STRING) {
2629 service = os_strdup(entry.str_value);
2630 } else if (os_strcmp(entry.key, "query") == 0) {
2631 if (entry.type != DBUS_TYPE_ARRAY ||
2632 entry.array_type != DBUS_TYPE_BYTE)
2635 entry.bytearray_value,
2636 entry.array_len);
2637 } else if (os_strcmp(entry.key, "response") == 0) {
2638 if (entry.type != DBUS_TYPE_ARRAY ||
2639 entry.array_type != DBUS_TYPE_BYTE)
2641 resp = wpabuf_alloc_copy(entry.bytearray_value,
2642 entry.array_len);
2644 wpa_dbus_dict_entry_clear(&entry);
2668 wpa_dbus_dict_entry_clear(&entry);
2683 struct wpa_dbus_dict_entry entry;
2697 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
2700 if (os_strcmp(entry.key, "service_type") == 0 &&
2701 entry.type == DBUS_TYPE_STRING) {
2702 if (os_strcmp(entry.str_value, "upnp") == 0)
2704 else if (os_strcmp(entry.str_value, "bonjour") == 0)
2708 } else if (os_strcmp(entry.key, "version") == 0 &&
2709 entry.type == DBUS_TYPE_INT32) {
2710 version = entry.uint32_value;
2711 } else if (os_strcmp(entry.key, "service") == 0 &&
2712 entry.type == DBUS_TYPE_STRING) {
2714 service = os_strdup(entry.str_value);
2715 } else if (os_strcmp(entry.key, "query") == 0) {
2716 if (entry.type != DBUS_TYPE_ARRAY ||
2717 entry.array_type != DBUS_TYPE_BYTE)
2720 query = wpabuf_alloc_copy(entry.bytearray_value,
2721 entry.array_len);
2726 wpa_dbus_dict_entry_clear(&entry);
2749 wpa_dbus_dict_entry_clear(&entry);
2771 struct wpa_dbus_dict_entry entry;
2786 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
2788 if (os_strcmp(entry.key, "peer_object") == 0 &&
2789 entry.type == DBUS_TYPE_OBJECT_PATH) {
2790 peer_object_path = os_strdup(entry.str_value);
2791 } else if (os_strcmp(entry.key, "service_type") == 0 &&
2792 entry.type == DBUS_TYPE_STRING) {
2793 if (os_strcmp(entry.str_value, "upnp") == 0)
2797 } else if (os_strcmp(entry.key, "version") == 0 &&
2798 entry.type == DBUS_TYPE_INT32) {
2799 version = entry.uint32_value;
2800 } else if (os_strcmp(entry.key, "service") == 0 &&
2801 entry.type == DBUS_TYPE_STRING) {
2802 service = os_strdup(entry.str_value);
2803 } else if (os_strcmp(entry.key, "tlv") == 0) {
2804 if (entry.type != DBUS_TYPE_ARRAY ||
2805 entry.array_type != DBUS_TYPE_BYTE)
2807 tlv = wpabuf_alloc_copy(entry.bytearray_value,
2808 entry.array_len);
2812 wpa_dbus_dict_entry_clear(&entry);
2850 wpa_dbus_dict_entry_clear(&entry);
2865 struct wpa_dbus_dict_entry entry;
2878 if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
2881 if (os_strcmp(entry.key, "peer_object") == 0 &&
2882 entry.type == DBUS_TYPE_OBJECT_PATH) {
2883 peer_object_path = os_strdup(entry.str_value);
2884 } else if (os_strcmp(entry.key, "frequency") == 0 &&
2885 entry.type == DBUS_TYPE_INT32) {
2886 freq = entry.uint32_value;
2887 } else if (os_strcmp(entry.key, "dialog_token") == 0 &&
2888 (entry.type == DBUS_TYPE_UINT32 ||
2889 entry.type == DBUS_TYPE_INT32)) {
2890 dlg_tok = entry.uint32_value;
2891 } else if (os_strcmp(entry.key, "tlvs") == 0) {
2892 if (entry.type != DBUS_TYPE_ARRAY ||
2893 entry.array_type != DBUS_TYPE_BYTE)
2895 tlv = wpabuf_alloc_copy(entry.bytearray_value,
2896 entry.array_len);
2900 wpa_dbus_dict_entry_clear(&entry);
2913 wpa_dbus_dict_entry_clear(&entry);