[libnftnl,v3] udata: add NFTNL_UDATA_* definitions

Message ID 20190208165217.9783-1-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series
  • [libnftnl,v3] udata: add NFTNL_UDATA_* definitions
Related show

Commit Message

Pablo Neira Ayuso Feb. 8, 2019, 4:52 p.m.
Place them in the library, so iptables and nftables do not need to
redefine them.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
v3: maximum comment length and set element flags definition

 include/libnftnl/udata.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Phil Sutter Feb. 8, 2019, 6:02 p.m. | #1
On Fri, Feb 08, 2019 at 05:52:17PM +0100, Pablo Neira Ayuso wrote:
> Place them in the library, so iptables and nftables do not need to
> redefine them.
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Acked-by: Phil Sutter <phil@nwl.cc>

Patch

diff --git a/include/libnftnl/udata.h b/include/libnftnl/udata.h
index 7dfc0ca9033f..dd2f3dfd9bfe 100644
--- a/include/libnftnl/udata.h
+++ b/include/libnftnl/udata.h
@@ -9,6 +9,39 @@ 
 extern "C" {
 #endif
 
+enum nftnl_udata_rule_types {
+	NFTNL_UDATA_RULE_COMMENT,
+	NFTNL_UDATA_RULE_EBTABLES_POLICY,
+	__NFTNL_UDATA_RULE_MAX
+};
+#define NFTNL_UDATA_RULE_MAX (__NFTNL_UDATA_RULE_MAX - 1)
+
+#define NFTNL_UDATA_COMMENT_MAXLEN	128
+
+enum nftnl_udata_set_types {
+	NFTNL_UDATA_SET_KEYBYTEORDER,
+	NFTNL_UDATA_SET_DATABYTEORDER,
+	NFTNL_UDATA_SET_MERGE_ELEMENTS,
+	__NFTNL_UDATA_SET_MAX
+};
+#define NFTNL_UDATA_SET_MAX (__NFTNL_UDATA_SET_MAX - 1)
+
+enum nftnl_udata_set_elem_types {
+	NFTNL_UDATA_SET_ELEM_COMMENT,
+	NFTNL_UDATA_SET_ELEM_FLAGS,
+	__NFTNL_UDATA_SET_ELEM_MAX
+};
+#define NFTNL_UDATA_SET_ELEM_MAX (__NFTNL_UDATA_SET_ELEM_MAX - 1)
+
+/**
+ * enum nftnl_udata_set_elem_flags - meaning of bits in UDATA_SET_ELEM_FLAGS
+ *
+ * @SET_ELEM_F_INTERVAL_OPEN:   set element denotes a half-open range
+ */
+enum nftnl_udata_set_elem_flags {
+	NFTNL_SET_ELEM_F_INTERVAL_OPEN	= 0x1,
+};
+
 /*
  * nftnl user data attributes API
  */