libnl  3.4.0
data.h
1 /*
2  * netlink/data.h Abstract Data
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation version 2.1
7  * of the License.
8  *
9  * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_DATA_H_
13 #define NETLINK_DATA_H_
14 
15 #include <netlink/netlink.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct nlattr;
22 
23 struct nl_data;
24 
25 /* General */
26 extern struct nl_data * nl_data_alloc(const void *, size_t);
27 extern struct nl_data * nl_data_alloc_attr(const struct nlattr *);
28 extern struct nl_data * nl_data_clone(const struct nl_data *);
29 extern int nl_data_append(struct nl_data *, const void *, size_t);
30 extern void nl_data_free(struct nl_data *);
31 
32 /* Access Functions */
33 extern void * nl_data_get(const struct nl_data *);
34 extern size_t nl_data_get_size(const struct nl_data *);
35 
36 /* Misc */
37 extern int nl_data_cmp(const struct nl_data *,
38  const struct nl_data *);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif
void * nl_data_get(const struct nl_data *)
Get data buffer of abstract data object.
Definition: data.c:154
size_t nl_data_get_size(const struct nl_data *)
Get size of data buffer of abstract data object.
Definition: data.c:166
struct nl_data * nl_data_alloc_attr(const struct nlattr *)
Allocate abstract data object based on netlink attribute.
Definition: data.c:84
int nl_data_append(struct nl_data *, const void *, size_t)
Append data to an abstract data object.
Definition: data.c:111
struct nl_data * nl_data_clone(const struct nl_data *)
Clone an abstract data object.
Definition: data.c:95
struct nl_data * nl_data_alloc(const void *, size_t)
Allocate a new abstract data object.
Definition: data.c:50
int nl_data_cmp(const struct nl_data *, const struct nl_data *)
Compare two abstract data objects.
Definition: data.c:186
void nl_data_free(struct nl_data *)
Free an abstract data object.
Definition: data.c:134