Skip to contentSkip to conversation

include: Remove buffer.h

PATCH Applied Brett Mastbergen 2 participants 2 messages Jan 3, 2020 – Jan 5, 2020 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include: Remove buffer.h

From: Brett Mastbergen <[email protected]>

Almost everything in this header is unused. The command defines used in utils.c don't seem to be justified and have just been replaced by their strings

---
 include/Makefile.am |   1 -
 include/buffer.h    | 109 ----------------------------------------------------
 include/internal.h  |   1 -
 src/chain.c         |   1 -
 src/common.c        |   1 -
 src/expr/dup.c      |   1 -
 src/expr/dynset.c   |   1 -
 src/expr/fwd.c      |   1 -
 src/flowtable.c     |   1 -
 src/object.c        |   1 -
 src/rule.c          |   1 -
 src/table.c         |   1 -
 src/utils.c         |  20 +++++-----
 13 files changed, 10 insertions(+), 130 deletions(-)
 delete mode 100644 include/buffer.h
include/Makefile.am +0 -1
index b31aa10..738f807 100644
@@ -2,7 +2,6 @@ SUBDIRS = libnftnl linux
 
 noinst_HEADERS = internal.h	\
 		 linux_list.h	\
-		 buffer.h	\
 		 data_reg.h	\
 		 expr_ops.h	\
 		 obj.h		\
include/buffer.h deleted +0 -109

109 lines not on this page · raw message

include/internal.h +0 -1
index a61b725..1f96731 100644
@@ -11,7 +11,6 @@
 #include "set_elem.h"
 #include "expr.h"
 #include "expr_ops.h"
-#include "buffer.h"
 #include "rule.h"
 
 #endif /* _LIBNFTNL_INTERNAL_H_ */
src/chain.c +0 -1
index b9a16fc..b4066e4 100644
@@ -28,7 +28,6 @@
 
 #include <libnftnl/chain.h>
 #include <libnftnl/rule.h>
-#include <buffer.h>
 
 struct nftnl_chain {
 	struct list_head head;
src/common.c +0 -1
index feb13b2..2d83c12 100644
@@ -17,7 +17,6 @@
 #include <libmnl/libmnl.h>
 #include <libnftnl/common.h>
 #include <libnftnl/set.h>
-#include <buffer.h>
 
 #include <errno.h>
 #include "internal.h"
src/expr/dup.c +0 -1
index 2bb35e5..ac39839 100644
@@ -19,7 +19,6 @@
 #include <libnftnl/rule.h>
 #include "expr_ops.h"
 #include "data_reg.h"
-#include <buffer.h>
 
 struct nftnl_expr_dup {
 	enum nft_registers	sreg_addr;
src/expr/dynset.c +0 -1
index 4870923..b2d8edc 100644
@@ -20,7 +20,6 @@
 #include <libnftnl/expr.h>
 #include "data_reg.h"
 #include "expr_ops.h"
-#include <buffer.h>
 
 struct nftnl_expr_dynset {
 	enum nft_registers	sreg_key;
src/expr/fwd.c +0 -1
index cff8235..2ec63c1 100644
@@ -19,7 +19,6 @@
 #include <libnftnl/rule.h>
 #include "expr_ops.h"
 #include "data_reg.h"
-#include <buffer.h>
 
 struct nftnl_expr_fwd {
 	enum nft_registers	sreg_dev;
src/flowtable.c +0 -1
index 9ba3b6d..1e235d0 100644
@@ -17,7 +17,6 @@
 #include <linux/netfilter_arp.h>
 
 #include <libnftnl/flowtable.h>
-#include <buffer.h>
 
 struct nftnl_flowtable {
 	struct list_head	head;
src/object.c +0 -1
index c876add..4f58272 100644
@@ -22,7 +22,6 @@
 #include <linux/netfilter/nf_tables.h>
 
 #include <libnftnl/object.h>
-#include <buffer.h>
 #include "obj.h"
 
 static struct obj_ops *obj_ops[__NFT_OBJECT_MAX] = {
src/rule.c +0 -1
index 252410b..8d7e068 100644
@@ -20,7 +20,6 @@
 #include <errno.h>
 #include <inttypes.h>
 #include <ctype.h>
-#include <buffer.h>
 
 #include <libmnl/libmnl.h>
 #include <linux/netfilter/nfnetlink.h>
src/table.c +0 -1
index adcfafe..94d522b 100644
@@ -24,7 +24,6 @@
 #include <linux/netfilter/nf_tables.h>
 
 #include <libnftnl/table.h>
-#include <buffer.h>
 
 struct nftnl_table {
 	struct list_head head;
src/utils.c +10 -10
index f641bf9..3617837 100644
@@ -242,11 +242,11 @@ enum nftnl_cmd_type nftnl_flag2cmd(uint32_t flags)
 }
 
 static const char *cmd2tag[NFTNL_CMD_MAX] = {
-	[NFTNL_CMD_ADD]			= ADD,
-	[NFTNL_CMD_INSERT]		= INSERT,
-	[NFTNL_CMD_DELETE]		= DELETE,
-	[NFTNL_CMD_REPLACE]		= REPLACE,
-	[NFTNL_CMD_FLUSH]			= FLUSH,
+	[NFTNL_CMD_ADD]			= "add",
+	[NFTNL_CMD_INSERT]		= "insert",
+	[NFTNL_CMD_DELETE]		= "delete",
+	[NFTNL_CMD_REPLACE]		= "replace",
+	[NFTNL_CMD_FLUSH]			= "flush",
 };
 
 const char *nftnl_cmd2tag(enum nftnl_cmd_type cmd)
@@ -259,15 +259,15 @@ const char *nftnl_cmd2tag(enum nftnl_cmd_type cmd)
 
 uint32_t nftnl_str2cmd(const char *cmd)
 {
-	if (strcmp(cmd, ADD) == 0)
+	if (strcmp(cmd, "add") == 0)
 		return NFTNL_CMD_ADD;
-	else if (strcmp(cmd, INSERT) == 0)
+	else if (strcmp(cmd, "insert") == 0)
 		return NFTNL_CMD_INSERT;
-	else if (strcmp(cmd, DELETE) == 0)
+	else if (strcmp(cmd, "delete") == 0)
 		return NFTNL_CMD_DELETE;
-	else if (strcmp(cmd, REPLACE) == 0)
+	else if (strcmp(cmd, "replace") == 0)
 		return NFTNL_CMD_REPLACE;
-	else if (strcmp(cmd, FLUSH) == 0)
+	else if (strcmp(cmd, "flush") == 0)
 		return NFTNL_CMD_FLUSH;
 
 	return NFTNL_CMD_UNSPEC;
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Brett Mastbergen

From: Brett Mastbergen <[email protected]>

Almost everything in this header is unused. The command defines used in utils.c don't seem to be justified and have just been replaced by their strings

Applied, thanks.