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
12extern "C" {
13#endif
14
15struct nlattr;
16
17struct nl_data;
18
19/* General */
20extern struct nl_data * nl_data_alloc(const void *, size_t);
21extern struct nl_data * nl_data_alloc_attr(const struct nlattr *);
22extern struct nl_data * nl_data_clone(const struct nl_data *);
23extern int nl_data_append(struct nl_data *, const void *, size_t);
24extern void nl_data_free(struct nl_data *);
25
26/* Access Functions */
27extern void * nl_data_get(const struct nl_data *);
28extern size_t nl_data_get_size(const struct nl_data *);
29
30/* Misc */
31extern int nl_data_cmp(const struct nl_data *,
32 const struct nl_data *);
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif
struct nl_data * nl_data_clone(const struct nl_data *)
Clone an abstract data object.
Definition: data.c:89
void nl_data_free(struct nl_data *)
Free an abstract data object.
Definition: data.c:128
int nl_data_append(struct nl_data *, const void *, size_t)
Append data to an abstract data object.
Definition: data.c:105
struct nl_data * nl_data_alloc(const void *, size_t)
Allocate a new abstract data object.
Definition: data.c:44
size_t nl_data_get_size(const struct nl_data *)
Get size of data buffer of abstract data object.
Definition: data.c:160
struct nl_data * nl_data_alloc_attr(const struct nlattr *)
Allocate abstract data object based on netlink attribute.
Definition: data.c:78
void * nl_data_get(const struct nl_data *)
Get data buffer of abstract data object.
Definition: data.c:148
int nl_data_cmp(const struct nl_data *, const struct nl_data *)
Compare two abstract data objects.
Definition: data.c:180