sd-bus: sync kdbus.h (ABI break)
Sync kdbus.h once again. Two thing have changed: a) KDBUS_CMD_EP_* was renamed to KDBUS_CMD_ENDPOINT_* b) struct kdbus_cmd_hello and struct kdbus_cmd_make gained a 'features' bitfield (which is currently unused)
This commit is contained in:
parent
85614d663e
commit
40885bb29e
|
@ -1307,9 +1307,9 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The higher 32bit of the flags field are considered
|
/* The features field are considered 'incompatible flags'.
|
||||||
* 'incompatible flags'. Refuse them all for now. */
|
* Refuse them all for now. */
|
||||||
if (make->flags > 0xFFFFFFFFULL) {
|
if (make->features) {
|
||||||
safe_close(fd);
|
safe_close(fd);
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
@ -1439,14 +1439,14 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char *
|
||||||
n->size = offsetof(struct kdbus_item, str) + strlen(ep_name) + 1;
|
n->size = offsetof(struct kdbus_item, str) + strlen(ep_name) + 1;
|
||||||
strcpy(n->str, ep_name);
|
strcpy(n->str, ep_name);
|
||||||
|
|
||||||
if (ioctl(fd, KDBUS_CMD_EP_MAKE, make) < 0) {
|
if (ioctl(fd, KDBUS_CMD_ENDPOINT_MAKE, make) < 0) {
|
||||||
safe_close(fd);
|
safe_close(fd);
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The higher 32bit of the flags field are considered
|
/* The features field are considered 'incompatible flags'.
|
||||||
* 'incompatible flags'. Refuse them all for now. */
|
* Refuse them all for now. */
|
||||||
if (make->flags > 0xFFFFFFFFULL) {
|
if (make->features) {
|
||||||
safe_close(fd);
|
safe_close(fd);
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
@ -1503,7 +1503,7 @@ int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep) {
|
||||||
n = KDBUS_ITEM_NEXT(n);
|
n = KDBUS_ITEM_NEXT(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
r = ioctl(fd, KDBUS_CMD_EP_UPDATE, update);
|
r = ioctl(fd, KDBUS_CMD_ENDPOINT_UPDATE, update);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
@ -1576,7 +1576,8 @@ int bus_kernel_make_starter(
|
||||||
|
|
||||||
/* The higher 32bit of both flags fields are considered
|
/* The higher 32bit of both flags fields are considered
|
||||||
* 'incompatible flags'. Refuse them all for now. */
|
* 'incompatible flags'. Refuse them all for now. */
|
||||||
if (hello->bus_flags > 0xFFFFFFFFULL ||
|
if (hello->features ||
|
||||||
|
hello->bus_flags > 0xFFFFFFFFULL ||
|
||||||
hello->conn_flags > 0xFFFFFFFFULL)
|
hello->conn_flags > 0xFFFFFFFFULL)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
|
|
|
@ -554,6 +554,7 @@ enum kdbus_attach_flags {
|
||||||
/**
|
/**
|
||||||
* struct kdbus_cmd_hello - struct to say hello to kdbus
|
* struct kdbus_cmd_hello - struct to say hello to kdbus
|
||||||
* @size: The total size of the structure
|
* @size: The total size of the structure
|
||||||
|
* @features: Feature negotiation bitmask
|
||||||
* @conn_flags: Connection flags (KDBUS_HELLO_*).
|
* @conn_flags: Connection flags (KDBUS_HELLO_*).
|
||||||
* @attach_flags: Mask of metadata to attach to each message sent
|
* @attach_flags: Mask of metadata to attach to each message sent
|
||||||
* (KDBUS_ATTACH_*)
|
* (KDBUS_ATTACH_*)
|
||||||
|
@ -573,6 +574,7 @@ enum kdbus_attach_flags {
|
||||||
*/
|
*/
|
||||||
struct kdbus_cmd_hello {
|
struct kdbus_cmd_hello {
|
||||||
__u64 size;
|
__u64 size;
|
||||||
|
__u64 features;
|
||||||
__u64 conn_flags;
|
__u64 conn_flags;
|
||||||
__u64 attach_flags;
|
__u64 attach_flags;
|
||||||
__u64 bus_flags;
|
__u64 bus_flags;
|
||||||
|
@ -596,14 +598,16 @@ enum kdbus_make_flags {
|
||||||
/**
|
/**
|
||||||
* struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain
|
* struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain
|
||||||
* @size: The total size of the struct
|
* @size: The total size of the struct
|
||||||
|
* @features: Feature negotiation bitmask
|
||||||
* @flags: Properties for the bus/ep/domain to create
|
* @flags: Properties for the bus/ep/domain to create
|
||||||
* @items: Items describing details
|
* @items: Items describing details
|
||||||
*
|
*
|
||||||
* This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_EP_MAKE and
|
* This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_ENDPOINT_MAKE
|
||||||
* KDBUS_CMD_DOMAIN_MAKE ioctls.
|
* and KDBUS_CMD_DOMAIN_MAKE ioctls.
|
||||||
*/
|
*/
|
||||||
struct kdbus_cmd_make {
|
struct kdbus_cmd_make {
|
||||||
__u64 size;
|
__u64 size;
|
||||||
|
__u64 features;
|
||||||
__u64 flags;
|
__u64 flags;
|
||||||
struct kdbus_item items[0];
|
struct kdbus_item items[0];
|
||||||
} __attribute__((aligned(8)));
|
} __attribute__((aligned(8)));
|
||||||
|
@ -775,7 +779,7 @@ struct kdbus_cmd_match {
|
||||||
* is closed.
|
* is closed.
|
||||||
* @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a
|
* @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a
|
||||||
* new kdbus domain.
|
* new kdbus domain.
|
||||||
* @KDBUS_CMD_EP_MAKE: Creates a new named special endpoint to talk to
|
* @KDBUS_CMD_ENDPOINT_MAKE: Creates a new named special endpoint to talk to
|
||||||
* the bus. Such endpoints usually carry a more
|
* the bus. Such endpoints usually carry a more
|
||||||
* restrictive policy and grant restricted access
|
* restrictive policy and grant restricted access
|
||||||
* to specific applications.
|
* to specific applications.
|
||||||
|
@ -811,7 +815,7 @@ struct kdbus_cmd_match {
|
||||||
* @KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used to
|
* @KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used to
|
||||||
* update the metadata subscription mask and
|
* update the metadata subscription mask and
|
||||||
* policy.
|
* policy.
|
||||||
* @KDBUS_CMD_EP_UPDATE: Update the properties of a custom enpoint. Used
|
* @KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used
|
||||||
* to update the policy.
|
* to update the policy.
|
||||||
* @KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should
|
* @KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should
|
||||||
* be delivered to the connection.
|
* be delivered to the connection.
|
||||||
|
@ -822,7 +826,7 @@ enum kdbus_ioctl_type {
|
||||||
struct kdbus_cmd_make),
|
struct kdbus_cmd_make),
|
||||||
KDBUS_CMD_DOMAIN_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10,
|
KDBUS_CMD_DOMAIN_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10,
|
||||||
struct kdbus_cmd_make),
|
struct kdbus_cmd_make),
|
||||||
KDBUS_CMD_EP_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x20,
|
KDBUS_CMD_ENDPOINT_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x20,
|
||||||
struct kdbus_cmd_make),
|
struct kdbus_cmd_make),
|
||||||
|
|
||||||
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x30,
|
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x30,
|
||||||
|
@ -850,7 +854,7 @@ enum kdbus_ioctl_type {
|
||||||
KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61,
|
KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61,
|
||||||
struct kdbus_cmd_update),
|
struct kdbus_cmd_update),
|
||||||
|
|
||||||
KDBUS_CMD_EP_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x71,
|
KDBUS_CMD_ENDPOINT_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x71,
|
||||||
struct kdbus_cmd_update),
|
struct kdbus_cmd_update),
|
||||||
|
|
||||||
KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0x80,
|
KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0x80,
|
||||||
|
|
Loading…
Reference in a new issue