Avoid abbr. and rename EP → ENDPOINT.
Signed-off-by: Daniel Mack <daniel@zonque.org>
* your option) any later version.
*/
-#ifndef __KDBUS_EP_H
-#define __KDBUS_EP_H
+#ifndef __KDBUS_ENDPOINT_H
+#define __KDBUS_ENDPOINT_H
#include <linux/device.h>
#include "limits.h"
* @KDBUS_HANDLE_CONTROL_DOMAIN_OWNER: File descriptor to hold a domain
* @KDBUS_HANDLE_CONTROL_BUS_OWNER: File descriptor to hold a bus
* @KDBUS_HANDLE_EP: New file descriptor of a bus node
- * @KDBUS_HANDLE_EP_CONNECTED: A bus connection after HELLO
- * @KDBUS_HANDLE_EP_OWNER: File descriptor to hold an endpoint
+ * @KDBUS_HANDLE_ENDPOINT_CONNECTED: A bus connection after HELLO
+ * @KDBUS_HANDLE_ENDPOINT_OWNER: File descriptor to hold an endpoint
*/
enum kdbus_handle_type {
_KDBUS_HANDLE_NULL,
KDBUS_HANDLE_CONTROL_DOMAIN_OWNER,
KDBUS_HANDLE_CONTROL_BUS_OWNER,
KDBUS_HANDLE_EP,
- KDBUS_HANDLE_EP_CONNECTED,
- KDBUS_HANDLE_EP_OWNER,
+ KDBUS_HANDLE_ENDPOINT_CONNECTED,
+ KDBUS_HANDLE_ENDPOINT_OWNER,
};
/**
* @domain: Domain for this handle
* @meta: Cached connection creator's metadata/credentials
* @ep: The endpoint for this handle, in case @type is
- * KDBUS_HANDLE_EP, KDBUS_HANDLE_EP_OWNER or
- * KDBUS_HANDLE_EP_CONNECTED
+ * KDBUS_HANDLE_EP, KDBUS_HANDLE_ENDPOINT_OWNER or
+ * KDBUS_HANDLE_ENDPOINT_CONNECTED
* @ptr: Generic pointer used as alias for other members
* in the same union by kdbus_handle_transform()
* @domain_owner: The domain this handle owns, in case @type
* @bus_owner: The bus this handle owns, in case @type
* is KDBUS_HANDLE_CONTROL_BUS_OWNER
* @ep_owner: The endpoint this handle owns, in case @type
- * is KDBUS_HANDLE_EP_OWNER
+ * is KDBUS_HANDLE_ENDPOINT_OWNER
* @conn: The connection this handle owns, in case @type
* is KDBUS_HANDLE_EP, after HELLO it is
- * KDBUS_HANDLE_EP_CONNECTED
+ * KDBUS_HANDLE_ENDPOINT_CONNECTED
*/
struct kdbus_handle {
enum kdbus_handle_type type;
kdbus_bus_unref(handle->bus_owner);
break;
- case KDBUS_HANDLE_EP_OWNER:
+ case KDBUS_HANDLE_ENDPOINT_OWNER:
kdbus_ep_disconnect(handle->ep_owner);
kdbus_ep_unref(handle->ep_owner);
break;
- case KDBUS_HANDLE_EP_CONNECTED:
+ case KDBUS_HANDLE_ENDPOINT_CONNECTED:
kdbus_conn_disconnect(handle->conn, false);
kdbus_conn_unref(handle->conn);
break;
long ret = 0;
switch (cmd) {
- case KDBUS_CMD_EP_MAKE: {
+ case KDBUS_CMD_ENDPOINT_MAKE: {
struct kdbus_cmd_make *make;
umode_t mode = 0;
kgid_t gid = KGIDT_INIT(0);
/* turn the ep fd into a new endpoint owner device */
ret = kdbus_handle_transform(handle, KDBUS_HANDLE_EP,
- KDBUS_HANDLE_EP_OWNER, ep);
+ KDBUS_HANDLE_ENDPOINT_OWNER, ep);
if (ret < 0) {
kdbus_ep_disconnect(ep);
kdbus_ep_unref(ep);
/* turn the ep fd into a new connection */
ret = kdbus_handle_transform(handle, KDBUS_HANDLE_EP,
- KDBUS_HANDLE_EP_CONNECTED,
+ KDBUS_HANDLE_ENDPOINT_CONNECTED,
conn);
if (ret < 0) {
kdbus_conn_disconnect(conn, false);
long ret = 0;
switch (cmd) {
- case KDBUS_CMD_EP_UPDATE: {
+ case KDBUS_CMD_ENDPOINT_UPDATE: {
struct kdbus_cmd_update *cmd_update;
/* update the properties of a custom endpoint */
case KDBUS_HANDLE_EP:
return kdbus_handle_ioctl_ep(file, cmd, argp);
- case KDBUS_HANDLE_EP_CONNECTED:
+ case KDBUS_HANDLE_ENDPOINT_CONNECTED:
return kdbus_handle_ioctl_ep_connected(file, cmd, argp);
- case KDBUS_HANDLE_EP_OWNER:
+ case KDBUS_HANDLE_ENDPOINT_OWNER:
return kdbus_handle_ioctl_ep_owner(file, cmd, argp);
default:
unsigned int mask = POLLOUT | POLLWRNORM;
/* Only a connected endpoint can read/write data */
- if (handle->type != KDBUS_HANDLE_EP_CONNECTED)
+ if (handle->type != KDBUS_HANDLE_ENDPOINT_CONNECTED)
return POLLERR | POLLHUP;
/* make sure handle->conn is set if handle->type is */
{
struct kdbus_handle *handle = file->private_data;
- if (handle->type != KDBUS_HANDLE_EP_CONNECTED)
+ if (handle->type != KDBUS_HANDLE_ENDPOINT_CONNECTED)
return -EPERM;
/* make sure handle->conn is set if handle->type is */
* @flags: Properties for the bus/ep/domain to create
* @items: Items describing details
*
- * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_EP_MAKE and
- * KDBUS_CMD_DOMAIN_MAKE ioctls.
+ * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_ENDPOINT_MAKE
+ * and KDBUS_CMD_DOMAIN_MAKE ioctls.
*/
struct kdbus_cmd_make {
__u64 size;
* is closed.
* @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a
* 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
* restrictive policy and grant restricted access
* to specific applications.
* @KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used to
* update the metadata subscription mask and
* 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.
* @KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should
* be delivered to the connection.
struct kdbus_cmd_make),
KDBUS_CMD_DOMAIN_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10,
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),
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x30,
KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61,
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),
KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0x80,
endpoint called 'bus'. The bus owner has the ability to create custom
endpoints with specific names, permissions, and policy databases (see below).
-To create a custom endpoint, use the KDBUS_CMD_EP_MAKE ioctl with struct
+To create a custom endpoint, use the KDBUS_CMD_ENDPOINT_MAKE ioctl with struct
kdbus_cmd_make. Custom endpoints always have a policy db that, by default,
does not allow anything. Everything that users of this new endpoint should be
able to do has to be explicitly specified through KDBUS_ITEM_NAME and
5.3 Creating domains, buses and endpoints
-----------------------------------------
-KDBUS_CMD_BUS_MAKE, KDBUS_CMD_DOMAIN_MAKE and KDBUS_CMD_EP_MAKE take a struct
-kdbus_cmd_make argument.
+KDBUS_CMD_BUS_MAKE, KDBUS_CMD_DOMAIN_MAKE and KDBUS_CMD_ENDPOINT_MAKE take a
+struct kdbus_cmd_make argument.
struct kdbus_cmd_make {
__u64 size;
Policies are set through KDBUS_CMD_HELLO (when creating a policy holder
connection), KDBUS_CMD_CONN_UPDATE (when updating a policy holder connection),
-KDBUS_CMD_EP_MAKE (creating a custom endpoint) or KDBUS_CMD_EP_UPDATE (updating
-a custom endpoint). In all cases, the name and policy access information is
-stored in items of type KDBUS_ITEM_NAME and KDBUS_ITEM_POLICY_ACCESS. For this
-transport, the following rules apply.
+KDBUS_CMD_ENDPOINT_MAKE (creating a custom endpoint) or
+KDBUS_CMD_ENDPOINT_UPDATE (updating a custom endpoint). In all cases, the name
+and policy access information is stored in items of type KDBUS_ITEM_NAME and
+KDBUS_ITEM_POLICY_ACCESS. For this transport, the following rules apply.
* An item of type KDBUS_ITEM_NAME must be followed by at least one
KDBUS_ITEM_POLICY_ACCESS item
-EINVAL No name supplied for top-level domain
-EEXIST A domain of that name already exists
-KDBUS_CMD_EP_MAKE
+KDBUS_CMD_ENDPOINT_MAKE
-EPERM The calling user is not privileged (see Terminology)
-EOPNOTSUPP The flags supplied in the kdbus_cmd_make struct are invalid
-EINVAL Wildcards submitted in policy entries, or illegal sequence
of policy items
-For KDBUS_CMD_EP_UPDATE:
+For KDBUS_CMD_ENDPOINT_UPDATE:
-E2BIG Too many policy items attached
-EINVAL Wildcards submitted in policy entries, or illegal sequence
TABLE(CMD) = {
ENUM(KDBUS_CMD_BUS_MAKE),
ENUM(KDBUS_CMD_DOMAIN_MAKE),
- ENUM(KDBUS_CMD_EP_MAKE),
+ ENUM(KDBUS_CMD_ENDPOINT_MAKE),
ENUM(KDBUS_CMD_HELLO),
ENUM(KDBUS_CMD_MSG_SEND),
ENUM(KDBUS_CMD_MSG_RECV),
ep_make.head.size = sizeof(ep_make.head) +
ep_make.name.size;
- ret = ioctl(fd, KDBUS_CMD_EP_MAKE, &ep_make);
+ ret = ioctl(fd, KDBUS_CMD_ENDPOINT_MAKE, &ep_make);
if (ret < 0)
return ret;
ep_update.head.size = sizeof(ep_update);
- ret = ioctl(fd, KDBUS_CMD_EP_UPDATE, &ep_update);
+ ret = ioctl(fd, KDBUS_CMD_ENDPOINT_UPDATE, &ep_update);
if (ret < 0)
return -errno;