5 #ifndef DBUS_DICT_HELPERS_H
6 #define DBUS_DICT_HELPERS_H
15 DBusMessageIter *iter_dict);
18 DBusMessageIter *iter_dict);
20 const char * wpa_dbus_type_as_string(
const int type);
23 const char *key,
const char *value);
26 const char *key,
const char value);
30 const dbus_bool_t value);
34 const dbus_int16_t value);
38 const dbus_uint16_t value);
42 const dbus_int32_t value);
46 const dbus_uint32_t value);
50 const dbus_int64_t value);
54 const dbus_uint64_t value);
67 const dbus_uint32_t value_len);
71 const char *key,
const char *type,
72 DBusMessageIter *iter_dict_entry,
73 DBusMessageIter *iter_dict_val,
74 DBusMessageIter *iter_array);
76 dbus_bool_t wpa_dbus_dict_begin_string_array(DBusMessageIter *iter_dict,
78 DBusMessageIter *iter_dict_entry,
79 DBusMessageIter *iter_dict_val,
80 DBusMessageIter *iter_array);
90 DBusMessageIter *iter_dict_entry,
91 DBusMessageIter *iter_dict_val,
92 DBusMessageIter *iter_array);
94 static inline dbus_bool_t
95 wpa_dbus_dict_end_string_array(DBusMessageIter *iter_dict,
96 DBusMessageIter *iter_dict_entry,
97 DBusMessageIter *iter_dict_val,
98 DBusMessageIter *iter_array)
101 iter_dict_val, iter_array);
108 const dbus_uint32_t num_items);
112 const struct wpabuf **items,
113 const dbus_uint32_t num_items);
123 #define WPAS_DBUS_TYPE_BINARRAY ((int) '@')
136 dbus_bool_t bool_value;
137 dbus_int16_t int16_value;
138 dbus_uint16_t uint16_value;
139 dbus_int32_t int32_value;
140 dbus_uint32_t uint32_value;
141 dbus_int64_t int64_value;
142 dbus_uint64_t uint64_value;
144 char *bytearray_value;
145 char **strarray_value;
146 struct wpabuf **binarray_value;
148 dbus_uint32_t array_len;
153 DBusMessageIter *iter_dict,
Definition: dbus_dict_helpers.h:125
const char * key
Definition: dbus_dict_helpers.h:130
dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict, const char *key, const char *value, const dbus_uint32_t value_len)
Add a byte array entry to the dict.
Definition: dbus_dict_helpers.c:403
dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter, DBusMessageIter *iter_dict)
Start a dict in a dbus message. Should be paired with a call to wpa_dbus_dict_close_write().
Definition: dbus_dict_helpers.c:22
dbus_bool_t wpa_dbus_dict_open_read(DBusMessageIter *iter, DBusMessageIter *iter_dict, DBusError *error)
Start reading from a dbus dict.
Definition: dbus_dict_helpers.c:651
dbus_bool_t wpa_dbus_dict_append_double(DBusMessageIter *iter_dict, const char *key, const double value)
Add a double-precision floating point entry to the dict.
Definition: dbus_dict_helpers.c:363
dbus_bool_t wpa_dbus_dict_begin_array(DBusMessageIter *iter_dict, const char *key, const char *type, DBusMessageIter *iter_dict_entry, DBusMessageIter *iter_dict_val, DBusMessageIter *iter_array)
Begin an array entry in the dict.
Definition: dbus_dict_helpers.c:431
dbus_bool_t wpa_dbus_dict_append_byte(DBusMessageIter *iter_dict, const char *key, const char value)
Add a byte entry to the dict.
Definition: dbus_dict_helpers.c:213
dbus_bool_t wpa_dbus_dict_append_int64(DBusMessageIter *iter_dict, const char *key, const dbus_int64_t value)
Add a 64-bit integer entry to the dict.
Definition: dbus_dict_helpers.c:325
void wpa_dbus_dict_entry_clear(struct wpa_dbus_dict_entry *entry)
Free any memory used by the entry object.
Definition: dbus_dict_helpers.c:1098
dbus_bool_t wpa_dbus_dict_has_dict_entry(DBusMessageIter *iter_dict)
Return whether or not there are additional dictionary entries.
Definition: dbus_dict_helpers.c:1084
dbus_bool_t wpa_dbus_dict_bin_array_add_element(DBusMessageIter *iter_array, const u8 *value, size_t value_len)
Add a single byte array element to a string array dict entry.
Definition: dbus_dict_helpers.c:506
dbus_bool_t wpa_dbus_dict_get_entry(DBusMessageIter *iter_dict, struct wpa_dbus_dict_entry *entry)
Read the current key/value entry from the dict. Entries are dynamically allocated when needed and mus...
Definition: dbus_dict_helpers.c:1020
dbus_bool_t wpa_dbus_dict_string_array_add_element(DBusMessageIter *iter_array, const char *elem)
Add a single string element to a string array dict entry.
Definition: dbus_dict_helpers.c:483
dbus_bool_t wpa_dbus_dict_append_uint16(DBusMessageIter *iter_dict, const char *key, const dbus_uint16_t value)
Add a 16-bit unsigned integer entry to the dict.
Definition: dbus_dict_helpers.c:268
dbus_bool_t wpa_dbus_dict_append_string_array(DBusMessageIter *iter_dict, const char *key, const char **items, const dbus_uint32_t num_items)
Convenience function to add an entire string array to the dict.
Definition: dbus_dict_helpers.c:572
dbus_bool_t wpa_dbus_dict_append_string(DBusMessageIter *iter_dict, const char *key, const char *value)
Add a string entry to the dict.
Definition: dbus_dict_helpers.c:193
dbus_bool_t wpa_dbus_dict_append_uint32(DBusMessageIter *iter_dict, const char *key, const dbus_uint32_t value)
Add a 32-bit unsigned integer entry to the dict.
Definition: dbus_dict_helpers.c:306
dbus_bool_t wpa_dbus_dict_append_uint64(DBusMessageIter *iter_dict, const char *key, const dbus_uint64_t value)
Add a 64-bit unsigned integer entry to the dict.
Definition: dbus_dict_helpers.c:344
int array_type
the dbus type of the dict entry's value
Definition: dbus_dict_helpers.h:127
dbus_bool_t wpa_dbus_dict_append_wpabuf_array(DBusMessageIter *iter_dict, const char *key, const struct wpabuf **items, const dbus_uint32_t num_items)
Convenience function to add an wpabuf binary array to the dict.
Definition: dbus_dict_helpers.c:608
dbus_bool_t wpa_dbus_dict_append_int16(DBusMessageIter *iter_dict, const char *key, const dbus_int16_t value)
Add a 16-bit signed integer entry to the dict.
Definition: dbus_dict_helpers.c:249
dbus_bool_t wpa_dbus_dict_append_bool(DBusMessageIter *iter_dict, const char *key, const dbus_bool_t value)
Add a boolean entry to the dict.
Definition: dbus_dict_helpers.c:231
dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter, DBusMessageIter *iter_dict)
End a dict element in a dbus message. Should be paired with a call to wpa_dbus_dict_open_write().
Definition: dbus_dict_helpers.c:53
dbus_bool_t wpa_dbus_dict_append_object_path(DBusMessageIter *iter_dict, const char *key, const char *value)
Add a DBus object path entry to the dict.
Definition: dbus_dict_helpers.c:381
dbus_bool_t wpa_dbus_dict_append_int32(DBusMessageIter *iter_dict, const char *key, const dbus_int32_t value)
Add a 32-bit signed integer to the dict.
Definition: dbus_dict_helpers.c:287
dbus_bool_t wpa_dbus_dict_end_array(DBusMessageIter *iter_dict, DBusMessageIter *iter_dict_entry, DBusMessageIter *iter_dict_val, DBusMessageIter *iter_array)
End an array dict entry.
Definition: dbus_dict_helpers.c:547