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

libnl 3.12.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
nl_data_clone
struct nl_data * nl_data_clone(const struct nl_data *)
Clone an abstract data object.
Definition data.c:95
nl_data_free
void nl_data_free(struct nl_data *)
Free an abstract data object.
Definition data.c:134
nl_data_append
int nl_data_append(struct nl_data *, const void *, size_t)
Append data to an abstract data object.
Definition data.c:111
nl_data_alloc
struct nl_data * nl_data_alloc(const void *, size_t)
Allocate a new abstract data object.
Definition data.c:50
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:166
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:84
nl_data_get
void * nl_data_get(const struct nl_data *)
Get data buffer of abstract data object.
Definition data.c:154
nl_data_cmp
int nl_data_cmp(const struct nl_data *, const struct nl_data *)
Compare two abstract data objects.
Definition data.c:186