libnl: /data/src/libnl3/include/netlink/data.h Source File

libnl 3.7.0

data.h
1 /* SPDX-License-Identifier: LGPL-2.1-only */
2 /*
3 * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
4 */
5
6 #ifndef NETLINK_DATA_H_
7 #define NETLINK_DATA_H_
8
9 #include <netlink/netlink.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 struct nlattr;
16
17 struct nl_data;
18
19 /* General */
20 extern struct nl_data * nl_data_alloc(const void *, size_t);
21 extern struct nl_data * nl_data_alloc_attr(const struct nlattr *);
22 extern struct nl_data * nl_data_clone(const struct nl_data *);
23 extern int nl_data_append(struct nl_data *, const void *, size_t);
24 extern void nl_data_free(struct nl_data *);
25
26 /* Access Functions */
27 extern void * nl_data_get(const struct nl_data *);
28 extern size_t nl_data_get_size(const struct nl_data *);
29
30 /* Misc */
31 extern int nl_data_cmp(const struct nl_data *,
32 const struct nl_data *);
33
34 #ifdef __cplusplus
35 }
36 #endif
37
38 #endif
nl_data_alloc
struct nl_data * nl_data_alloc(const void *, size_t)
Allocate a new abstract data object.
Definition: data.c:44
nl_data_clone
struct nl_data * nl_data_clone(const struct nl_data *)
Clone an abstract data object.
Definition: data.c:89
nl_data_free
void nl_data_free(struct nl_data *)
Free an abstract data object.
Definition: data.c:128
nl_data_get
void * nl_data_get(const struct nl_data *)
Get data buffer of abstract data object.
Definition: data.c:148
nl_data_append
int nl_data_append(struct nl_data *, const void *, size_t)
Append data to an abstract data object.
Definition: data.c:105
nl_data_alloc_attr
struct nl_data * nl_data_alloc_attr(const struct nlattr *)
Allocate abstract data object based on netlink attribute.
Definition: data.c:78
nl_data_get_size
size_t nl_data_get_size(const struct nl_data *)
Get size of data buffer of abstract data object.
Definition: data.c:160
nl_data_cmp
int nl_data_cmp(const struct nl_data *, const struct nl_data *)
Compare two abstract data objects.
Definition: data.c:180