From 325cb6f592cda0e9fb1769e4ebd209616fc7e6a1 Mon Sep 17 00:00:00 2001 From: Brett Mastbergen Date: Fri, 3 Jan 2020 14:36:40 -0500 Subject: include: Remove buffer.h 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 Signed-off-by: Brett Mastbergen Signed-off-by: Pablo Neira Ayuso --- include/Makefile.am | 1 - include/buffer.h | 109 ---------------------------------------------------- include/internal.h | 1 - 3 files changed, 111 deletions(-) delete mode 100644 include/buffer.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index b31aa10..738f807 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,7 +2,6 @@ SUBDIRS = libnftnl linux noinst_HEADERS = internal.h \ linux_list.h \ - buffer.h \ data_reg.h \ expr_ops.h \ obj.h \ diff --git a/include/buffer.h b/include/buffer.h deleted file mode 100644 index f6626a6..0000000 --- a/include/buffer.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef _NFTNL_BUFFER_H_ -#define _NFTNL_BUFFER_H_ - -#include -#include - -struct nftnl_expr; - -struct nftnl_buf { - char *buf; - size_t size; - size_t len; - uint32_t off; - bool fail; -}; - -#define NFTNL_BUF_INIT(__b, __buf, __len) \ - struct nftnl_buf __b = { \ - .buf = __buf, \ - .len = __len, \ - }; - -int nftnl_buf_update(struct nftnl_buf *b, int ret); -int nftnl_buf_done(struct nftnl_buf *b); - -union nftnl_data_reg; - -int nftnl_buf_open(struct nftnl_buf *b, int type, const char *tag); -int nftnl_buf_close(struct nftnl_buf *b, int type, const char *tag); - -int nftnl_buf_open_array(struct nftnl_buf *b, int type, const char *tag); -int nftnl_buf_close_array(struct nftnl_buf *b, int type, const char *tag); - -int nftnl_buf_u32(struct nftnl_buf *b, int type, uint32_t value, const char *tag); -int nftnl_buf_s32(struct nftnl_buf *b, int type, uint32_t value, const char *tag); -int nftnl_buf_u64(struct nftnl_buf *b, int type, uint64_t value, const char *tag); -int nftnl_buf_str(struct nftnl_buf *b, int type, const char *str, const char *tag); -int nftnl_buf_reg(struct nftnl_buf *b, int type, union nftnl_data_reg *reg, - int reg_type, const char *tag); -int nftnl_buf_expr_open(struct nftnl_buf *b, int type); -int nftnl_buf_expr_close(struct nftnl_buf *b, int type); -int nftnl_buf_expr(struct nftnl_buf *b, int type, uint32_t flags, - struct nftnl_expr *expr); - -#define BASE "base" -#define BYTES "bytes" -#define BURST "burst" -#define CHAIN "chain" -#define CODE "code" -#define COMPAT_FLAGS "compat_flags" -#define COMPAT_PROTO "compat_proto" -#define CONSUMED "consumed" -#define COUNT "count" -#define DATA "data" -#define DEVICE "device" -#define DIR "dir" -#define DREG "dreg" -#define EXTHDR_TYPE "exthdr_type" -#define FAMILY "family" -#define FLAGS "flags" -#define GROUP "group" -#define HANDLE "handle" -#define HOOKNUM "hooknum" -#define KEY "key" -#define LEN "len" -#define LEVEL "level" -#define MASK "mask" -#define NAT_TYPE "nat_type" -#define NAME "name" -#define NUM "num" -#define OFFSET "offset" -#define OP "op" -#define PACKETS "packets" -#define PKTS "pkts" -#define POLICY "policy" -#define POSITION "position" -#define PREFIX "prefix" -#define PRIO "prio" -#define QTHRESH "qthreshold" -#define RATE "rate" -#define RULE "rule" -#define SET "set" -#define SET_NAME "set_name" -#define SIZE "size" -#define SNAPLEN "snaplen" -#define SREG_ADDR_MAX "sreg_addr_max" -#define SREG_ADDR_MIN "sreg_addr_min" -#define SREG_PROTO_MAX "sreg_proto_max" -#define SREG_PROTO_MIN "sreg_proto_min" -#define SREG_KEY "sreg_key" -#define SREG_DATA "sreg_data" -#define SREG_QNUM "sreg_qnum" -#define SREG "sreg" -#define TABLE "table" -#define TOTAL "total" -#define TYPE "type" -#define UNIT "unit" -#define USE "use" -#define XOR "xor" -#define ADD "add" -#define INSERT "insert" -#define DELETE "delete" -#define REPLACE "replace" -#define FLUSH "flush" -#define MODULUS "modulus" -#define SEED "seed" -#define ID "id" - -#endif diff --git a/include/internal.h b/include/internal.h index a61b725..1f96731 100644 --- a/include/internal.h +++ b/include/internal.h @@ -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_ */ -- cgit v1.2.3