kdbus.h revision a2243d548830d2aff6b768a0b47a0f0a513012a5
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt/*
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Copyright (C) 2013-2014 Kay Sievers
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Copyright (C) 2013-2014 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * Copyright (C) 2013-2014 Linux Foundation
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Copyright (C) 2013-2014 Lennart Poettering
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Copyright (C) 2013-2014 Daniel Mack <daniel@zonque.org>
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Copyright (C) 2013-2014 David Herrmann <dh.herrmann@gmail.com>
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt *
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * kdbus is free software; you can redistribute it and/or modify it under
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * the terms of the GNU Lesser General Public License as published by the
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * Free Software Foundation; either version 2.1 of the License, or (at
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * your option) any later version.
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt *
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * "Everything should be made as simple as possible, but not simpler."
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * -- Albert Einstein
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt */
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt#ifndef _KDBUS_UAPI_H_
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt#define _KDBUS_UAPI_H_
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt#include <linux/ioctl.h>
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt#include <linux/types.h>
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt#define KDBUS_IOCTL_MAGIC 0x95
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt#define KDBUS_SRC_ID_KERNEL (0)
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#define KDBUS_DST_ID_NAME (0)
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering#define KDBUS_MATCH_ID_ANY (~0ULL)
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#define KDBUS_DST_ID_BROADCAST (~0ULL)
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt#define KDBUS_FLAG_KERNEL (1ULL << 63)
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering/**
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering * struct kdbus_notify_id_change - name registry change message
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen * @id: New or former owner of the name
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering * @flags: flags field from KDBUS_HELLO_*
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering *
8b43440b7ef4b81c69c31de7ff820dc07a780254Lennart Poettering * Sent from kernel to userspace when the owner or activator of
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering * a well-known name changes.
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt *
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * Attached to:
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * KDBUS_ITEM_ID_ADD
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * KDBUS_ITEM_ID_REMOVE
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering */
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flyktstruct kdbus_notify_id_change {
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 id;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 flags;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt};
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen/**
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * struct kdbus_notify_name_change - name registry change message
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * @old_id: ID and flags of former owner of a name
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * @new_id: ID and flags of new owner of a name
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * @name: Well-known name
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt *
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * Sent from kernel to userspace when the owner or activator of
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * a well-known name changes.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt *
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * Attached to:
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * KDBUS_ITEM_NAME_ADD
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * KDBUS_ITEM_NAME_REMOVE
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * KDBUS_ITEM_NAME_CHANGE
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktstruct kdbus_notify_name_change {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt struct kdbus_notify_id_change old_id;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt struct kdbus_notify_id_change new_id;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt char name[0];
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt};
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen/**
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * struct kdbus_creds - process credentials
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @uid: User ID
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @gid: Group ID
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * @pid: Process ID
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * @tid: Thread ID
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * @starttime: Starttime of the process
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani *
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * The starttime of the process PID. This is useful to detect PID overruns
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * from the client side. i.e. if you use the PID to look something up in
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * /proc/$PID/ you can afterwards check the starttime field of it, to ensure
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * you didn't run into a PID overrun.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt *
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * Attached to:
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * KDBUS_ITEM_CREDS
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt */
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flyktstruct kdbus_creds {
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 uid;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 gid;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 pid;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 tid;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 starttime;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt};
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt/**
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * struct kdbus_audit - audit information
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @sessionid: The audit session ID
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @loginuid: The audit login uid
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt *
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * Attached to:
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * KDBUS_ITEM_AUDIT
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_audit {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 sessionid;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 loginuid;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt};
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_timestamp
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @seqnum: Global per-domain message sequence number
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt * @monotonic_ns: Monotonic timestamp, in nanoseconds
4afd3348c7506dd1d36305b7bcb9feb8952b9d6bLennart Poettering * @realtime_ns: Realtime timestamp, in nanoseconds
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt *
c3e2adeaba8e043caed0ef139eeaea016bd152d0Patrik Flykt * Attached to:
c3e2adeaba8e043caed0ef139eeaea016bd152d0Patrik Flykt * KDBUS_ITEM_TIMESTAMP
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering */
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flyktstruct kdbus_timestamp {
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 seqnum;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 monotonic_ns;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 realtime_ns;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt};
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt/**
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * struct kdbus_vec - I/O vector for kdbus payload items
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering * @size: The size of the vector
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @address: Memory address of data buffer
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @offset: Offset in the in-message payload memory,
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * relative to the message head
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt *
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt * Attached to:
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * KDBUS_ITEM_PAYLOAD_VEC, KDBUS_ITEM_PAYLOAD_OFF
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt */
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flyktstruct kdbus_vec {
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 size;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt union {
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen __u64 address;
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen __u64 offset;
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen };
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen};
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen/**
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen * struct kdbus_bloom_parameter - bus-wide bloom parameters
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen * @size: Size of the bit field in bytes (m / 8)
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen * @n_hash: Number of hash functions used (k)
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen */
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersenstruct kdbus_bloom_parameter {
c601ebf79f0c54be14d3c16f0f484c0335cdeec4Tom Gundersen __u64 size;
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering __u64 n_hash;
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering};
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering/**
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering * struct kdbus_bloom_filter - bloom filter containing n elements
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @generation: Generation of the element set in the filter
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * @data: Bit field, multiple of 8 bytes
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams */
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williamsstruct kdbus_bloom_filter {
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams __u64 generation;
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt __u64 data[0];
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt};
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams/**
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * struct kdbus_memfd - a kdbus memfd
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * @size: The memfd's size
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * @fd: The file descriptor number
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * @__pad: Padding to ensure proper alignment and size
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams *
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * Attached to:
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams * KDBUS_ITEM_PAYLOAD_MEMFD
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams */
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williamsstruct kdbus_memfd {
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams __u64 size;
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams int fd;
76253e73f9c9c24fec755e485516f3b55d0707b4Dan Williams __u32 __pad;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt};
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt/**
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt * struct kdbus_name - a registered well-known name with its flags
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering * @flags: Flags from KDBUS_NAME_*
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Haller * @name: Well-known name
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Haller *
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering * Attached to:
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Haller * KDBUS_ITEM_NAME
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Haller */
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Hallerstruct kdbus_name {
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering __u64 flags;
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering char name[0];
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering};
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams/**
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * struct kdbus_policy_access - policy access item
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @type: One of KDBUS_POLICY_ACCESS_* types
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @access: Access to grant
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt * @id: For KDBUS_POLICY_ACCESS_USER, the uid
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt * For KDBUS_POLICY_ACCESS_GROUP, the gid
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen */
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersenstruct kdbus_policy_access {
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen __u64 type; /* USER, GROUP, WORLD */
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen __u64 access; /* OWN, TALK, SEE */
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen __u64 id; /* uid, gid, 0 */
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen};
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen/**
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * enum kdbus_item_type - item types to chain data in a list
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @_KDBUS_ITEM_NULL: Uninitialized/invalid
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen * @_KDBUS_ITEM_USER_BASE: Start of user items
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_PAYLOAD_VEC: Vector to data
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen * @KDBUS_ITEM_FDS: Attached file descriptors
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_BLOOM_PARAMETER: Bus-wide bloom parameters, used with
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * KDBUS_CMD_BUS_MAKE, carries a
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * struct kdbus_bloom_parameter
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_BLOOM_FILTER: Bloom filter carried with a message, used to
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * match against a bloom mask of a connection,
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * carries a struct kdbus_bloom_filter
fe4b2156256c5bdf52341576571ce9f095d9f085Tom Gundersen * @KDBUS_ITEM_BLOOM_MASK: Bloom mask used to match against a message's
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen * bloom filter
ebe207d4acf38165adbc45298662982eecdb9e9fTom Gundersen * @KDBUS_ITEM_DST_NAME: Destination's well-known name
764aad6258eec3bd4ae62ea341ea507bd69ce628Tom Gundersen * @KDBUS_ITEM_MAKE_NAME: Name of domain, bus, endpoint
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @KDBUS_ITEM_ATTACH_FLAGS: Attach-flags, used for updating which metadata
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * a connection subscribes to
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @_KDBUS_ITEM_ATTACH_BASE: Start of metadata attach items
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @KDBUS_ITEM_NAME: Well-know name with flags
04c0136989b7eb896bfb0fb176e11233d69e1453Lennart Poettering * @KDBUS_ITEM_ID: Connection ID
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_TIMESTAMP: Timestamp
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt * @KDBUS_ITEM_CREDS: Process credential
d7c9c21f18704580f66a1ce73fb6b506fdf40732Patrik Flykt * @KDBUS_ITEM_AUXGROUPS: Auxiliary process groups
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_PID_COMM: Process ID "comm" identifier
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_TID_COMM: Thread ID "comm" identifier
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_EXE: The path of the executable
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_CMDLINE: The process command line
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_CGROUP: The croup membership
04c0136989b7eb896bfb0fb176e11233d69e1453Lennart Poettering * @KDBUS_ITEM_CAPS: The process capabilities
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_SECLABEL: The security label
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_AUDIT: The audit IDs
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_CONN_NAME: The connection's human-readable name (debugging)
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @_KDBUS_ITEM_POLICY_BASE: Start of policy items
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_POLICY_ACCESS: Policy access block
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @_KDBUS_ITEM_KERNEL_BASE: Start of kernel-generated message items
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_NAME_ADD: Notify in struct kdbus_notify_name_change
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ITEM_NAME_REMOVE: Notify in struct kdbus_notify_name_change
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering * @KDBUS_ITEM_NAME_CHANGE: Notify in struct kdbus_notify_name_change
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * @KDBUS_ITEM_ID_ADD: Notify in struct kdbus_notify_id_change
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * @KDBUS_ITEM_ID_REMOVE: Notify in struct kdbus_notify_id_change
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * @KDBUS_ITEM_REPLY_TIMEOUT: Timeout has been reached
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * @KDBUS_ITEM_REPLY_DEAD: Destination died
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt */
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flyktenum kdbus_item_type {
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani _KDBUS_ITEM_NULL,
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani _KDBUS_ITEM_USER_BASE,
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani KDBUS_ITEM_PAYLOAD_VEC = _KDBUS_ITEM_USER_BASE,
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani KDBUS_ITEM_PAYLOAD_OFF,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_PAYLOAD_MEMFD,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_FDS,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_BLOOM_PARAMETER,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_BLOOM_FILTER,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_BLOOM_MASK,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_DST_NAME,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_MAKE_NAME,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_ATTACH_FLAGS,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt _KDBUS_ITEM_ATTACH_BASE = 0x1000,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_NAME = _KDBUS_ITEM_ATTACH_BASE,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_ID,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_TIMESTAMP,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_CREDS,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_AUXGROUPS,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_PID_COMM,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_TID_COMM,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_EXE,
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt KDBUS_ITEM_CMDLINE,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_CGROUP,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_CAPS,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_SECLABEL,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_AUDIT,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_CONN_NAME,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt
3098562c9236fe0bd3e7d950b6c53907304d277fTom Gundersen _KDBUS_ITEM_POLICY_BASE = 0x2000,
3098562c9236fe0bd3e7d950b6c53907304d277fTom Gundersen KDBUS_ITEM_POLICY_ACCESS = _KDBUS_ITEM_POLICY_BASE,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt _KDBUS_ITEM_KERNEL_BASE = 0x8000,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_NAME_ADD = _KDBUS_ITEM_KERNEL_BASE,
ea3b3a75abb3f8b853f7da454b9b8e258a120eeaPatrik Flykt KDBUS_ITEM_NAME_REMOVE,
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt KDBUS_ITEM_NAME_CHANGE,
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt KDBUS_ITEM_ID_ADD,
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt KDBUS_ITEM_ID_REMOVE,
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt KDBUS_ITEM_REPLY_TIMEOUT,
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt KDBUS_ITEM_REPLY_DEAD,
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller};
4e3e6679e8f73b83d38e4b20d8b025e12991d1cbPatrik Flykt
4e3e6679e8f73b83d38e4b20d8b025e12991d1cbPatrik Flykt/**
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * struct kdbus_item - chain of data blocks
4e3e6679e8f73b83d38e4b20d8b025e12991d1cbPatrik Flykt * @size: Overall data record size
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @type: Kdbus_item type of data
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @data: Generic bytes
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @data32: Generic 32 bit array
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @data64: Generic 64 bit array
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @str: Generic string
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @id: Connection ID
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller * @vec: KDBUS_ITEM_PAYLOAD_VEC
4e3e6679e8f73b83d38e4b20d8b025e12991d1cbPatrik Flykt * @creds: KDBUS_ITEM_CREDS
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @audit: KDBUS_ITEM_AUDIT
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @timestamp: KDBUS_ITEM_TIMESTAMP
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @name: KDBUS_ITEM_NAME
c806ffb9592fa9a2b13a1f9f9be4c77cd5b211aaZbigniew Jędrzejewski-Szmek * @bloom_parameter: KDBUS_ITEM_BLOOM_PARAMETER
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @bloom_filter: KDBUS_ITEM_BLOOM_FILTER
c3e2adeaba8e043caed0ef139eeaea016bd152d0Patrik Flykt * @memfd: KDBUS_ITEM_PAYLOAD_MEMFD
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * @name_change: KDBUS_ITEM_NAME_ADD
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * KDBUS_ITEM_NAME_REMOVE
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * KDBUS_ITEM_NAME_CHANGE
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * @id_change: KDBUS_ITEM_ID_ADD
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * KDBUS_ITEM_ID_REMOVE
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * @policy: KDBUS_ITEM_POLICY_ACCESS
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktstruct kdbus_item {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 size;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 type;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt union {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u8 data[0];
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u32 data32[0];
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 data64[0];
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt char str[0];
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt __u64 id;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt struct kdbus_vec vec;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt struct kdbus_creds creds;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt struct kdbus_audit audit;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt struct kdbus_timestamp timestamp;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt struct kdbus_name name;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt struct kdbus_bloom_parameter bloom_parameter;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt struct kdbus_bloom_filter bloom_filter;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt struct kdbus_memfd memfd;
3f0c075f8ef3344da5a6bda524540201f9204e61Patrik Flykt int fds[0];
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt struct kdbus_notify_name_change name_change;
139b011ab81ccea1d51f09e0261a1c390115c6ffPatrik Flykt struct kdbus_notify_id_change id_change;
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt struct kdbus_policy_access policy_access;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt };
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt};
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt/**
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * enum kdbus_msg_flags - type of message
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @KDBUS_MSG_FLAGS_EXPECT_REPLY: Expect a reply message, used for
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * method calls. The userspace-supplied
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * cookie identifies the message and the
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * respective reply carries the cookie
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * in cookie_reply
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @KDBUS_MSG_FLAGS_SYNC_REPLY: Wait for destination connection to
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * reply to this message. The
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * KDBUS_CMD_MSG_SEND ioctl() will block
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * until the reply is received, and
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * offset_reply in struct kdbus_msg will
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * yield the offset in the sender's pool
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * where the reply can be found.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * This flag is only valid if
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @KDBUS_MSG_FLAGS_EXPECT_REPLY is set as
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * well.
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_MSG_FLAGS_NO_AUTO_START: Do not start a service, if the addressed
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * name is not currently active
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt */
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flyktenum kdbus_msg_flags {
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt KDBUS_MSG_FLAGS_EXPECT_REPLY = 1ULL << 0,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_MSG_FLAGS_SYNC_REPLY = 1ULL << 1,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_MSG_FLAGS_NO_AUTO_START = 1ULL << 2,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt};
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani/**
926695f1b5f9395eeb416cc2f478a9cf75fdbeb4Thomas Hindoe Paaboel Andersen * enum kdbus_payload_type - type of payload carried by message
926695f1b5f9395eeb416cc2f478a9cf75fdbeb4Thomas Hindoe Paaboel Andersen * @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus"
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt */
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flyktenum kdbus_payload_type {
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_PAYLOAD_KERNEL,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL,
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt};
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt/**
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * struct kdbus_msg - the representation of a kdbus message
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @size: Total size of the message
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @flags: Message flags (KDBUS_MSG_FLAGS_*)
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @priority: Message queue priority value
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @dst_id: 64-bit ID of the destination connection
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @src_id: 64-bit ID of the source connection
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @payload_type: Payload type (KDBUS_PAYLOAD_*)
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * @cookie: Userspace-supplied cookie, for the connection
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * to identify its messages
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @timeout_ns: The time to wait for a message reply from the peer.
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * If there is no reply, a kernel-generated message
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * with an attached KDBUS_ITEM_REPLY_TIMEOUT item
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * is sent to @src_id.
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @cookie_reply: A reply to the requesting message with the same
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * cookie. The requesting connection can match its
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * request and the reply with this value
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @offset_reply: If KDBUS_MSG_FLAGS_EXPECT_REPLY, this field will
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * contain the offset in the sender's pool where the
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * reply is stored.
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @items: A list of kdbus_items containing the message payload
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt */
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flyktstruct kdbus_msg {
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 size;
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 flags;
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __s64 priority;
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 dst_id;
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 src_id;
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 payload_type;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 cookie;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt union {
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 timeout_ns;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 cookie_reply;
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt __u64 offset_reply;
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani };
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt struct kdbus_item items[0];
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt} __attribute__((aligned(8)));
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt/**
da6fe470e17fa02f3adedc779585caf8669252bdPatrik Flykt * enum kdbus_recv_flags - flags for de-queuing messages
cc22955cfefb4bd6e7a135f1ec95fb5a07ba9ce3Thomas Haller * @KDBUS_RECV_PEEK: Return the next queued message without
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * actually de-queuing it, and without installing
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * any file descriptors or other resources. It is
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * usually used to determine the activating
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * connection of a bus name.
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_RECV_DROP: Drop and free the next queued message and all
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * its resources without actually receiving it.
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * @KDBUS_RECV_USE_PRIORITY: Only de-queue messages with the specified or
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * higher priority (lowest values); if not set,
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * the priority value is ignored.
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt */
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flyktenum kdbus_recv_flags {
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani KDBUS_RECV_PEEK = 1ULL << 0,
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt KDBUS_RECV_DROP = 1ULL << 1,
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt KDBUS_RECV_USE_PRIORITY = 1ULL << 2,
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt};
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt/**
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * struct kdbus_cmd_recv - struct to de-queue a buffered message
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @flags: KDBUS_RECV_* flags
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @priority: Minimum priority of the messages to de-queue. Lowest
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * values have the highest priority.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * @offset: Returned offset in the pool where the message is
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * stored. The user must use KDBUS_CMD_FREE to free
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * the allocated memory.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt *
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt * This struct is used with the KDBUS_CMD_MSG_RECV ioctl.
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt */
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flyktstruct kdbus_cmd_recv {
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __u64 flags;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __s64 priority;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __u64 offset;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt} __attribute__((aligned(8)));
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt/**
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * struct kdbus_cmd_cancel - struct to cancel a synchronously pending message
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @cookie The cookie of the pending message
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @flags Flags for the free command. Currently unused.
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt *
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * This struct is used with the KDBUS_CMD_CANCEL ioctl.
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt */
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flyktstruct kdbus_cmd_cancel {
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt __u64 cookie;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __u64 flags;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt} __attribute__((aligned(8)));
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt/**
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * struct kdbus_cmd_free - struct to free a slice of memory in the pool
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @offset The offset of the memory slice, as returned by other
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * ioctls
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @flags Flags for the free command. Currently unused.
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt *
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * This struct is used with the KDBUS_CMD_FREE ioctl.
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt */
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flyktstruct kdbus_cmd_free {
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __u64 offset;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt __u64 flags;
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt} __attribute__((aligned(8)));
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt/**
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * enum kdbus_policy_access_type - permissions of a policy record
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @KDBUS_POLICY_ACCESS_USER: Grant access to a uid
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_POLICY_ACCESS_WORLD: World-accessible
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktenum kdbus_policy_access_type {
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt _KDBUS_POLICY_ACCESS_NULL,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_POLICY_ACCESS_USER,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_POLICY_ACCESS_GROUP,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_POLICY_ACCESS_WORLD,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt};
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * enum kdbus_policy_access_flags - mode flags
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @KDBUS_POLICY_OWN: Allow to own a well-known name
10c9ce615d98e125bc520efa94aebaef250a4061David Herrmann * Implies KDBUS_POLICY_TALK and KDBUS_POLICY_SEE
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_POLICY_TALK: Allow communication to a well-known name
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * Implies KDBUS_POLICY_SEE
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @KDBUS_POLICY_SEE: Allow to see a well-known name
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt */
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flyktenum kdbus_policy_type {
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_POLICY_SEE = 0,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_POLICY_TALK,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_POLICY_OWN,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt};
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * enum kdbus_hello_flags - flags for struct kdbus_cmd_hello
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_HELLO_ACCEPT_FD: The connection allows the reception of
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * any passed file descriptors
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_HELLO_ACTIVATOR: Special-purpose connection which registers
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * a well-know name for a process to be started
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * when traffic arrives
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_HELLO_POLICY_HOLDER: Special-purpose connection which registers
4b4923e65423e60d755841b5b264730e8f3deab3Tom Gundersen * policy entries for a name. The provided name
5e91345094a9e983e7abb2313334e7808bcd2cc2Tom Gundersen * is not activated and not registered with the
513a6fa8679510ea1b55967bdb482dd5f8a39f21Ronny Chevalier * name database, it only allows unprivileged
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * connections to aquire a name, talk or discover
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * a service
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_HELLO_MONITOR: Special-purpose connection to monitor
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * bus traffic
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktenum kdbus_hello_flags {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_HELLO_ACCEPT_FD = 1ULL << 0,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_HELLO_ACTIVATOR = 1ULL << 1,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_HELLO_POLICY_HOLDER = 1ULL << 2,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_HELLO_MONITOR = 1ULL << 3,
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt};
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt/**
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * enum kdbus_attach_flags - flags for metadata attachments
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ATTACH_TIMESTAMP: Timestamp
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_ATTACH_CREDS: Credentials
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_ATTACH_AUXGROUPS: Auxiliary groups
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_NAMES: Well-known names
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_COMM_TID: The "comm" process identifier of the TID
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_COMM_PID: The "comm" process identifier of the PID
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_EXE: The path of the executable
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_CMDLINE: The process command line
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt * @KDBUS_ATTACH_CGROUP: The croup membership
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_ATTACH_CAPS: The process capabilities
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_ATTACH_SECLABEL: The security label
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_ATTACH_AUDIT: The audit IDs
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_ATTACH_CONN_NAME: The human-readable connection name
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @_KDBUS_ATTACH_ALL: All of the above
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt */
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flyktenum kdbus_attach_flags {
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt KDBUS_ATTACH_TIMESTAMP = 1ULL << 0,
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt KDBUS_ATTACH_CREDS = 1ULL << 1,
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt KDBUS_ATTACH_AUXGROUPS = 1ULL << 2,
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt KDBUS_ATTACH_NAMES = 1ULL << 3,
7246333cb803b03440d3bd0bdaa233564d09b5aePatrik Flykt KDBUS_ATTACH_TID_COMM = 1ULL << 4,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_PID_COMM = 1ULL << 5,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_EXE = 1ULL << 6,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_CMDLINE = 1ULL << 7,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_CGROUP = 1ULL << 8,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_CAPS = 1ULL << 9,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_SECLABEL = 1ULL << 10,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_AUDIT = 1ULL << 11,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt KDBUS_ATTACH_CONN_NAME = 1ULL << 12,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt _KDBUS_ATTACH_ALL = (1ULL << 13) - 1,
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt};
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt/**
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * struct kdbus_cmd_hello - struct to say hello to kdbus
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @size: The total size of the structure
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @conn_flags: Connection flags (KDBUS_HELLO_*).
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @attach_flags: Mask of metadata to attach to each message sent
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * (KDBUS_ATTACH_*)
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @bus_flags: The flags field copied verbatim from the original
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * KDBUS_CMD_BUS_MAKE ioctl. It's intended to be useful
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * to do negotiation of features of the payload that is
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * transferred (kernel → userspace)
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @id: The ID of this connection (kernel → userspace)
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @pool_size: Size of the connection's buffer where the received
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * messages are placed
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * @bloom: The bloom properties of the bus, specified
3dc34fcc97b41f8b7b019027225b121dfbb9871dPatrik Flykt * by the bus creator (kernel → userspace)
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @id128: Unique 128-bit ID of the bus (kernel → userspace)
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt * @items: A list of items
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt *
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * This struct is used with the KDBUS_CMD_HELLO ioctl.
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktstruct kdbus_cmd_hello {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 size;
10c9ce615d98e125bc520efa94aebaef250a4061David Herrmann __u64 conn_flags;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 attach_flags;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 bus_flags;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 id;
fa94c34b083b5b4019975624453e53d0cbad2a5dTom Gundersen __u64 pool_size;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt struct kdbus_bloom_parameter bloom;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u8 id128[16];
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt struct kdbus_item items[0];
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt} __attribute__((aligned(8)));
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt/**
346e13a25dc6f76d3bc9d8decd40dc4782b02d2aPatrik Flykt * enum kdbus_make_flags - Flags for KDBUS_CMD_{BUS,EP,NS}_MAKE
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_MAKE_ACCESS_GROUP: Make the device node group-accessible
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_MAKE_ACCESS_WORLD: Make the device node world-accessible
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flyktenum kdbus_make_flags {
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_MAKE_ACCESS_GROUP = 1ULL << 0,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt KDBUS_MAKE_ACCESS_WORLD = 1ULL << 1,
a9aff3615b430f86bd0a824214d95f634efaf894Patrik Flykt};
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @size: The total size of the struct
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @flags: Properties for the bus/ep/domain to create
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @items: Items describing details
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt *
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_ENDPOINT_MAKE
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * and KDBUS_CMD_DOMAIN_MAKE ioctls.
ed19c567e5fcdcec1a2b6dbac63787e001ad5d55Tom Gundersen */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktstruct kdbus_cmd_make {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 size;
fa94c34b083b5b4019975624453e53d0cbad2a5dTom Gundersen __u64 flags;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt struct kdbus_item items[0];
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt} __attribute__((aligned(8)));
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * enum kdbus_name_flags - properties of a well-known name
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_REPLACE_EXISTING: Try to replace name of other connections
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_ALLOW_REPLACEMENT: Allow the replacement of the name
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_QUEUE: Name should be queued if busy
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_IN_QUEUE: Name is queued
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_ACTIVATOR: Name is owned by a activator connection
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
356779df90a2ecab5da2cb310ad0f8ebc9ca9f46Lennart Poetteringenum kdbus_name_flags {
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen KDBUS_NAME_REPLACE_EXISTING = 1ULL << 0,
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen KDBUS_NAME_ALLOW_REPLACEMENT = 1ULL << 1,
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen KDBUS_NAME_QUEUE = 1ULL << 2,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_NAME_IN_QUEUE = 1ULL << 3,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt KDBUS_NAME_ACTIVATOR = 1ULL << 4,
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt};
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * struct kdbus_cmd_name - struct to describe a well-known name
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @size: The total size of the struct
fa94c34b083b5b4019975624453e53d0cbad2a5dTom Gundersen * @flags: Flags for a name entry (KDBUS_NAME_*)
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @owner_id: The current owner of the name
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @conn_flags: The flags of the owning connection (KDBUS_HELLO_*)
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @items: Item list, containing the well-known name as
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * KDBUS_ITEM_NAME
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt *
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * This structure is used with the KDBUS_CMD_NAME_ACQUIRE ioctl.
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktstruct kdbus_cmd_name {
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 size;
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt __u64 flags;
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen __u64 owner_id;
356779df90a2ecab5da2cb310ad0f8ebc9ca9f46Lennart Poettering __u64 conn_flags;
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen struct kdbus_item items[0];
9021bb9f935c93b516b10c88db2a212a9e3a8140Tom Gundersen} __attribute__((aligned(8)));
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt/**
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * enum kdbus_name_list_flags - what to include into the returned list
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_LIST_UNIQUE: All active connections
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_LIST_NAMES: All known well-known names
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_LIST_ACTIVATORS: All activator connections
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt * @KDBUS_NAME_LIST_QUEUED: All queued-up names
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flykt */
d1b0afe3653b4316a6361d204169620726d468a0Patrik Flyktenum kdbus_name_list_flags {
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt KDBUS_NAME_LIST_UNIQUE = 1ULL << 0,
cfb5b3805759e63dc5e0cae6e92e1df885b5c5b6Tom Gundersen KDBUS_NAME_LIST_NAMES = 1ULL << 1,
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt KDBUS_NAME_LIST_ACTIVATORS = 1ULL << 2,
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt KDBUS_NAME_LIST_QUEUED = 1ULL << 3,
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt};
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt/**
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * struct kdbus_cmd_name_list - request a list of name entries
cfb5b3805759e63dc5e0cae6e92e1df885b5c5b6Tom Gundersen * @flags: Flags for the query (KDBUS_NAME_LIST_*)
cfb5b3805759e63dc5e0cae6e92e1df885b5c5b6Tom Gundersen * @offset: The returned offset in the caller's pool buffer.
cfb5b3805759e63dc5e0cae6e92e1df885b5c5b6Tom Gundersen * The user must use KDBUS_CMD_FREE to free the
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * allocated memory.
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt *
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt * This structure is used with the KDBUS_CMD_NAME_LIST ioctl.
f12abb48fc510b8b349c05e35ba048134debaf25Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_cmd_name_list {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 flags;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 offset;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt} __attribute__((aligned(8)));
44481a8b537839cd9ffead4d261491641f5b5260Zbigniew Jędrzejewski-Szmek
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_name_list - information returned by KDBUS_CMD_NAME_LIST
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @size: The total size of the structure
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @names: A list of names
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt *
44481a8b537839cd9ffead4d261491641f5b5260Zbigniew Jędrzejewski-Szmek * Note that the user is responsible for freeing the allocated memory with
44481a8b537839cd9ffead4d261491641f5b5260Zbigniew Jędrzejewski-Szmek * the KDBUS_CMD_FREE ioctl.
44481a8b537839cd9ffead4d261491641f5b5260Zbigniew Jędrzejewski-Szmek */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_name_list {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 size;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_cmd_name names[0];
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani};
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @size: The total size of the struct
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @flags: KDBUS_ATTACH_* flags
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @id: The 64-bit ID of the connection. If set to zero, passing
66eac1201a9c1596f5901f8dbbf24bda7e350878Dan Williams * @name is required. kdbus will look up the name to
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * determine the ID in this case.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @offset: Returned offset in the caller's pool buffer where the
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * kdbus_conn_info struct result is stored. The user must
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * use KDBUS_CMD_FREE to free the allocated memory.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @name: The optional well-known name to look up. Only needed in
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * case @id is zero.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt *
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * tell the user the offset in the connection pool buffer at which to find the
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * result in a struct kdbus_conn_info.
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_cmd_conn_info {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 size;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 flags;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 id;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 offset;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_item items[0];
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt} __attribute__((aligned(8)));
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @size: The total size of the struct
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @id: The connection's 64-bit ID
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @flags: The connection's flags
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * @items: A list of struct kdbus_item
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt *
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * Note that the user is responsible for freeing the allocated memory with
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * the KDBUS_CMD_FREE ioctl.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_conn_info {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 size;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 id;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 flags;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_item items[0];
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani};
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_cmd_update - update flags of a connection
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @size: The total size of the struct
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @items: A list of struct kdbus_item
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt *
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * This struct is used with the KDBUS_CMD_CONN_UPDATE ioctl.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_cmd_update {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 size;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 flags;
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_item items[0];
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt} __attribute__((aligned(8)));
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt/**
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * enum kdbus_cmd_match_flags - flags to control the KDBUS_CMD_MATCH_ADD ioctl
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_MATCH_REPLACE: If entries with the supplied cookie already
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * exists, remove them before installing the new
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * matches.
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktenum kdbus_cmd_match_flags {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt KDBUS_MATCH_REPLACE = 1ULL << 0,
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt};
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt/**
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * struct kdbus_cmd_match - struct to add or remove matches
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @size: The total size of the struct
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @cookie: Userspace supplied cookie. When removing, the cookie
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * identifies the match to remove
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @items: A list of items for additional information
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt *
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * This structure is used with the KDBUS_CMD_ADD_MATCH and
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * KDBUS_CMD_REMOVE_MATCH ioctl.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktstruct kdbus_cmd_match {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt __u64 size;
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt __u64 cookie;
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani __u64 flags;
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_item items[0];
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt} __attribute__((aligned(8)));
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt/**
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt * enum kdbus_ioctl_type - Ioctl API
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * @KDBUS_CMD_BUS_MAKE: After opening the "control" device node, this
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * command creates a new bus with the specified
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * name. The bus is immediately shut down and
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * cleaned up when the opened "control" device node
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * is closed.
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a
7bd8e95d44977833d0de3fc4e893eb3bc84351d6Patrik Flykt * new kdbus domain.
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * @KDBUS_CMD_ENDPOINT_MAKE: Creates a new named special endpoint to talk to
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * the bus. Such endpoints usually carry a more
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * restrictive policy and grant restricted access
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * to specific applications.
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * @KDBUS_CMD_HELLO: By opening the bus device node a connection is
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * created. After a HELLO the opened connection
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * becomes an active peer on the bus.
5da1b97f3c3d15521f2dcfbc18eccd6580122ebcPatrik Flykt * @KDBUS_CMD_BYEBYE: Disconnect a connection. If there are no
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * messages queued up in the connection's pool,
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * the call succeeds, and the handle is rendered
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * unusable. Otherwise, -EBUSY is returned without
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * any further side-effects.
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * @KDBUS_CMD_MSG_SEND: Send a message and pass data from userspace to
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * the kernel.
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * @KDBUS_CMD_MSG_RECV: Receive a message from the kernel which is
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517Beniamino Galvani * placed in the receiver's pool.
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * @KDBUS_CMD_MSG_CANCEL: Cancel a pending request of a message that
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * blocks while waiting for a reply. The parameter
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * denotes the cookie of the message in flight.
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * @KDBUS_CMD_FREE: Release the allocated memory in the receiver's
41e4615d4f4f5c61afa84ba857f23c0ac496687bPatrik Flykt * pool.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @KDBUS_CMD_NAME_ACQUIRE: Request a well-known bus name to associate with
6599680e2d33597f0f11a99e1c3c957b42418568Patrik Flykt * the connection. Well-known names are used to
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * address a peer on the bus.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @KDBUS_CMD_NAME_RELEASE: Release a well-known name the connection
c47e8936a43ce546e8a74fa569e9fbfae6c64be7Patrik Flykt * currently owns.
c47e8936a43ce546e8a74fa569e9fbfae6c64be7Patrik Flykt * @KDBUS_CMD_NAME_LIST: Retrieve the list of all currently registered
c47e8936a43ce546e8a74fa569e9fbfae6c64be7Patrik Flykt * well-known and unique names.
c47e8936a43ce546e8a74fa569e9fbfae6c64be7Patrik Flykt * @KDBUS_CMD_CONN_INFO: Retrieve credentials and properties of the
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * initial creator of the connection. The data was
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * stored at registration time and does not
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * necessarily represent the connected process or
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * the actual state of the process.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used to
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * update the metadata subscription mask and
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * policy.
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * to update the policy.
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * @KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should
bbfa43ca37df0718287c25a8e39ee7477ebf33f6Patrik Flykt * be delivered to the connection.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt * @KDBUS_CMD_MATCH_REMOVE: Remove a current match for broadcast messages.
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flyktenum kdbus_ioctl_type {
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x00,
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering struct kdbus_cmd_make),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_DOMAIN_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10,
4afd3348c7506dd1d36305b7bcb9feb8952b9d6bLennart Poettering struct kdbus_cmd_make),
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_ENDPOINT_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x20,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_make),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x30,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_hello),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_BYEBYE = _IO(KDBUS_IOCTL_MAGIC, 0x31),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_MSG_SEND = _IOWR(KDBUS_IOCTL_MAGIC, 0x40,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_msg),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_MSG_RECV = _IOWR(KDBUS_IOCTL_MAGIC, 0x41,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_recv),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_MSG_CANCEL = _IOW(KDBUS_IOCTL_MAGIC, 0x42,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_cancel),
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_FREE = _IOW(KDBUS_IOCTL_MAGIC, 0x43,
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_cmd_free),
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOCTL_MAGIC, 0x50,
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_cmd_name),
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOCTL_MAGIC, 0x51,
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_cmd_name),
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOCTL_MAGIC, 0x52,
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_cmd_name_list),
f89087272b5561c9a3fc9d6a4e2a09f75f688fa7Thomas Haller
9d89d1ae71cb298218e35a69d6b70e2c94de5271Patrik Flykt KDBUS_CMD_CONN_INFO = _IOWR(KDBUS_IOCTL_MAGIC, 0x60,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_conn_info),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61,
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt struct kdbus_cmd_update),
a34b57c0d43b8bf819ccd4f62c314b41b625454dPatrik Flykt
0ae0e5cd96813bacad43a39920a043d8d20a67dbLennart Poettering KDBUS_CMD_ENDPOINT_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x71,
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_cmd_update),
4afd3348c7506dd1d36305b7bcb9feb8952b9d6bLennart Poettering
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0x80,
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt struct kdbus_cmd_match),
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOCTL_MAGIC, 0x81,
ed6ee21953dac9c78383da00bc4514ece6b75ab5Patrik Flykt struct kdbus_cmd_match),
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt};
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt#endif /* _KDBUS_UAPI_H_ */
631bbe71298ec892f77f44f94feb612646fe6853Patrik Flykt