chiark / gitweb /
bus: use internal helper to read org.freedesktop.DBus.Properties::GetAll variables
[elogind.git] / src / libsystemd-bus / bus-util.h
index cf004360a8109bc27eb1fc7d8256b87e71a9c7a9..ddb926498fb90cf96f52dc4b38c39436ecf97895 100644 (file)
 #include "time-util.h"
 #include "util.h"
 
+typedef enum BusTransport {
+        BUS_TRANSPORT_LOCAL,
+        BUS_TRANSPORT_REMOTE,
+        BUS_TRANSPORT_CONTAINER,
+        _BUS_TRANSPORT_MAX,
+        _BUS_TRANSPORT_INVALID = -1
+} BusTransport;
+
+struct bus_properties_map {
+        const char *type;
+        const char *name;
+        void *ptr;
+};
+
+int bus_map_all_properties(sd_bus *bus,
+                           const char *destination,
+                           const char *path,
+                           const struct bus_properties_map *map);
+
 int bus_async_unregister_and_quit(sd_event *e, sd_bus *bus, const char *name);
 
 int bus_event_loop_with_idle(sd_event *e, sd_bus *bus, const char *name, usec_t timeout);
@@ -37,7 +56,11 @@ int bus_verify_polkit(sd_bus *bus, sd_bus_message *m, const char *action, bool i
 int bus_verify_polkit_async(sd_bus *bus, Hashmap **registry, sd_bus_message *m, const char *action, bool interactive, sd_bus_error *error, sd_bus_message_handler_t callback, void *userdata);
 void bus_verify_polkit_async_registry_free(sd_bus *bus, Hashmap *registry);
 
-int bus_connect_system(sd_bus **_bus);
+int bus_open_system_systemd(sd_bus **_bus);
+
+int bus_open_transport(BusTransport transport, const char *host, bool user, sd_bus **bus);
+
+int bus_generic_print_property(const char *name, sd_bus_message *property, bool all);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_message*, sd_bus_message_unref);