libnl 3.7.0
queue.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net>
4 */
5
6#ifndef NETLINK_QUEUE_H_
7#define NETLINK_QUEUE_H_
8
9#include <netlink/netlink.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15struct nl_sock;
16struct nlmsghdr;
17struct nfnl_queue;
18
19extern struct nl_object_ops queue_obj_ops;
20
21enum nfnl_queue_copy_mode {
22 NFNL_QUEUE_COPY_NONE,
23 NFNL_QUEUE_COPY_META,
24 NFNL_QUEUE_COPY_PACKET,
25};
26
27/* General */
28extern struct nl_sock * nfnl_queue_socket_alloc(void);
29
30extern struct nfnl_queue * nfnl_queue_alloc(void);
31
32extern void nfnl_queue_get(struct nfnl_queue *);
33extern void nfnl_queue_put(struct nfnl_queue *);
34
35/* Attributes */
36extern void nfnl_queue_set_group(struct nfnl_queue *, uint16_t);
37extern int nfnl_queue_test_group(const struct nfnl_queue *);
38extern uint16_t nfnl_queue_get_group(const struct nfnl_queue *);
39
40extern void nfnl_queue_set_maxlen(struct nfnl_queue *, uint32_t);
41extern int nfnl_queue_test_maxlen(const struct nfnl_queue *);
42extern uint32_t nfnl_queue_get_maxlen(const struct nfnl_queue *);
43
44extern void nfnl_queue_set_copy_mode(struct nfnl_queue *,
45 enum nfnl_queue_copy_mode);
46extern int nfnl_queue_test_copy_mode(const struct nfnl_queue *);
47extern enum nfnl_queue_copy_mode nfnl_queue_get_copy_mode(const struct nfnl_queue *);
48
49extern char * nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode,
50 char *, size_t);
51extern int nfnl_queue_str2copy_mode(const char *);
52
53extern void nfnl_queue_set_copy_range(struct nfnl_queue *,
54 uint32_t);
55extern int nfnl_queue_test_copy_range(const struct nfnl_queue *);
56extern uint32_t nfnl_queue_get_copy_range(const struct nfnl_queue *);
57
58extern int nfnl_queue_build_pf_bind(uint8_t, struct nl_msg **);
59extern int nfnl_queue_pf_bind(struct nl_sock *, uint8_t);
60
61extern int nfnl_queue_build_pf_unbind(uint8_t, struct nl_msg **);
62extern int nfnl_queue_pf_unbind(struct nl_sock *, uint8_t);
63
64extern int nfnl_queue_build_create_request(const struct nfnl_queue *,
65 struct nl_msg **);
66extern int nfnl_queue_create(struct nl_sock *,
67 const struct nfnl_queue *);
68
69extern int nfnl_queue_build_change_request(const struct nfnl_queue *,
70 struct nl_msg **);
71extern int nfnl_queue_change(struct nl_sock *,
72 const struct nfnl_queue *);
73
74extern int nfnl_queue_build_delete_request(const struct nfnl_queue *,
75 struct nl_msg **);
76extern int nfnl_queue_delete(struct nl_sock *,
77 const struct nfnl_queue *);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif
84