forked from gregkh/kdbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.h
45 lines (41 loc) · 1.3 KB
/
metadata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (C) 2013 Kay Sievers
* Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Copyright (C) 2013 Daniel Mack <daniel@zonque.org>
* Copyright (C) 2013 Linux Foundation
*
* kdbus is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*/
#ifndef __KDBUS_METADATA_H
#define __KDBUS_METADATA_H
/**
* struct kdbus_meta - metadata buffer
* @attached: Flags for already attached data
* @ns: Namespace the metadata belongs to
* @data: Allocated buffer
* @size: Number of bytes used
* @allocated_size: Size of buffer
*
* Used to collect and store connection metadata in a pre-compiled
* buffer containing struct kdbus_item.
*/
struct kdbus_meta {
u64 attached;
const struct pid_namespace *ns;
struct kdbus_item *data;
size_t size;
size_t allocated_size;
};
struct kdbus_conn;
int kdbus_meta_new(struct kdbus_meta **meta);
int kdbus_meta_append_data(struct kdbus_meta *meta, u64 type,
const void *buf, size_t len);
int kdbus_meta_append(struct kdbus_meta *meta,
struct kdbus_conn *conn,
u64 seq,
u64 which);
void kdbus_meta_free(struct kdbus_meta *meta);
#endif