* Return: 0 on success, error otherwise.
*/
int kdbus_cmd_bus_creator_info(struct kdbus_conn *conn,
- struct kdbus_cmd_conn_info *cmd_info)
+ struct kdbus_cmd_info *cmd_info)
{
struct kdbus_bus *bus = conn->bus;
struct kdbus_pool_slice *slice;
- struct kdbus_conn_info info = {};
+ struct kdbus_info info = {};
int ret;
info.size = sizeof(info) + bus->meta->size;
umode_t mode, kuid_t uid, kgid_t gid,
struct kdbus_bus **bus);
int kdbus_cmd_bus_creator_info(struct kdbus_conn *conn,
- struct kdbus_cmd_conn_info *cmd_info);
+ struct kdbus_cmd_info *cmd_info);
struct kdbus_bus *kdbus_bus_ref(struct kdbus_bus *bus);
struct kdbus_bus *kdbus_bus_unref(struct kdbus_bus *bus);
void kdbus_bus_disconnect(struct kdbus_bus *bus);
}
/**
- * kdbus_cmd_conn_info() - retrieve info about a connection
+ * kdbus_cmd_info() - retrieve info about a connection
* @conn: Connection
* @cmd_info: The command as passed in by the ioctl
*
* Return: 0 on success, negative errno on failure.
*/
-int kdbus_cmd_conn_info(struct kdbus_conn *conn,
- struct kdbus_cmd_conn_info *cmd_info)
+int kdbus_cmd_info(struct kdbus_conn *conn,
+ struct kdbus_cmd_info *cmd_info)
{
struct kdbus_name_entry *entry = NULL;
struct kdbus_conn *owner_conn = NULL;
- struct kdbus_conn_info info = {};
+ struct kdbus_info info = {};
struct kdbus_meta *meta = NULL;
struct kdbus_pool_slice *slice;
size_t pos;
struct kdbus_cmd_recv *recv);
int kdbus_cmd_msg_cancel(struct kdbus_conn *conn,
u64 cookie);
-int kdbus_cmd_conn_info(struct kdbus_conn *conn,
- struct kdbus_cmd_conn_info *cmd_info);
+int kdbus_cmd_info(struct kdbus_conn *conn,
+ struct kdbus_cmd_info *cmd_info);
int kdbus_cmd_conn_update(struct kdbus_conn *conn,
const struct kdbus_cmd_update *cmd_update);
int kdbus_conn_kmsg_send(struct kdbus_ep *ep,
case KDBUS_CMD_CONN_INFO:
case KDBUS_CMD_BUS_CREATOR_INFO: {
- struct kdbus_cmd_conn_info *cmd_info;
+ struct kdbus_cmd_info *cmd_info;
/* return the properties of a connection */
ret = kdbus_memdup_user(buf, &p, sizeof(*cmd_info),
break;
if (cmd == KDBUS_CMD_CONN_INFO)
- ret = kdbus_cmd_conn_info(conn, cmd_info);
+ ret = kdbus_cmd_info(conn, cmd_info);
else
ret = kdbus_cmd_bus_creator_info(conn, cmd_info);
break;
if (kdbus_offset_set_user(&cmd_info->offset, buf,
- struct kdbus_cmd_conn_info))
+ struct kdbus_cmd_info))
ret = -EFAULT;
break;
};
/**
- * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl
+ * struct kdbus_cmd_info - struct used for KDBUS_CMD_CONN_INFO ioctl
* @size: The total size of the struct
* @flags: KDBUS_ATTACH_* flags, userspace → kernel
* @kernel_flags: Supported KDBUS_ATTACH_* flags, kernel → userspace
* @name is required. kdbus will look up the name to
* determine the ID in this case.
* @offset: Returned offset in the caller's pool buffer where the
- * kdbus_conn_info struct result is stored. The user must
+ * kdbus_info struct result is stored. The user must
* use KDBUS_CMD_FREE to free the allocated memory.
* @name: The optional well-known name to look up. Only needed in
* case @id is zero.
*
* On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
* tell the user the offset in the connection pool buffer at which to find the
- * result in a struct kdbus_conn_info.
+ * result in a struct kdbus_info.
*/
-struct kdbus_cmd_conn_info {
+struct kdbus_cmd_info {
__u64 size;
__u64 flags;
__u64 kernel_flags;
} __attribute__((aligned(8)));
/**
- * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO
+ * struct kdbus_info - information returned by KDBUS_CMD_*_INFO
* @size: The total size of the struct
- * @id: The connection's 64-bit ID
- * @flags: The connection's flags
+ * @id: The connection's or bus' 64-bit ID
+ * @flags: The connection's or bus' flags
* @items: A list of struct kdbus_item
*
* Note that the user is responsible for freeing the allocated memory with
* the KDBUS_CMD_FREE ioctl.
*/
-struct kdbus_conn_info {
+struct kdbus_info {
__u64 size;
__u64 id;
__u64 flags;
struct kdbus_cmd_name_list),
KDBUS_CMD_CONN_INFO = _IOWR(KDBUS_IOCTL_MAGIC, 0x60,
- struct kdbus_cmd_conn_info),
+ struct kdbus_cmd_info),
KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61,
struct kdbus_cmd_update),
KDBUS_CMD_BUS_CREATOR_INFO = _IOWR(KDBUS_IOCTL_MAGIC, 0x62,
- struct kdbus_cmd_conn_info),
+ struct kdbus_cmd_info),
KDBUS_CMD_ENDPOINT_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x71,
struct kdbus_cmd_update),
properties of the initial creator of a connection. This ioctl uses the
following struct:
-struct kdbus_cmd_conn_info {
+struct kdbus_cmd_info {
__u64 size;
The overall size of the struct, including the name with its 0-byte string
terminator.
After the ioctl returns, the following struct will be stored in the caller's
pool at 'offset'.
-struct kdbus_conn_info {
+struct kdbus_info {
__u64 size;
The overall size of the struct, including all its items.
Valid flags for this command, returned by the kernel upon each call.
struct kdbus_item items[0];
- Depending on the 'flags' field in struct kdbus_cmd_conn_info, items of
+ Depending on the 'flags' field in struct kdbus_cmd_info, items of
types KDBUS_ITEM_NAME and KDBUS_ITEM_CONN_NAME are followed here.
};
moment when it did so.
In response to this call, a slice in the connection's pool is allocated and
-filled with an object of type struct kdbus_conn_info, pointed to by the ioctl's
+filled with an object of type struct kdbus_info, pointed to by the ioctl's
'offset' field.
-struct kdbus_conn_info {
+struct kdbus_info {
__u64 size;
The overall size of the struct, including all its items.
KDBUS_HELLO_ACTIVATOR);
}
-int kdbus_conn_info(struct kdbus_conn *conn, uint64_t id,
+int kdbus_info(struct kdbus_conn *conn, uint64_t id,
const char *name, uint64_t *offset)
{
- struct kdbus_cmd_conn_info *cmd;
+ struct kdbus_cmd_info *cmd;
size_t size = sizeof(*cmd);
int ret;
struct kdbus_conn *kdbus_hello_activator(const char *path, const char *name,
const struct kdbus_policy_access *access,
size_t num_access);
-int kdbus_conn_info(struct kdbus_conn *conn, uint64_t id,
+int kdbus_info(struct kdbus_conn *conn, uint64_t id,
const char *name, uint64_t *offset);
void kdbus_conn_free(struct kdbus_conn *conn);
int kdbus_conn_update_attach_flags(struct kdbus_conn *conn, uint64_t flags);
{
int ret;
struct kdbus_conn *conn;
- struct kdbus_cmd_conn_info cmd = {};
+ struct kdbus_cmd_info cmd = {};
cmd.size = sizeof(cmd);
{
int ret;
struct {
- struct kdbus_cmd_conn_info cmd_info;
+ struct kdbus_cmd_info cmd_info;
struct {
uint64_t size;
} name;
} buf;
- buf.cmd_info.size = sizeof(struct kdbus_cmd_conn_info);
+ buf.cmd_info.size = sizeof(struct kdbus_cmd_info);
buf.cmd_info.flags = 0;
buf.cmd_info.id = env->conn->id;
ret = kdbus_msg_recv(ep_conn, NULL, NULL);
ASSERT_RETURN(ret == -EAGAIN);
- ret = kdbus_conn_info(ep_conn, 0, name, NULL);
+ ret = kdbus_info(ep_conn, 0, name, NULL);
ASSERT_RETURN(ret == -ENOENT);
- ret = kdbus_conn_info(ep_conn, env->conn->id, NULL, NULL);
+ ret = kdbus_info(ep_conn, env->conn->id, NULL, NULL);
ASSERT_RETURN(ret == -ENOENT);
/*
ASSERT_RETURN(strcmp(msg->items[0].name_change.name, name) == 0);
kdbus_msg_free(msg);
- ret = kdbus_conn_info(ep_conn, 0, name, NULL);
+ ret = kdbus_info(ep_conn, 0, name, NULL);
ASSERT_RETURN(ret == 0);
- ret = kdbus_conn_info(ep_conn, env->conn->id, NULL, NULL);
+ ret = kdbus_info(ep_conn, env->conn->id, NULL, NULL);
ASSERT_RETURN(ret == 0);
kdbus_conn_free(ep_conn);