chiark / gitweb /
16edcc646229cd8c26cf787876c29fff0d8feffc
[elogind.git] / src / libsystemd-bus / kdbus.h
1 /*
2  * Copyright (C) 2013 Kay Sievers
3  * Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4  * Copyright (C) 2013 Linux Foundation
5  * Copyright (C) 2013 Lennart Poettering
6  * Copyright (C) 2013 Daniel Mack <daniel@zonque.org>
7  *
8  * kdbus is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at
11  * your option) any later version.
12  */
13
14 #ifndef _KDBUS_H_
15 #define _KDBUS_H_
16
17 #ifndef __KERNEL__
18 #include <sys/ioctl.h>
19 #include <sys/types.h>
20 #include <linux/types.h>
21 #endif
22
23 #define KDBUS_IOC_MAGIC                 0x95
24 #define KDBUS_SRC_ID_KERNEL             (0)
25 #define KDBUS_DST_ID_NAME               (0)
26 #define KDBUS_MATCH_SRC_ID_ANY          (~0ULL)
27 #define KDBUS_DST_ID_BROADCAST          (~0ULL)
28
29 /**
30  * struct KDBUS_PART_HEADER - header
31  * @size:               Size of element, excluding padding bytes
32  * @type                Type of element
33  *
34  * Common first elements in a structure, used to specify the type
35  * and size of the data.
36  * */
37 #define KDBUS_PART_HEADER \
38         struct {                                                        \
39                 __u64 size;                                             \
40                 __u64 type;                                             \
41         }
42
43 /**
44  * struct kdbus_notify_name_change - name registry change message
45  * @old_id              Former owner of a name
46  * @new_id              New owner of a name
47  * @flags               flags from KDBUS_NAME_*
48  * @name                Well-known name
49  *
50  * Data attached to:
51  *   KDBUS_ITEM_NAME_ADD
52  *   KDBUS_ITEM_NAME_REMOVE
53  *   KDBUS_ITEM_NAME_CHANGE
54  *
55  * Sent from kernel to userspace when the owner or starter of
56  * a well-known name changes.
57  */
58 struct kdbus_notify_name_change {
59         __u64 old_id;
60         __u64 new_id;
61         __u64 flags;
62         char name[0];
63 };
64
65 /**
66  * struct kdbus_notify_id_change - name registry change message
67  * @id                  New or former owner of the name
68  * @flags               flags field from KDBUS_HELLO_*
69  *
70  * Data attached to:
71  *   KDBUS_ITEM_ID_ADD
72  *   KDBUS_ITEM_ID_REMOVE
73  *
74  * Sent from kernel to userspace when the owner or starter of
75  * a well-known name changes.
76  */
77 struct kdbus_notify_id_change {
78         __u64 id;
79         __u64 flags;
80 };
81
82 /**
83  * struct kdbus_creds - process credentials
84  * @uid                 User id
85  * @gid                 Group id
86  * @pid                 Process id
87  * @tid                 Thread id
88  * @starttime           Starttime of the process
89  *
90  * The starttime of the process PID. This is useful to detect PID overruns
91  * from the client side. i.e. if you use the PID to look something up in
92  * /proc/$PID/ you can afterwards check the starttime field of it, to ensure
93  * you didn't run into a PID overrun.
94  */
95 struct kdbus_creds {
96         __u64 uid;
97         __u64 gid;
98         __u64 pid;
99         __u64 tid;
100         __u64 starttime;
101 };
102
103 /**
104  * struct kdbus_audit - audit information
105  * @sessionid           The audit session ID
106  * @loginuid            The audit login uid
107  */
108 struct kdbus_audit {
109         __u64 sessionid;
110         __u64 loginuid;
111 };
112
113 /**
114  * struct kdbus_timestamp
115  * @monotonic_ns:       Monotonic timestamp, in nanoseconds
116  * @realtime_ns:        Realtime timestamp, in nanoseconds
117  */
118 struct kdbus_timestamp {
119         __u64 monotonic_ns;
120         __u64 realtime_ns;
121 };
122
123 /**
124  * struct kdbus_vec - I/O vector for kdbus payload items
125  * @size:               The size of the vector
126  * @address             Memory address for memory addresses
127  * @offset              Offset in the in-message payload memory
128  */
129 struct kdbus_vec {
130         __u64 size;
131         union {
132                 __u64 address;
133                 __u64 offset;
134         };
135 };
136
137 /**
138  * struct kdbus_memfd - a kdbus memfd
139  * @size:               The memfd's size
140  * @fd:                 The file descriptor number
141  * @__pad:              Padding to make the struct aligned
142  */
143 struct kdbus_memfd {
144         __u64 size;
145         int fd;
146         __u32 __pad;
147 };
148
149 /* Message Item Types */
150 enum {
151         _KDBUS_ITEM_NULL,
152
153         /* Filled in by userspace */
154         _KDBUS_ITEM_USER_BASE   = 1,
155         KDBUS_ITEM_PAYLOAD_VEC  = 1,    /* .data_vec, reference to memory area */
156         KDBUS_ITEM_PAYLOAD_OFF,         /* .data_vec, reference to memory area */
157         KDBUS_ITEM_PAYLOAD_MEMFD,       /* file descriptor of a special data file */
158         KDBUS_ITEM_FDS,                 /* .data_fds of file descriptors */
159         KDBUS_ITEM_BLOOM,               /* for broadcasts, carries bloom filter blob in .data */
160         KDBUS_ITEM_DST_NAME,            /* destination's well-known name, in .str */
161         KDBUS_ITEM_PRIORITY,            /* queue priority for message */
162
163         /* Filled in by kernelspace */
164         _KDBUS_ITEM_ATTACH_BASE = 0x400,
165         KDBUS_ITEM_NAMES        = 0x400,/* NUL separated string list with well-known names of source */
166         KDBUS_ITEM_STARTER_NAME,        /* Only used in HELLO for starter connection */
167         KDBUS_ITEM_TIMESTAMP,           /* .timestamp */
168
169         /* when appended to a message, the following items refer to the sender */
170         KDBUS_ITEM_CREDS,               /* .creds */
171         KDBUS_ITEM_PID_COMM,            /* optional, in .str */
172         KDBUS_ITEM_TID_COMM,            /* optional, in .str */
173         KDBUS_ITEM_EXE,                 /* optional, in .str */
174         KDBUS_ITEM_CMDLINE,             /* optional, in .str (a chain of NUL str) */
175         KDBUS_ITEM_CGROUP,              /* optional, in .str */
176         KDBUS_ITEM_CAPS,                /* caps data blob, in .data */
177         KDBUS_ITEM_SECLABEL,            /* NUL terminated string, in .str */
178         KDBUS_ITEM_AUDIT,               /* .audit */
179
180         /* Special messages from kernel, consisting of one and only one of these data blocks */
181         _KDBUS_ITEM_KERNEL_BASE = 0x800,
182         KDBUS_ITEM_NAME_ADD     = 0x800,/* .name_change */
183         KDBUS_ITEM_NAME_REMOVE,         /* .name_change */
184         KDBUS_ITEM_NAME_CHANGE,         /* .name_change */
185         KDBUS_ITEM_ID_ADD,              /* .id_change */
186         KDBUS_ITEM_ID_REMOVE,           /* .id_change */
187         KDBUS_ITEM_REPLY_TIMEOUT,       /* empty, but .reply_cookie in .kdbus_msg is filled in */
188         KDBUS_ITEM_REPLY_DEAD,          /* dito */
189 };
190
191 /**
192  * struct kdbus_item - chain of data blocks
193  * @size        :       overall data record size
194  * @type:               kdbus_item type of data
195  */
196 struct kdbus_item {
197         KDBUS_PART_HEADER;
198         union {
199                 /* inline data */
200                 __u8 data[0];
201                 __u32 data32[0];
202                 __u64 data64[0];
203                 char str[0];
204
205                 /* connection */
206                 __u64 id;
207
208                 /* data vector */
209                 struct kdbus_vec vec;
210
211                 /* process credentials and properties*/
212                 struct kdbus_creds creds;
213                 struct kdbus_audit audit;
214                 struct kdbus_timestamp timestamp;
215
216                 /* specific fields */
217                 struct kdbus_memfd memfd;
218                 int fds[0];
219                 struct kdbus_notify_name_change name_change;
220                 struct kdbus_notify_id_change id_change;
221         };
222 };
223
224 enum {
225         KDBUS_MSG_FLAGS_EXPECT_REPLY    = 1 << 0,
226         KDBUS_MSG_FLAGS_NO_AUTO_START   = 1 << 1,
227 };
228
229 enum {
230         KDBUS_PAYLOAD_KERNEL,
231         KDBUS_PAYLOAD_DBUS1     = 0x4442757356657231ULL, /* 'DBusVer1' */
232         KDBUS_PAYLOAD_GVARIANT  = 0x4756617269616e74ULL, /* 'GVariant' */
233 };
234
235 /**
236  * struct kdbus_msg - the representation of a kdbus message
237  * @size:               Total size of the message
238  * @flags:              Message flags (KDBUS_MSG_FLAGS_*)
239  * @dst_id:             64-bit ID of the destination connection
240  * @src_id:             64-bit ID of the source connection
241  * @payload_type:       Payload type (KDBUS_PAYLOAD_*)
242  * @cookie:             Userspace-supplied cookie
243  * @cookie_reply:       For kernel-generated messages, this is the cookie
244  *                      the message is a reply to
245  * @timeout_ns:         For non-kernel-generated messages, this denotes the
246  *                      message timeout in nanoseconds
247  * @items:              A list of kdbus_items containing the message payload
248  */
249 struct kdbus_msg {
250         __u64 size;
251         __u64 flags;
252         __u64 dst_id;
253         __u64 src_id;
254         __u64 payload_type;
255         __u64 cookie;
256         union {
257                 __u64 cookie_reply;
258                 __u64 timeout_ns;
259         };
260         struct kdbus_item items[0];
261 };
262
263 enum {
264         _KDBUS_POLICY_NULL,
265         KDBUS_POLICY_NAME,
266         KDBUS_POLICY_ACCESS,
267 };
268
269 enum {
270         _KDBUS_POLICY_ACCESS_NULL,
271         KDBUS_POLICY_ACCESS_USER,
272         KDBUS_POLICY_ACCESS_GROUP,
273         KDBUS_POLICY_ACCESS_WORLD,
274 };
275
276 enum {
277         KDBUS_POLICY_RECV               = 1 <<  2,
278         KDBUS_POLICY_SEND               = 1 <<  1,
279         KDBUS_POLICY_OWN                = 1 <<  0,
280 };
281
282 /**
283  * struct kdbus_policy_access - policy access item
284  * @type:               One of KDBUS_POLICY_ACCESS_* types
285  * @bits:               Access to grant. One of KDBUS_POLICY_*
286  * @id:                 For KDBUS_POLICY_ACCESS_USER, the uid
287  *                      For KDBUS_POLICY_ACCESS_GROUP, the gid
288  */
289 struct kdbus_policy_access {
290         __u64 type;     /* USER, GROUP, WORLD */
291         __u64 bits;     /* RECV, SEND, OWN */
292         __u64 id;       /* uid, gid, 0 */
293 };
294
295 /**
296  * struct kdbus_policy - a policy to upload
297  * @size:               The total size of the structure
298  * @type:               KDBUS_POLICY_NAME or KDBUS_POLICY_ACCESS
299  * @name:               The well-known name to grant access to,
300  *                      if @type is KDBUS_POLICY_NAME
301  * @access:             The policy access details,
302  *                      if @type is KDBUS_POLICY_ACCESS
303  */
304 struct kdbus_policy {
305         KDBUS_PART_HEADER;
306         union {
307                 char name[0];
308                 struct kdbus_policy_access access;
309         };
310 };
311
312 /**
313  * struct kdbus_cmd_policy - a series of policies to upload
314  * @size:               The total size of the structure
315  * @policies:           The policies to upload
316  *
317  * A KDBUS_POLICY_NAME must always preceed a KDBUS_POLICY_ACCESS entry.
318  * A new KDBUS_POLICY_NAME can be added after KDBUS_POLICY_ACCESS for
319  * chaining multiple policies together.
320  */
321 struct kdbus_cmd_policy {
322         __u64 size;
323         struct kdbus_policy policies[0];
324 };
325
326 /* Flags for struct kdbus_cmd_hello */
327 enum {
328         KDBUS_HELLO_STARTER             =  1 <<  0,
329         KDBUS_HELLO_ACCEPT_FD           =  1 <<  1,
330 };
331
332 /* Flags for message attachments */
333 enum {
334         KDBUS_ATTACH_TIMESTAMP          =  1 <<  0,
335         KDBUS_ATTACH_CREDS              =  1 <<  1,
336         KDBUS_ATTACH_NAMES              =  1 <<  2,
337         KDBUS_ATTACH_COMM               =  1 <<  3,
338         KDBUS_ATTACH_EXE                =  1 <<  4,
339         KDBUS_ATTACH_CMDLINE            =  1 <<  5,
340         KDBUS_ATTACH_CGROUP             =  1 <<  6,
341         KDBUS_ATTACH_CAPS               =  1 <<  7,
342         KDBUS_ATTACH_SECLABEL           =  1 <<  8,
343         KDBUS_ATTACH_AUDIT              =  1 <<  9,
344 };
345
346 /**
347  * struct kdbus_cmd_hello - struct to say hello to kdbus
348  * @size:               The total size of the structure
349  * @conn_flags:         Connection flags (KDBUS_HELLO_*). The kernel will
350  *                      return its capabilities in that field.
351  * @attach_flags:       Mask of metdata to attach to each message sent
352  *                      (KDBUS_ATTACH_*)
353  * @bus_flags:          The flags field copied verbatim from the original
354  *                      KDBUS_CMD_BUS_MAKE ioctl. It's intended to be useful
355  *                      to do negotiation of features of the payload that is
356  *                      transferred (kernel → userspace)
357  * @id:                 The id of this connection (kernel → userspace)
358  * @bloom_size:         The bloom filter size chosen by the owner
359  *                      (kernel → userspace)
360  * @pool_size:          Maximum size of the pool buffer (kernel → userspace)
361  * @id128:              Unique 128-bit ID of the bus (kernel → userspace)
362  * @items;              A list of items
363  *
364  * This struct is used with the KDBUS_CMD_HELLO ioctl. See the ioctl
365  * documentation for more information.
366  */
367 struct kdbus_cmd_hello {
368         __u64 size;
369
370         /* userspace → kernel, kernel → userspace */
371         __u64 conn_flags;
372         __u64 attach_flags;
373
374         /* kernel → userspace */
375         __u64 bus_flags;
376         __u64 id;
377         __u64 bloom_size;
378         __u64 pool_size;
379         __u8 id128[16];
380
381         struct kdbus_item items[0];
382 };
383
384 /* Flags for KDBUS_CMD_{BUS,EP,NS}_MAKE */
385 enum {
386         KDBUS_MAKE_ACCESS_GROUP         = 1 <<  0,
387         KDBUS_MAKE_ACCESS_WORLD         = 1 <<  1,
388         KDBUS_MAKE_POLICY_OPEN          = 1 <<  2,
389 };
390
391 /* Items to append to KDBUS_CMD_{BUS,EP,NS}_MAKE */
392 enum {
393         _KDBUS_MAKE_NULL,
394         KDBUS_MAKE_NAME,
395         KDBUS_MAKE_CRED,/* allow translator services which connect
396                          * to the bus on behalf of somebody else,
397                          * allow specifying the credentials of the
398                          * client to connect on behalf on. Needs
399                          * privileges */
400 };
401
402 /**
403  * struct kdbus_cmd_bus_make - struct to make a bus
404  * @size:               The total size of the struct
405  * @flags:              FIXME
406  * @bus_flags:
407  * @bloom_filter:       Size of the bloom filter for this bus
408  * @items:              Items describing details such as the name of the bus
409  *
410  * This structure is used with the KDBUS_CMD_BUS_MAKE ioctl. Refer to the
411  * documentation for more information.
412  */
413 struct kdbus_cmd_bus_make {
414         __u64 size;
415         __u64 flags;
416         __u64 bus_flags;
417         __u64 bloom_size;
418         struct kdbus_item items[0];
419 };
420
421 /**
422  * struct kdbus_cmd_ep_make - struct to make an endpoint
423  * @size:               The total size of the struct
424  * @flags:              Unused for now
425  * @items:              Items describing details such as the
426  *                      name of the endpoint
427  *
428  * This structure is used with the KDBUS_CMD_EP_MAKE ioctl. Refer to the
429  * documentation for more information.
430  */
431 struct kdbus_cmd_ep_make {
432         __u64 size;
433         __u64 flags;
434         struct kdbus_item items[0];
435 };
436
437 /**
438  * struct kdbus_cmd_ns_make - struct to make a namespace
439  * @size:               The total size of the struct
440  * @flags:              Unused for now
441  * @items:              Items describing details such as the
442  *                      name of the namespace
443  *
444  * This structure is used with the KDBUS_CMD_NS_MAKE ioctl. Refer to the
445  * documentation for more information.
446  */
447 struct kdbus_cmd_ns_make {
448         __u64 size;
449         __u64 flags;
450         struct kdbus_item items[0];
451 };
452
453 enum {
454         /* userspace → kernel */
455         KDBUS_NAME_REPLACE_EXISTING             = 1 <<  0,
456         KDBUS_NAME_QUEUE                        = 1 <<  1,
457         KDBUS_NAME_ALLOW_REPLACEMENT            = 1 <<  2,
458
459         /* kernel → userspace */
460         KDBUS_NAME_IN_QUEUE                     = 1 << 16,
461 };
462
463 /**
464  * struct kdbus_cmd_name - struct to describe a well-known name
465  * @size:               The total size of the struct
466  * @flags:              Flags for a name entry (KDBUS_NAME_*)
467  * @id:                 Priviledged users may use this field to (de)register
468  *                      names on behalf of other peers.
469  * @conn_flags:         The flags of the owning connection (KDBUS_HELLO_*)
470  * @name:               The well-known name
471  *
472  * This structure is used with the KDBUS_CMD_NAME_ACQUIRE ioctl.
473  * Refer to the documentation for more information.
474  */
475 struct kdbus_cmd_name {
476         __u64 size;
477         __u64 flags;
478         __u64 id;
479         __u64 conn_flags;
480         char name[0];
481 };
482
483 enum {
484         KDBUS_NAME_LIST_UNIQUE          = 1 <<  0,
485         KDBUS_NAME_LIST_NAMES           = 1 <<  1,
486         KDBUS_NAME_LIST_STARTERS        = 1 <<  2,
487         KDBUS_NAME_LIST_QUEUED          = 1 <<  3,
488 };
489
490 /**
491  * struct kdbus_cmd_name_list - request a list of name entries
492  * @flags:              Flags for the query (KDBUS_NAME_LIST_*)
493  * @offset:             The returned offset in the caller's pool buffer.
494  *                      The user must use KDBUS_CMD_FREE to free the
495  *                      allocated memory.
496  * 
497  * This structure is used with the KDBUS_CMD_NAME_LIST ioctl.
498  */
499 struct kdbus_cmd_name_list {
500         __u64 flags;
501         __u64 offset;
502 };
503
504 /**
505  * struct kdbus_name_list - information returned by KDBUS_CMD_NAME_LIST
506  * @size:               The total size of the structure
507  * @names:              A list of names
508  *
509  * Note that the user is responsible for freeing the allocated memory with
510  * the KDBUS_CMD_FREE ioctl.
511  */
512 struct kdbus_name_list {
513         __u64 size;
514         struct kdbus_cmd_name names[0];
515 };
516
517 /**
518  * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl
519  * @size:               The total size of the struct
520  * @flags:              KDBUS_ATTACH_* flags
521  * @id:                 The 64-bit ID of the connection. If set to zero, passing
522  *                      @name is required. kdbus will look up the name to determine
523  *                      the ID in this case.
524  * @offset:             Returned offset in the caller's pool buffer where the
525  *                      kdbus_name_info struct result is stored. The user must
526  *                      use KDBUS_CMD_FREE to free the allocated memory.
527  * @name:               The optional well-known name to look up. Only needed in
528  *                      case @id is zero.
529  *
530  * On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
531  * tell the user the offset in the connection pool buffer at which to find the
532  * result in a struct kdbus_conn_info.
533  */
534 struct kdbus_cmd_conn_info {
535         __u64 size;
536         __u64 flags;
537         __u64 id;
538         __u64 offset;
539         char name[0];
540 };
541
542 /**
543  * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO
544  * @size:               The total size of the struct
545  * @id:                 The connection's 64-bit ID
546  * @flags:              The connection's flags
547  * @items:              A list of struct kdbus_item
548  *
549  * Note that the user is responsible for freeing the allocated memory with
550  * the KDBUS_CMD_FREE ioctl.
551  */
552 struct kdbus_conn_info {
553         __u64 size;
554         __u64 id;
555         __u64 flags;
556         struct kdbus_item items[0];
557 };
558
559 enum {
560         _KDBUS_MATCH_NULL,
561         KDBUS_MATCH_BLOOM,              /* Matches a mask blob against KDBUS_MSG_BLOOM */
562         KDBUS_MATCH_SRC_NAME,           /* Matches a name string against KDBUS_MSG_SRC_NAMES */
563         KDBUS_MATCH_NAME_ADD,           /* Matches a name string against KDBUS_MSG_NAME_ADD */
564         KDBUS_MATCH_NAME_REMOVE,        /* Matches a name string against KDBUS_MSG_NAME_REMOVE */
565         KDBUS_MATCH_NAME_CHANGE,        /* Matches a name string against KDBUS_MSG_NAME_CHANGE */
566         KDBUS_MATCH_ID_ADD,             /* Matches an ID against KDBUS_MSG_ID_ADD */
567         KDBUS_MATCH_ID_REMOVE,          /* Matches an ID against KDBUS_MSG_ID_REMOVE */
568 };
569
570 /**
571  * struct kdbus_cmd_match - struct to add or remove matches
572  * @size:               The total size of the struct
573  * @id:                 Priviledged users may (de)register matches on behalf
574  *                      of other peers.
575  *                      In other cases, set to 0.
576  * @cookie:             Userspace supplied cookie. When removing, the cookie is
577  *                      suffices as information
578  * @src_id:             The source ID to match against. Use KDBUS_MATCH_SRC_ID_ANY or
579  *                      any other value for a unique match.
580  * @items:              A list of items for additional information
581  *
582  * This structure is used with the KDBUS_CMD_ADD_MATCH and
583  * KDBUS_CMD_REMOVE_MATCH ioctl. Refer to the documentation for more
584  * information.
585  */
586 struct kdbus_cmd_match {
587         __u64 size;
588         __u64 id;
589         __u64 cookie;
590         __u64 src_id;
591         struct kdbus_item items[0];
592 };
593
594 enum {
595         KDBUS_MONITOR_ENABLE            = 1 <<  0,
596 };
597
598 /**
599  * struct kdbus_cmd_monitor - struct to enable or disable eavesdropping
600  * @id:                 Priviledged users may enable or disable the monitor feature
601  *                      on behalf of other peers
602  * @flags:              Use KDBUS_MONITOR_ENABLE to enable eavesdropping
603  *
604  * This structure is used with the KDBUS_CMD_MONITOR ioctl.
605  * Refer to the documentation for more information.
606  */
607 struct kdbus_cmd_monitor {
608         __u64 id;
609         __u64 flags;
610 };
611
612 enum {
613         /* kdbus control node commands: require unset state */
614         KDBUS_CMD_BUS_MAKE =            _IOW(KDBUS_IOC_MAGIC, 0x00, struct kdbus_cmd_bus_make),
615         KDBUS_CMD_NS_MAKE =             _IOR(KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_ns_make),
616
617         /* kdbus ep node commands: require unset state */
618         KDBUS_CMD_EP_MAKE =             _IOW(KDBUS_IOC_MAGIC, 0x20, struct kdbus_cmd_ep_make),
619         KDBUS_CMD_HELLO =               _IOWR(KDBUS_IOC_MAGIC, 0x30, struct kdbus_cmd_hello),
620
621         /* kdbus ep node commands: require connected state */
622         KDBUS_CMD_MSG_SEND =            _IOW(KDBUS_IOC_MAGIC, 0x40, struct kdbus_msg),
623         KDBUS_CMD_MSG_RECV =            _IOR(KDBUS_IOC_MAGIC, 0x41, __u64 *),
624         KDBUS_CMD_FREE =                _IOW(KDBUS_IOC_MAGIC, 0x42, __u64 *),
625
626         KDBUS_CMD_NAME_ACQUIRE =        _IOWR(KDBUS_IOC_MAGIC, 0x50, struct kdbus_cmd_name),
627         KDBUS_CMD_NAME_RELEASE =        _IOW(KDBUS_IOC_MAGIC, 0x51, struct kdbus_cmd_name),
628         KDBUS_CMD_NAME_LIST =           _IOWR(KDBUS_IOC_MAGIC, 0x52, struct kdbus_cmd_name_list),
629
630         KDBUS_CMD_CONN_INFO =           _IOWR(KDBUS_IOC_MAGIC, 0x60, struct kdbus_cmd_conn_info),
631
632         KDBUS_CMD_MATCH_ADD =           _IOW(KDBUS_IOC_MAGIC, 0x70, struct kdbus_cmd_match),
633         KDBUS_CMD_MATCH_REMOVE =        _IOW(KDBUS_IOC_MAGIC, 0x71, struct kdbus_cmd_match),
634         KDBUS_CMD_MONITOR =             _IOW(KDBUS_IOC_MAGIC, 0x72, struct kdbus_cmd_monitor),
635
636         /* kdbus ep node commands: require ep owner state */
637         KDBUS_CMD_EP_POLICY_SET =       _IOW(KDBUS_IOC_MAGIC, 0x80, struct kdbus_cmd_policy),
638
639         /* kdbus memfd commands: */
640         KDBUS_CMD_MEMFD_NEW =           _IOR(KDBUS_IOC_MAGIC, 0x90, int *),
641         KDBUS_CMD_MEMFD_SIZE_GET =      _IOR(KDBUS_IOC_MAGIC, 0x91, __u64 *),
642         KDBUS_CMD_MEMFD_SIZE_SET =      _IOW(KDBUS_IOC_MAGIC, 0x92, __u64 *),
643         KDBUS_CMD_MEMFD_SEAL_GET =      _IOR(KDBUS_IOC_MAGIC, 0x93, int *),
644         KDBUS_CMD_MEMFD_SEAL_SET =      _IO(KDBUS_IOC_MAGIC, 0x94),
645 };
646 #endif