Home | History | Annotate | Download | only in dbus

Lines Matching refs:xml

23 	struct wpabuf *xml;
41 iface->xml = wpabuf_alloc(15000);
42 if (iface->dbus_interface == NULL || iface->xml == NULL) {
44 wpabuf_free(iface->xml);
48 wpabuf_printf(iface->xml, "<interface name=\"%s\">", dbus_interface);
54 static void add_arg(struct wpabuf *xml, const char *name, const char *type,
57 wpabuf_printf(xml, "<arg name=\"%s\"", name);
59 wpabuf_printf(xml, " type=\"%s\"", type);
61 wpabuf_printf(xml, " direction=\"%s\"", direction);
62 wpabuf_put_str(xml, "/>");
66 static void add_entry(struct wpabuf *xml, const char *type, const char *name,
72 wpabuf_printf(xml, "<%s name=\"%s\"/>", type, name);
75 wpabuf_printf(xml, "<%s name=\"%s\">", type, name);
77 add_arg(xml, arg->name, arg->type,
81 wpabuf_printf(xml, "</%s>", type);
85 static void add_property(struct wpabuf *xml,
88 wpabuf_printf(xml, "<property name=\"%s\" type=\"%s\" "
105 add_entry(iface->xml, "method", dsc->dbus_method,
120 add_entry(iface->xml, "signal", dsc->dbus_signal,
135 add_property(iface->xml, dsc);
147 * node in XML root node for each. Returned list elements contain interface
148 * name and XML node of corresponding interface.
159 static void add_interfaces(struct dl_list *list, struct wpabuf *xml)
164 if (wpabuf_len(iface->xml) + 20 < wpabuf_tailroom(xml)) {
165 wpabuf_put_buf(xml, iface->xml);
166 wpabuf_put_str(xml, "</interface>");
170 (unsigned int) wpabuf_tailroom(xml),
171 (unsigned int) wpabuf_len(iface->xml));
174 wpabuf_free(iface->xml);
181 static void add_child_nodes(struct wpabuf *xml, DBusConnection *con,
190 wpabuf_printf(xml, "<node name=\"%s\"/>", children[i]);
195 static void add_introspectable_interface(struct wpabuf *xml)
197 wpabuf_printf(xml, "<interface name=\"%s\">"
207 static void add_properties_interface(struct wpabuf *xml)
209 wpabuf_printf(xml, "<interface name=\"%s\">",
212 wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_GET);
213 add_arg(xml, "interface", "s", "in");
214 add_arg(xml, "propname", "s", "in");
215 add_arg(xml, "value", "v", "out");
216 wpabuf_put_str(xml, "</method>");
218 wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_GETALL);
219 add_arg(xml, "interface", "s", "in");
220 add_arg(xml, "props", "a{sv}", "out");
221 wpabuf_put_str(xml, "</method>");
223 wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_SET);
224 add_arg(xml, "interface", "s", "in");
225 add_arg(xml, "propname", "s", "in");
226 add_arg(xml, "value", "v", "in");
227 wpabuf_put_str(xml, "</method>");
229 wpabuf_put_str(xml, "</interface>");
233 static void add_wpas_interfaces(struct wpabuf *xml,
240 add_interfaces(&ifaces, xml);
248 * Returns: Message with introspection result XML string as only argument
251 * object and generates introspection data for the object as XML string.
258 struct wpabuf *xml;
260 xml = wpabuf_alloc(20000);
261 if (xml == NULL)
264 wpabuf_put_str(xml, "<?xml version=\"1.0\"?>\n");
265 wpabuf_put_str(xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE);
266 wpabuf_put_str(xml, "<node>");
268 add_introspectable_interface(xml);
269 add_properties_interface(xml);
270 add_wpas_interfaces(xml, obj_dsc);
271 add_child_nodes(xml, obj_dsc->connection,
274 wpabuf_put_str(xml, "</node>\n");
278 const char *intro_str = wpabuf_head(xml);
283 wpabuf_free(xml);