summaryrefslogtreecommitdiffstats
path: root/include/netlink/netfilter/queue.h
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-18 16:55:52 (GMT)
committerThomas Graf <tgr@deb.localdomain>2008-02-07 11:57:53 (GMT)
commite72cb033f2f7323b63f3e640a37e7a75558ab128 (patch)
treea1456e6c8ffc444e019df86e3bf798c34d39b342 /include/netlink/netfilter/queue.h
parent665b757809844950b277756bd2249ad7acbe443f (diff)
downloadlibnl-e72cb033f2f7323b63f3e640a37e7a75558ab128.zip
libnl-e72cb033f2f7323b63f3e640a37e7a75558ab128.tar.gz
libnl-e72cb033f2f7323b63f3e640a37e7a75558ab128.tar.bz2
[LIBNL]: Add nfnetlink_queue support
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/netlink/netfilter/queue.h')
-rw-r--r--include/netlink/netfilter/queue.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/include/netlink/netfilter/queue.h b/include/netlink/netfilter/queue.h
new file mode 100644
index 0000000..c88abe2
--- /dev/null
+++ b/include/netlink/netfilter/queue.h
@@ -0,0 +1,86 @@
+/*
+ * netlink/netfilter/queue.h Netfilter Queue
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net>
+ */
+
+#ifndef NETLINK_QUEUE_H_
+#define NETLINK_QUEUE_H_
+
+#include <netlink/netlink.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct nl_handle;
+struct nlmsghdr;
+struct nfnl_queue;
+
+extern struct nl_object_ops queue_obj_ops;
+
+enum nfnl_queue_copy_mode {
+ NFNL_QUEUE_COPY_NONE,
+ NFNL_QUEUE_COPY_META,
+ NFNL_QUEUE_COPY_PACKET,
+};
+
+/* General */
+extern struct nfnl_queue * nfnl_queue_alloc(void);
+
+extern void nfnl_queue_get(struct nfnl_queue *);
+extern void nfnl_queue_put(struct nfnl_queue *);
+
+/* Attributes */
+extern void nfnl_queue_set_group(struct nfnl_queue *, uint16_t);
+extern int nfnl_queue_test_group(const struct nfnl_queue *);
+extern uint16_t nfnl_queue_get_group(const struct nfnl_queue *);
+
+extern void nfnl_queue_set_maxlen(struct nfnl_queue *, uint32_t);
+extern int nfnl_queue_test_maxlen(const struct nfnl_queue *);
+extern uint32_t nfnl_queue_get_maxlen(const struct nfnl_queue *);
+
+extern void nfnl_queue_set_copy_mode(struct nfnl_queue *,
+ enum nfnl_queue_copy_mode);
+extern int nfnl_queue_test_copy_mode(const struct nfnl_queue *);
+extern enum nfnl_queue_copy_mode nfnl_queue_get_copy_mode(const struct nfnl_queue *);
+
+extern char * nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode,
+ char *, size_t);
+extern enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *);
+
+extern void nfnl_queue_set_copy_range(struct nfnl_queue *,
+ uint32_t);
+extern int nfnl_queue_test_copy_range(const struct nfnl_queue *);
+extern uint32_t nfnl_queue_get_copy_range(const struct nfnl_queue *);
+
+/* Message construction / sending */
+extern struct nl_msg * nfnl_queue_build_pf_bind(uint8_t);
+extern int nfnl_queue_pf_bind(struct nl_handle *, uint8_t);
+
+extern struct nl_msg * nfnl_queue_build_pf_unbind(uint8_t);
+extern int nfnl_queue_pf_unbind(struct nl_handle *, uint8_t);
+
+extern struct nl_msg * nfnl_queue_build_create_request(const struct nfnl_queue *);
+extern int nfnl_queue_create(struct nl_handle *,
+ const struct nfnl_queue *);
+
+extern struct nl_msg * nfnl_queue_build_change_request(const struct nfnl_queue *);
+extern int nfnl_queue_change(struct nl_handle *,
+ const struct nfnl_queue *);
+
+extern struct nl_msg * nfnl_queue_build_delete_request(const struct nfnl_queue *);
+extern int nfnl_queue_delete(struct nl_handle *,
+ const struct nfnl_queue *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+