chiark / gitweb /
bus: automatically generate minimal introspection data to find installed objects
[elogind.git] / src / libsystemd-bus / sd-bus-protocol.h
index 9d7615ff090ec148ed28178b8ea88d781bb4f193..ac4d0b1dc53f304a0c49110938c2e87f66b9232f 100644 (file)
@@ -22,9 +22,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-/* Types of message */
+#include <endian.h>
 
-#define SD_BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
+/* Types of message */
 
 enum {
         _SD_BUS_MESSAGE_TYPE_INVALID = 0,
@@ -67,7 +67,14 @@ enum {
 enum {
         _SD_BUS_INVALID_ENDIAN = 0,
         SD_BUS_LITTLE_ENDIAN   = 'l',
-        SD_BUS_BIG_ENDIAN      = 'B'
+        SD_BUS_BIG_ENDIAN      = 'B',
+#if __BYTE_ORDER == __BIG_ENDIAN
+        SD_BUS_NATIVE_ENDIAN   = SD_BUS_BIG_ENDIAN,
+        SD_BUS_REVERSE_ENDIAN  = SD_BUS_LITTLE_ENDIAN
+#else
+        SD_BUS_NATIVE_ENDIAN   = SD_BUS_LITTLE_ENDIAN,
+        SD_BUS_REVERSE_ENDIAN  = SD_BUS_BIG_ENDIAN
+#endif
 };
 
 /* Flags */
@@ -93,4 +100,46 @@ enum {
         _SD_BUS_MESSAGE_HEADER_MAX
 };
 
+#define SD_BUS_INTROSPECT_DOCTYPE                                       \
+        "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \
+        "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
+
+#define SD_BUS_INTROSPECT_INTERFACE_PROPERTIES                          \
+        " <interface name=\"org.freedesktop.DBus.Properties\">\n"       \
+        "  <method name=\"Get\">\n"                                     \
+        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
+        "   <arg name=\"property\" direction=\"in\" type=\"s\"/>\n"     \
+        "   <arg name=\"value\" direction=\"out\" type=\"v\"/>\n"       \
+        "  </method>\n"                                                 \
+        "  <method name=\"GetAll\">\n"                                  \
+        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
+        "   <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
+        "  </method>\n"                                                 \
+        "  <method name=\"Set\">\n"                                     \
+        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
+        "   <arg name=\"property\" direction=\"in\" type=\"s\"/>\n"     \
+        "   <arg name=\"value\" direction=\"in\" type=\"v\"/>\n"        \
+        "  </method>\n"                                                 \
+        "  <signal name=\"PropertiesChanged\">\n"                       \
+        "   <arg type=\"s\" name=\"interface\"/>\n"                     \
+        "   <arg type=\"a{sv}\" name=\"changed_properties\"/>\n"        \
+        "   <arg type=\"as\" name=\"invalidated_properties\"/>\n"       \
+        "  </signal>\n"                                                 \
+        " </interface>\n"
+
+#define SD_BUS_INTROSPECT_INTERFACE_INTROSPECTABLE                      \
+        " <interface name=\"org.freedesktop.DBus.Introspectable\">\n"   \
+        "  <method name=\"Introspect\">\n"                              \
+        "   <arg name=\"data\" type=\"s\" direction=\"out\"/>\n"        \
+        "  </method>\n"                                                 \
+        " </interface>\n"
+
+#define SD_BUS_INTROSPECT_INTERFACE_PEER                                \
+        "<interface name=\"org.freedesktop.DBus.Peer\">\n"              \
+        " <method name=\"Ping\"/>\n"                                    \
+        " <method name=\"GetMachineId\">\n"                             \
+        "  <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \
+        " </method>\n"                                                  \
+        "</interface>\n"
+
 #endif