chiark / gitweb /
networkd: add and expose per-link LLMNR config option
[elogind.git] / src / systemd / sd-bus-vtable.h
index 5203bf1..a032215 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "_sd-common.h"
+
+_SD_BEGIN_DECLARATIONS;
+
 typedef struct sd_bus_vtable sd_bus_vtable;
 
 #include "sd-bus.h"
 
 enum {
-        _SD_BUS_VTABLE_START = '<',
-        _SD_BUS_VTABLE_END = '>',
-        _SD_BUS_VTABLE_METHOD = 'M',
-        _SD_BUS_VTABLE_SIGNAL = 'S',
-        _SD_BUS_VTABLE_PROPERTY = 'P',
+        _SD_BUS_VTABLE_START             = '<',
+        _SD_BUS_VTABLE_END               = '>',
+        _SD_BUS_VTABLE_METHOD            = 'M',
+        _SD_BUS_VTABLE_SIGNAL            = 'S',
+        _SD_BUS_VTABLE_PROPERTY          = 'P',
         _SD_BUS_VTABLE_WRITABLE_PROPERTY = 'W',
-        _SD_BUS_VTABLE_CHILDREN = 'C'
 };
 
 enum {
-        SD_BUS_VTABLE_DEPRECATED = 1,
-        SD_BUS_VTABLE_METHOD_NO_REPLY = 2,
-        SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE = 4,
-        SD_BUS_VTABLE_PROPERTY_INVALIDATE_ONLY = 8,
+        SD_BUS_VTABLE_DEPRECATED                   = 1ULL << 0,
+        SD_BUS_VTABLE_HIDDEN                       = 1ULL << 1,
+        SD_BUS_VTABLE_UNPRIVILEGED                 = 1ULL << 2,
+        SD_BUS_VTABLE_METHOD_NO_REPLY              = 1ULL << 3,
+        SD_BUS_VTABLE_PROPERTY_CONST               = 1ULL << 4,
+        SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE        = 1ULL << 5,
+        SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION  = 1ULL << 6,
+        _SD_BUS_VTABLE_CAPABILITY_MASK             = 0xFFFFULL << 40
 };
 
+#define SD_BUS_VTABLE_CAPABILITY(x) ((uint64_t) (((x)+1) & 0xFFFF) << 40)
+
 struct sd_bus_vtable {
         /* Please do not initialize this structure directly, use the
          * macros below instead */
 
-        int type;
-        int flags;
+        uint8_t type:8;
+        uint64_t flags:56;
         union {
                 struct {
                         size_t element_size;
@@ -70,53 +79,53 @@ struct sd_bus_vtable {
                         sd_bus_property_set_t set;
                         size_t offset;
                 } property;
-        };
+        } x;
 };
 
 #define SD_BUS_VTABLE_START(_flags)                                     \
         {                                                               \
                 .type = _SD_BUS_VTABLE_START,                           \
                 .flags = _flags,                                        \
-                .start.element_size = sizeof(sd_bus_vtable),            \
+                .x.start.element_size = sizeof(sd_bus_vtable),          \
         }
 
 #define SD_BUS_METHOD(_member, _signature, _result, _handler, _flags)   \
         {                                                               \
                 .type = _SD_BUS_VTABLE_METHOD,                          \
                 .flags = _flags,                                        \
-                .method.member = _member,                               \
-                .method.signature = _signature,                         \
-                .method.result = _result,                               \
-                .method.handler = _handler,                             \
+                .x.method.member = _member,                             \
+                .x.method.signature = _signature,                       \
+                .x.method.result = _result,                             \
+                .x.method.handler = _handler,                           \
         }
 
 #define SD_BUS_SIGNAL(_member, _signature, _flags)                      \
         {                                                               \
                 .type = _SD_BUS_VTABLE_SIGNAL,                          \
                 .flags = _flags,                                        \
-                .signal.member = _member,                               \
-                .signal.signature = _signature,                         \
+                .x.signal.member = _member,                             \
+                .x.signal.signature = _signature,                       \
         }
 
-#define SD_BUS_PROPERTY(_member, _signature, _get, _offset, _flags) \
+#define SD_BUS_PROPERTY(_member, _signature, _get, _offset, _flags)     \
         {                                                               \
                 .type = _SD_BUS_VTABLE_PROPERTY,                        \
                 .flags = _flags,                                        \
-                .property.member = _member,                             \
-                .property.signature = _signature,                       \
-                .property.get = _get,                                   \
-                .property.offset = _offset,                             \
+                .x.property.member = _member,                           \
+                .x.property.signature = _signature,                     \
+                .x.property.get = _get,                                 \
+                .x.property.offset = _offset,                           \
         }
 
 #define SD_BUS_WRITABLE_PROPERTY(_member, _signature, _get, _set, _offset, _flags) \
         {                                                               \
                 .type = _SD_BUS_VTABLE_WRITABLE_PROPERTY,               \
                 .flags = _flags,                                        \
-                .property.member = _member,                             \
-                .property.signature = _signature,                       \
-                .property.get = _get,                                   \
-                .property.set = _set,                                   \
-                .property.offset = _offset,                             \
+                .x.property.member = _member,                           \
+                .x.property.signature = _signature,                     \
+                .x.property.get = _get,                                 \
+                .x.property.set = _set,                                 \
+                .x.property.offset = _offset,                           \
         }
 
 #define SD_BUS_VTABLE_END                                               \
@@ -124,4 +133,6 @@ struct sd_bus_vtable {
                 .type = _SD_BUS_VTABLE_END,                             \
         }
 
+_SD_END_DECLARATIONS;
+
 #endif