chiark / gitweb /
bus: update kdbus.h
[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 - anonymous struct used as 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 /**
150  * struct kdbus_name - a registered well-known name with its flags
151  * @flags               flags from KDBUS_NAME_*
152  * @name                well-known name
153  */
154 struct kdbus_name {
155         __u64 flags;
156         char name[0];
157 };
158
159 /* Message Item Types */
160 enum {
161         _KDBUS_ITEM_NULL,
162
163         /* Filled in by userspace */
164         _KDBUS_ITEM_USER_BASE   = 1,
165         KDBUS_ITEM_PAYLOAD_VEC  = 1,    /* .data_vec, reference to memory area */
166         KDBUS_ITEM_PAYLOAD_OFF,         /* .data_vec, reference to memory area */
167         KDBUS_ITEM_PAYLOAD_MEMFD,       /* file descriptor of a special data file */
168         KDBUS_ITEM_FDS,                 /* .data_fds of file descriptors */
169         KDBUS_ITEM_BLOOM,               /* for broadcasts, carries bloom filter blob in .data */
170         KDBUS_ITEM_DST_NAME,            /* destination's well-known name, in .str */
171         KDBUS_ITEM_PRIORITY,            /* queue priority for message */
172
173         /* Filled in by kernelspace */
174         _KDBUS_ITEM_ATTACH_BASE = 0x400,
175         KDBUS_ITEM_NAME         = 0x400,/* NUL separated string list with well-known names of source */
176         KDBUS_ITEM_STARTER_NAME,        /* Only used in HELLO for starter connection */
177         KDBUS_ITEM_TIMESTAMP,           /* .timestamp */
178
179         /* when appended to a message, the following items refer to the sender */
180         KDBUS_ITEM_CREDS,               /* .creds */
181         KDBUS_ITEM_PID_COMM,            /* optional, in .str */
182         KDBUS_ITEM_TID_COMM,            /* optional, in .str */
183         KDBUS_ITEM_EXE,                 /* optional, in .str */
184         KDBUS_ITEM_CMDLINE,             /* optional, in .str (a chain of NUL str) */
185         KDBUS_ITEM_CGROUP,              /* optional, in .str */
186         KDBUS_ITEM_CAPS,                /* caps data blob, in .data */
187         KDBUS_ITEM_SECLABEL,            /* NUL terminated string, in .str */
188         KDBUS_ITEM_AUDIT,               /* .audit */
189
190         /* Special messages from kernel, consisting of one and only one of these data blocks */
191         _KDBUS_ITEM_KERNEL_BASE = 0x800,
192         KDBUS_ITEM_NAME_ADD     = 0x800,/* .name_change */
193         KDBUS_ITEM_NAME_REMOVE,         /* .name_change */
194         KDBUS_ITEM_NAME_CHANGE,         /* .name_change */
195         KDBUS_ITEM_ID_ADD,              /* .id_change */
196         KDBUS_ITEM_ID_REMOVE,           /* .id_change */
197         KDBUS_ITEM_REPLY_TIMEOUT,       /* empty, but .reply_cookie in .kdbus_msg is filled in */
198         KDBUS_ITEM_REPLY_DEAD,          /* dito */
199 };
200
201 /**
202  * struct kdbus_item - chain of data blocks
203  * @size        :       overall data record size
204  * @type:               kdbus_item type of data
205  */
206 struct kdbus_item {
207         KDBUS_PART_HEADER;
208         union {
209                 /* inline data */
210                 __u8 data[0];
211                 __u32 data32[0];
212                 __u64 data64[0];
213                 char str[0];
214
215                 /* connection */
216                 __u64 id;
217
218                 /* data vector */
219                 struct kdbus_vec vec;
220
221                 /* process credentials and properties*/
222                 struct kdbus_creds creds;
223                 struct kdbus_audit audit;
224                 struct kdbus_timestamp timestamp;
225                 struct kdbus_name name;
226
227                 /* specific fields */
228                 struct kdbus_memfd memfd;
229                 int fds[0];
230                 struct kdbus_notify_name_change name_change;
231                 struct kdbus_notify_id_change id_change;
232         };
233 };
234
235 enum {
236         KDBUS_MSG_FLAGS_EXPECT_REPLY    = 1 << 0,
237         KDBUS_MSG_FLAGS_NO_AUTO_START   = 1 << 1,
238 };
239
240 enum {
241         KDBUS_PAYLOAD_KERNEL,
242         KDBUS_PAYLOAD_DBUS1     = 0x4442757356657231ULL, /* 'DBusVer1' */
243         KDBUS_PAYLOAD_GVARIANT  = 0x4756617269616e74ULL, /* 'GVariant' */
244 };
245
246 /**
247  * struct kdbus_msg - the representation of a kdbus message
248  * @size:               Total size of the message
249  * @flags:              Message flags (KDBUS_MSG_FLAGS_*)
250  * @dst_id:             64-bit ID of the destination connection
251  * @src_id:             64-bit ID of the source connection
252  * @payload_type:       Payload type (KDBUS_PAYLOAD_*)
253  * @cookie:             Userspace-supplied cookie
254  * @cookie_reply:       For kernel-generated messages, this is the cookie
255  *                      the message is a reply to
256  * @timeout_ns:         For non-kernel-generated messages, this denotes the
257  *                      message timeout in nanoseconds
258  * @items:              A list of kdbus_items containing the message payload
259  */
260 struct kdbus_msg {
261         __u64 size;
262         __u64 flags;
263         __u64 dst_id;
264         __u64 src_id;
265         __u64 payload_type;
266         __u64 cookie;
267         union {
268                 __u64 cookie_reply;
269                 __u64 timeout_ns;
270         };
271         struct kdbus_item items[0];
272 };
273
274 enum {
275         _KDBUS_POLICY_NULL,
276         KDBUS_POLICY_NAME,
277         KDBUS_POLICY_ACCESS,
278 };
279
280 enum {
281         _KDBUS_POLICY_ACCESS_NULL,
282         KDBUS_POLICY_ACCESS_USER,
283         KDBUS_POLICY_ACCESS_GROUP,
284         KDBUS_POLICY_ACCESS_WORLD,
285 };
286
287 enum {
288         KDBUS_POLICY_RECV               = 1 <<  2,
289         KDBUS_POLICY_SEND               = 1 <<  1,
290         KDBUS_POLICY_OWN                = 1 <<  0,
291 };
292
293 /**
294  * struct kdbus_policy_access - policy access item
295  * @type:               One of KDBUS_POLICY_ACCESS_* types
296  * @bits:               Access to grant. One of KDBUS_POLICY_*
297  * @id:                 For KDBUS_POLICY_ACCESS_USER, the uid
298  *                      For KDBUS_POLICY_ACCESS_GROUP, the gid
299  */
300 struct kdbus_policy_access {
301         __u64 type;     /* USER, GROUP, WORLD */
302         __u64 bits;     /* RECV, SEND, OWN */
303         __u64 id;       /* uid, gid, 0 */
304 };
305
306 /**
307  * struct kdbus_policy - a policy to upload
308  * @size:               The total size of the structure
309  * @type:               KDBUS_POLICY_NAME or KDBUS_POLICY_ACCESS
310  * @name:               The well-known name to grant access to,
311  *                      if @type is KDBUS_POLICY_NAME
312  * @access:             The policy access details,
313  *                      if @type is KDBUS_POLICY_ACCESS
314  */
315 struct kdbus_policy {
316         KDBUS_PART_HEADER;
317         union {
318                 char name[0];
319                 struct kdbus_policy_access access;
320         };
321 };
322
323 /**
324  * struct kdbus_cmd_policy - a series of policies to upload
325  * @size:               The total size of the structure
326  * @policies:           The policies to upload
327  *
328  * A KDBUS_POLICY_NAME must always preceed a KDBUS_POLICY_ACCESS entry.
329  * A new KDBUS_POLICY_NAME can be added after KDBUS_POLICY_ACCESS for
330  * chaining multiple policies together.
331  */
332 struct kdbus_cmd_policy {
333         __u64 size;
334         struct kdbus_policy policies[0];
335 };
336
337 /* Flags for struct kdbus_cmd_hello */
338 enum {
339         KDBUS_HELLO_STARTER             =  1 <<  0,
340         KDBUS_HELLO_ACCEPT_FD           =  1 <<  1,
341 };
342
343 /* Flags for message attachments */
344 enum {
345         KDBUS_ATTACH_TIMESTAMP          =  1 <<  0,
346         KDBUS_ATTACH_CREDS              =  1 <<  1,
347         KDBUS_ATTACH_NAMES              =  1 <<  2,
348         KDBUS_ATTACH_COMM               =  1 <<  3,
349         KDBUS_ATTACH_EXE                =  1 <<  4,
350         KDBUS_ATTACH_CMDLINE            =  1 <<  5,
351         KDBUS_ATTACH_CGROUP             =  1 <<  6,
352         KDBUS_ATTACH_CAPS               =  1 <<  7,
353         KDBUS_ATTACH_SECLABEL           =  1 <<  8,
354         KDBUS_ATTACH_AUDIT              =  1 <<  9,
355 };
356
357 /**
358  * struct kdbus_cmd_hello - struct to say hello to kdbus
359  * @size:               The total size of the structure
360  * @conn_flags:         Connection flags (KDBUS_HELLO_*). The kernel will
361  *                      return its capabilities in that field.
362  * @attach_flags:       Mask of metdata to attach to each message sent
363  *                      (KDBUS_ATTACH_*)
364  * @bus_flags:          The flags field copied verbatim from the original
365  *                      KDBUS_CMD_BUS_MAKE ioctl. It's intended to be useful
366  *                      to do negotiation of features of the payload that is
367  *                      transferred (kernel → userspace)
368  * @id:                 The ID of this connection (kernel → userspace)
369  * @bloom_size:         The bloom filter size chosen by the owner
370  *                      (kernel → userspace)
371  * @pool_size:          Maximum size of the pool buffer (kernel → userspace)
372  * @id128:              Unique 128-bit ID of the bus (kernel → userspace)
373  * @items;              A list of items
374  *
375  * This struct is used with the KDBUS_CMD_HELLO ioctl. See the ioctl
376  * documentation for more information.
377  */
378 struct kdbus_cmd_hello {
379         __u64 size;
380
381         /* userspace → kernel, kernel → userspace */
382         __u64 conn_flags;
383         __u64 attach_flags;
384
385         /* kernel → userspace */
386         __u64 bus_flags;
387         __u64 id;
388         __u64 bloom_size;
389         __u64 pool_size;
390         __u8 id128[16];
391
392         struct kdbus_item items[0];
393 };
394
395 /* Flags for KDBUS_CMD_{BUS,EP,NS}_MAKE */
396 enum {
397         KDBUS_MAKE_ACCESS_GROUP         = 1 <<  0,
398         KDBUS_MAKE_ACCESS_WORLD         = 1 <<  1,
399         KDBUS_MAKE_POLICY_OPEN          = 1 <<  2,
400 };
401
402 /* Items to append to KDBUS_CMD_{BUS,EP,NS}_MAKE */
403 enum {
404         _KDBUS_MAKE_NULL,
405         KDBUS_MAKE_NAME,
406 };
407
408 /**
409  * struct kdbus_cmd_bus_make - struct to make a bus
410  * @size:               The total size of the struct
411  * @flags:              Properties for the bus to create
412  * @bloom_filter:       Size of the bloom filter for this bus
413  * @items:              Items describing details such as the name of the bus
414  *
415  * This structure is used with the KDBUS_CMD_BUS_MAKE ioctl. Refer to the
416  * documentation for more information.
417  */
418 struct kdbus_cmd_bus_make {
419         __u64 size;
420         __u64 flags;
421         __u64 bloom_size;
422         struct kdbus_item items[0];
423 };
424
425 /**
426  * struct kdbus_cmd_ep_make - struct to make an endpoint
427  * @size:               The total size of the struct
428  * @flags:              Unused for now
429  * @items:              Items describing details such as the
430  *                      name of the endpoint
431  *
432  * This structure is used with the KDBUS_CMD_EP_MAKE ioctl. Refer to the
433  * documentation for more information.
434  */
435 struct kdbus_cmd_ep_make {
436         __u64 size;
437         __u64 flags;
438         struct kdbus_item items[0];
439 };
440
441 /**
442  * struct kdbus_cmd_ns_make - struct to make a namespace
443  * @size:               The total size of the struct
444  * @flags:              Unused for now
445  * @items:              Items describing details such as the
446  *                      name of the namespace
447  *
448  * This structure is used with the KDBUS_CMD_NS_MAKE ioctl. Refer to the
449  * documentation for more information.
450  */
451 struct kdbus_cmd_ns_make {
452         __u64 size;
453         __u64 flags;
454         struct kdbus_item items[0];
455 };
456
457 enum {
458         /* userspace → kernel */
459         KDBUS_NAME_REPLACE_EXISTING             = 1 <<  0,
460         KDBUS_NAME_QUEUE                        = 1 <<  1,
461         KDBUS_NAME_ALLOW_REPLACEMENT            = 1 <<  2,
462
463         /* kernel → userspace */
464         KDBUS_NAME_IN_QUEUE                     = 1 << 16,
465 };
466
467 /**
468  * struct kdbus_cmd_name - struct to describe a well-known name
469  * @size:               The total size of the struct
470  * @flags:              Flags for a name entry (KDBUS_NAME_*)
471  * @id:                 Priviledged users may use this field to (de)register
472  *                      names on behalf of other peers.
473  * @conn_flags:         The flags of the owning connection (KDBUS_HELLO_*)
474  * @name:               The well-known name
475  *
476  * This structure is used with the KDBUS_CMD_NAME_ACQUIRE ioctl.
477  * Refer to the documentation for more information.
478  */
479 struct kdbus_cmd_name {
480         __u64 size;
481         __u64 flags;
482         __u64 id;
483         __u64 conn_flags;
484         char name[0];
485 };
486
487 enum {
488         KDBUS_NAME_LIST_UNIQUE          = 1 <<  0,
489         KDBUS_NAME_LIST_NAMES           = 1 <<  1,
490         KDBUS_NAME_LIST_STARTERS        = 1 <<  2,
491         KDBUS_NAME_LIST_QUEUED          = 1 <<  3,
492 };
493
494 /**
495  * struct kdbus_cmd_name_list - request a list of name entries
496  * @flags:              Flags for the query (KDBUS_NAME_LIST_*)
497  * @offset:             The returned offset in the caller's pool buffer.
498  *                      The user must use KDBUS_CMD_FREE to free the
499  *                      allocated memory.
500  * 
501  * This structure is used with the KDBUS_CMD_NAME_LIST ioctl.
502  */
503 struct kdbus_cmd_name_list {
504         __u64 flags;
505         __u64 offset;
506 };
507
508 /**
509  * struct kdbus_name_list - information returned by KDBUS_CMD_NAME_LIST
510  * @size:               The total size of the structure
511  * @names:              A list of names
512  *
513  * Note that the user is responsible for freeing the allocated memory with
514  * the KDBUS_CMD_FREE ioctl.
515  */
516 struct kdbus_name_list {
517         __u64 size;
518         struct kdbus_cmd_name names[0];
519 };
520
521 /**
522  * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl
523  * @size:               The total size of the struct
524  * @flags:              KDBUS_ATTACH_* flags
525  * @id:                 The 64-bit ID of the connection. If set to zero, passing
526  *                      @name is required. kdbus will look up the name to determine
527  *                      the ID in this case.
528  * @offset:             Returned offset in the caller's pool buffer where the
529  *                      kdbus_name_info struct result is stored. The user must
530  *                      use KDBUS_CMD_FREE to free the allocated memory.
531  * @name:               The optional well-known name to look up. Only needed in
532  *                      case @id is zero.
533  *
534  * On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
535  * tell the user the offset in the connection pool buffer at which to find the
536  * result in a struct kdbus_conn_info.
537  */
538 struct kdbus_cmd_conn_info {
539         __u64 size;
540         __u64 flags;
541         __u64 id;
542         __u64 offset;
543         char name[0];
544 };
545
546 /**
547  * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO
548  * @size:               The total size of the struct
549  * @id:                 The connection's 64-bit ID
550  * @flags:              The connection's flags
551  * @items:              A list of struct kdbus_item
552  *
553  * Note that the user is responsible for freeing the allocated memory with
554  * the KDBUS_CMD_FREE ioctl.
555  */
556 struct kdbus_conn_info {
557         __u64 size;
558         __u64 id;
559         __u64 flags;
560         struct kdbus_item items[0];
561 };
562
563 enum {
564         _KDBUS_MATCH_NULL,
565         KDBUS_MATCH_BLOOM,              /* Matches a mask blob against KDBUS_MSG_BLOOM */
566         KDBUS_MATCH_SRC_NAME,           /* Matches a name string against KDBUS_ITEM_NAME */
567         KDBUS_MATCH_NAME_ADD,           /* Matches a name string against KDBUS_ITEM_NAME_ADD */
568         KDBUS_MATCH_NAME_REMOVE,        /* Matches a name string against KDBUS_ITEM_NAME_REMOVE */
569         KDBUS_MATCH_NAME_CHANGE,        /* Matches a name string against KDBUS_ITEM_NAME_CHANGE */
570         KDBUS_MATCH_ID_ADD,             /* Matches an ID against KDBUS_MSG_ID_ADD */
571         KDBUS_MATCH_ID_REMOVE,          /* Matches an ID against KDBUS_MSG_ID_REMOVE */
572 };
573
574 /**
575  * struct kdbus_cmd_match - struct to add or remove matches
576  * @size:               The total size of the struct
577  * @id:                 Priviledged users may (de)register matches on behalf
578  *                      of other peers.
579  *                      In other cases, set to 0.
580  * @cookie:             Userspace supplied cookie. When removing, the cookie is
581  *                      suffices as information
582  * @src_id:             The source ID to match against. Use KDBUS_MATCH_SRC_ID_ANY or
583  *                      any other value for a unique match.
584  * @items:              A list of items for additional information
585  *
586  * This structure is used with the KDBUS_CMD_ADD_MATCH and
587  * KDBUS_CMD_REMOVE_MATCH ioctl. Refer to the documentation for more
588  * information.
589  */
590 struct kdbus_cmd_match {
591         __u64 size;
592         __u64 id;
593         __u64 cookie;
594         __u64 src_id;
595         struct kdbus_item items[0];
596 };
597
598 enum {
599         KDBUS_MONITOR_ENABLE            = 1 <<  0,
600 };
601
602 /**
603  * struct kdbus_cmd_monitor - struct to enable or disable eavesdropping
604  * @id:                 Priviledged users may enable or disable the monitor feature
605  *                      on behalf of other peers
606  * @flags:              Use KDBUS_MONITOR_ENABLE to enable eavesdropping
607  *
608  * This structure is used with the KDBUS_CMD_MONITOR ioctl.
609  * Refer to the documentation for more information.
610  */
611 struct kdbus_cmd_monitor {
612         __u64 id;
613         __u64 flags;
614 };
615
616 enum {
617         /* kdbus control node commands: require unset state */
618         KDBUS_CMD_BUS_MAKE =            _IOW(KDBUS_IOC_MAGIC, 0x00, struct kdbus_cmd_bus_make),
619         KDBUS_CMD_NS_MAKE =             _IOR(KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_ns_make),
620
621         /* kdbus ep node commands: require unset state */
622         KDBUS_CMD_EP_MAKE =             _IOW(KDBUS_IOC_MAGIC, 0x20, struct kdbus_cmd_ep_make),
623         KDBUS_CMD_HELLO =               _IOWR(KDBUS_IOC_MAGIC, 0x30, struct kdbus_cmd_hello),
624
625         /* kdbus ep node commands: require connected state */
626         KDBUS_CMD_MSG_SEND =            _IOW(KDBUS_IOC_MAGIC, 0x40, struct kdbus_msg),
627         KDBUS_CMD_MSG_RECV =            _IOR(KDBUS_IOC_MAGIC, 0x41, __u64 *),
628         KDBUS_CMD_FREE =                _IOW(KDBUS_IOC_MAGIC, 0x42, __u64 *),
629
630         KDBUS_CMD_NAME_ACQUIRE =        _IOWR(KDBUS_IOC_MAGIC, 0x50, struct kdbus_cmd_name),
631         KDBUS_CMD_NAME_RELEASE =        _IOW(KDBUS_IOC_MAGIC, 0x51, struct kdbus_cmd_name),
632         KDBUS_CMD_NAME_LIST =           _IOWR(KDBUS_IOC_MAGIC, 0x52, struct kdbus_cmd_name_list),
633
634         KDBUS_CMD_CONN_INFO =           _IOWR(KDBUS_IOC_MAGIC, 0x60, struct kdbus_cmd_conn_info),
635
636         KDBUS_CMD_MATCH_ADD =           _IOW(KDBUS_IOC_MAGIC, 0x70, struct kdbus_cmd_match),
637         KDBUS_CMD_MATCH_REMOVE =        _IOW(KDBUS_IOC_MAGIC, 0x71, struct kdbus_cmd_match),
638         KDBUS_CMD_MONITOR =             _IOW(KDBUS_IOC_MAGIC, 0x72, struct kdbus_cmd_monitor),
639
640         /* kdbus ep node commands: require ep owner state */
641         KDBUS_CMD_EP_POLICY_SET =       _IOW(KDBUS_IOC_MAGIC, 0x80, struct kdbus_cmd_policy),
642
643         /* kdbus memfd commands: */
644         KDBUS_CMD_MEMFD_NEW =           _IOR(KDBUS_IOC_MAGIC, 0x90, int *),
645         KDBUS_CMD_MEMFD_SIZE_GET =      _IOR(KDBUS_IOC_MAGIC, 0x91, __u64 *),
646         KDBUS_CMD_MEMFD_SIZE_SET =      _IOW(KDBUS_IOC_MAGIC, 0x92, __u64 *),
647         KDBUS_CMD_MEMFD_SEAL_GET =      _IOR(KDBUS_IOC_MAGIC, 0x93, int *),
648         KDBUS_CMD_MEMFD_SEAL_SET =      _IO(KDBUS_IOC_MAGIC, 0x94),
649 };
650 #endif