summaryrefslogtreecommitdiffstats
path: root/src/expr
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-02-13 18:01:02 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-02-17 19:25:11 +0100
commit26c945057d742fc4b0f4dfdc07849074cb9264c1 (patch)
tree20facafe81106096f8ee1ca954fe0e59b8e8c664 /src/expr
parent007e93ea118436eb40a2e39d6ae185c14b74ecf1 (diff)
src: split internal.h is smaller files
The internal.h file started being a small file with private definitions. Its size has been increasing over time more and more, so let's split this in small header files that map to the corresponding class where the functions belong to. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/bitwise.c3
-rw-r--r--src/expr/byteorder.c3
-rw-r--r--src/expr/cmp.c3
-rw-r--r--src/expr/counter.c2
-rw-r--r--src/expr/ct.c2
-rw-r--r--src/expr/data_reg.c16
-rw-r--r--src/expr/data_reg.h38
-rw-r--r--src/expr/exthdr.c3
-rw-r--r--src/expr/immediate.c3
-rw-r--r--src/expr/limit.c2
-rw-r--r--src/expr/log.c2
-rw-r--r--src/expr/lookup.c3
-rw-r--r--src/expr/masq.c2
-rw-r--r--src/expr/match.c3
-rw-r--r--src/expr/meta.c2
-rw-r--r--src/expr/nat.c2
-rw-r--r--src/expr/payload.c3
-rw-r--r--src/expr/queue.c2
-rw-r--r--src/expr/redir.c2
-rw-r--r--src/expr/reject.c2
-rw-r--r--src/expr/target.c3
21 files changed, 2 insertions, 99 deletions
diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
index a299cd4..3c4a2e4 100644
--- a/src/expr/bitwise.c
+++ b/src/expr/bitwise.c
@@ -20,9 +20,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "data_reg.h"
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_bitwise {
enum nft_registers sreg;
diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index 77680d2..a16b145 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -20,9 +20,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "data_reg.h"
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_byteorder {
enum nft_registers sreg;
diff --git a/src/expr/cmp.c b/src/expr/cmp.c
index 3ca4b08..ea51b83 100644
--- a/src/expr/cmp.c
+++ b/src/expr/cmp.c
@@ -21,9 +21,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include "data_reg.h"
-#include <buffer.h>
struct nft_expr_cmp {
union nft_data_reg data;
diff --git a/src/expr/counter.c b/src/expr/counter.c
index e9abc5b..a190863 100644
--- a/src/expr/counter.c
+++ b/src/expr/counter.c
@@ -21,8 +21,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_counter {
uint64_t pkts;
diff --git a/src/expr/ct.c b/src/expr/ct.c
index 12d96d5..c15bf42 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -20,8 +20,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_ct {
enum nft_ct_keys key;
diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
index 33b3346..b4e553e 100644
--- a/src/expr/data_reg.c
+++ b/src/expr/data_reg.c
@@ -22,8 +22,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include "data_reg.h"
#include "internal.h"
#ifdef JSON_PARSING
@@ -77,12 +75,10 @@ static int nft_data_reg_value_json_parse(union nft_data_reg *reg, json_t *data,
return DATA_VALUE;
}
-#endif
int nft_data_reg_json_parse(union nft_data_reg *reg, json_t *data,
struct nft_parse_err *err)
{
-#ifdef JSON_PARSING
const char *type;
@@ -97,11 +93,8 @@ int nft_data_reg_json_parse(union nft_data_reg *reg, json_t *data,
return nft_data_reg_verdict_json_parse(reg, data, err);
return DATA_NONE;
-#else
- errno = EOPNOTSUPP;
- return -1;
-#endif
}
+#endif
#ifdef XML_PARSING
static int nft_data_reg_verdict_xml_parse(union nft_data_reg *reg,
@@ -160,12 +153,10 @@ static int nft_data_reg_value_xml_parse(union nft_data_reg *reg,
return DATA_VALUE;
}
-#endif
int nft_data_reg_xml_parse(union nft_data_reg *reg, mxml_node_t *tree,
struct nft_parse_err *err)
{
-#ifdef XML_PARSING
const char *type;
mxml_node_t *node;
@@ -190,11 +181,8 @@ err:
err->node_name = "reg";
err->error = NFT_PARSE_EMISSINGNODE;
return DATA_NONE;
-#else
- errno = EOPNOTSUPP;
- return -1;
-#endif
}
+#endif
static int
nft_data_reg_value_snprintf_json(char *buf, size_t size,
diff --git a/src/expr/data_reg.h b/src/expr/data_reg.h
deleted file mode 100644
index 5258051..0000000
--- a/src/expr/data_reg.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _DATA_H_
-#define _DATA_H_
-
-enum {
- DATA_NONE,
- DATA_VALUE,
- DATA_VERDICT,
- DATA_CHAIN,
-};
-
-union nft_data_reg {
- struct {
- uint32_t val[4];
- uint32_t len;
- };
- struct {
- int verdict;
- const char *chain;
- };
-};
-
-#ifndef JSON_PARSING
-#define json_t void
-#endif
-
-#ifndef XML_PARSING
-#define mxml_node_t void
-#endif
-
-int nft_data_reg_snprintf(char *buf, size_t size, union nft_data_reg *reg,
- uint32_t output_format, uint32_t flags, int reg_type);
-int nft_data_reg_xml_parse(union nft_data_reg *reg, mxml_node_t *tree,
- struct nft_parse_err *err);
-int nft_parse_data(union nft_data_reg *data, struct nlattr *attr, int *type);
-int nft_data_reg_json_parse(union nft_data_reg *reg, json_t *data,
- struct nft_parse_err *err);
-
-#endif
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
index 2135148..615fec6 100644
--- a/src/expr/exthdr.c
+++ b/src/expr/exthdr.c
@@ -24,9 +24,6 @@
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
-
#ifndef IPPROTO_MH
#define IPPROTO_MH 135
#endif
diff --git a/src/expr/immediate.c b/src/expr/immediate.c
index 3d4e48c..b6cde0a 100644
--- a/src/expr/immediate.c
+++ b/src/expr/immediate.c
@@ -19,9 +19,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include "data_reg.h"
-#include <buffer.h>
struct nft_expr_immediate {
union nft_data_reg data;
diff --git a/src/expr/limit.c b/src/expr/limit.c
index 375e6e0..f9331b3 100644
--- a/src/expr/limit.c
+++ b/src/expr/limit.c
@@ -21,8 +21,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_limit {
uint64_t rate;
diff --git a/src/expr/log.c b/src/expr/log.c
index 0a324c4..776c7fc 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -20,8 +20,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_log {
uint32_t snaplen;
diff --git a/src/expr/lookup.c b/src/expr/lookup.c
index 29daa30..57eba1b 100644
--- a/src/expr/lookup.c
+++ b/src/expr/lookup.c
@@ -20,9 +20,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/rule.h>
#include <libnftnl/expr.h>
-#include "data_reg.h"
-#include "expr_ops.h"
-#include <buffer.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
diff --git a/src/expr/masq.c b/src/expr/masq.c
index 869fd45..79f5185 100644
--- a/src/expr/masq.c
+++ b/src/expr/masq.c
@@ -19,8 +19,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_masq {
uint32_t flags;
diff --git a/src/expr/match.c b/src/expr/match.c
index 26a368f..45e7caf 100644
--- a/src/expr/match.c
+++ b/src/expr/match.c
@@ -24,9 +24,6 @@
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
-
/* From include/linux/netfilter/x_tables.h */
#define XT_EXTENSION_MAXNAMELEN 29
diff --git a/src/expr/meta.c b/src/expr/meta.c
index d1a6bbb..2f5cddc 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -20,8 +20,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
#ifndef NFT_META_MAX
#define NFT_META_MAX (NFT_META_CGROUP + 1)
diff --git a/src/expr/nat.c b/src/expr/nat.c
index c9e05af..e36d023 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -23,8 +23,6 @@
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_nat {
enum nft_registers sreg_addr_min;
diff --git a/src/expr/payload.c b/src/expr/payload.c
index 1aa20bd..61e88a9 100644
--- a/src/expr/payload.c
+++ b/src/expr/payload.c
@@ -24,9 +24,6 @@
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
-
struct nft_expr_payload {
enum nft_registers dreg;
enum nft_payload_bases base;
diff --git a/src/expr/queue.c b/src/expr/queue.c
index a4f0b88..dbae701 100644
--- a/src/expr/queue.c
+++ b/src/expr/queue.c
@@ -19,8 +19,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_queue {
uint16_t queuenum;
diff --git a/src/expr/redir.c b/src/expr/redir.c
index 02cd3a6..a1be181 100644
--- a/src/expr/redir.c
+++ b/src/expr/redir.c
@@ -19,8 +19,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_redir {
enum nft_registers sreg_proto_min;
diff --git a/src/expr/reject.c b/src/expr/reject.c
index fe18368..cd62cbe 100644
--- a/src/expr/reject.c
+++ b/src/expr/reject.c
@@ -20,8 +20,6 @@
#include <libmnl/libmnl.h>
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
struct nft_expr_reject {
uint32_t type;
diff --git a/src/expr/target.c b/src/expr/target.c
index a79bc9e..16e9e83 100644
--- a/src/expr/target.c
+++ b/src/expr/target.c
@@ -24,9 +24,6 @@
#include <libnftnl/expr.h>
#include <libnftnl/rule.h>
-#include "expr_ops.h"
-#include <buffer.h>
-
/* From include/linux/netfilter/x_tables.h */
#define XT_EXTENSION_MAXNAMELEN 29