summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-08-25 13:36:33 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-08-25 14:59:19 +0200
commitd563c93815feb6c92fb4247f2d4f2b1626cf126d (patch)
treed9df5839bf890ccacac5cbc7b7cb9652aafd54dd
parent6a90f33a6fe4b29da52177d87249570af864645d (diff)
include: include <std{bool,int}.h> via <nft.h>
There is a minimum base that all our sources will end up needing. This is what <nft.h> provides. Add <stdbool.h> and <stdint.h> there. It's unlikely that we want to implement anything, without having "bool" and "uint32_t" types available. Yes, this means the internal headers are not self-contained, with respect to what <nft.h> provides. This is the exception to the rule, and our internal headers should rely to have <nft.h> included for them. They should not include <nft.h> themselves, because <nft.h> needs always be included as first. So when an internal header would include <nft.h> it would be unnecessary, because the header is *always* included already. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/datatype.h1
-rw-r--r--include/dccpopt.h1
-rw-r--r--include/expression.h1
-rw-r--r--include/nft.h3
-rw-r--r--include/nftables.h1
-rw-r--r--include/rule.h1
-rw-r--r--include/utils.h2
-rw-r--r--src/dccpopt.c1
-rw-r--r--src/evaluate.c1
-rw-r--r--src/expression.c1
-rw-r--r--src/exthdr.c1
-rw-r--r--src/ipopt.c1
-rw-r--r--src/mergesort.c1
-rw-r--r--src/meta.c1
-rw-r--r--src/netlink_delinearize.c1
-rw-r--r--src/nftutils.c1
-rw-r--r--src/nftutils.h1
-rw-r--r--src/parser_json.c1
-rw-r--r--src/payload.c1
-rw-r--r--src/proto.c1
-rw-r--r--src/rt.c1
-rw-r--r--src/rule.c1
-rw-r--r--src/statement.c1
-rw-r--r--src/tcpopt.c1
24 files changed, 3 insertions, 24 deletions
diff --git a/include/datatype.h b/include/datatype.h
index be5c6d1b..9ce7359c 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -1,7 +1,6 @@
#ifndef NFTABLES_DATATYPE_H
#define NFTABLES_DATATYPE_H
-#include <stdbool.h>
#include <json.h>
/**
diff --git a/include/dccpopt.h b/include/dccpopt.h
index 9686932d..3617fc1a 100644
--- a/include/dccpopt.h
+++ b/include/dccpopt.h
@@ -2,7 +2,6 @@
#define NFTABLES_DCCPOPT_H
#include <nftables.h>
-#include <stdint.h>
#define DCCPOPT_TYPE_MIN 0
#define DCCPOPT_TYPE_MAX UINT8_MAX
diff --git a/include/expression.h b/include/expression.h
index 1f58a68c..733dd3cf 100644
--- a/include/expression.h
+++ b/include/expression.h
@@ -1,7 +1,6 @@
#ifndef NFTABLES_EXPRESSION_H
#define NFTABLES_EXPRESSION_H
-#include <stdbool.h>
#include <gmputil.h>
#include <linux/netfilter/nf_tables.h>
diff --git a/include/nft.h b/include/nft.h
index 0fd481c6..967eb7bc 100644
--- a/include/nft.h
+++ b/include/nft.h
@@ -4,4 +4,7 @@
#include <config.h>
+#include <stdbool.h>
+#include <stdint.h>
+
#endif /* NFTABLES_NFT_H */
diff --git a/include/nftables.h b/include/nftables.h
index f073fa95..219a1010 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -1,7 +1,6 @@
#ifndef NFTABLES_NFTABLES_H
#define NFTABLES_NFTABLES_H
-#include <stdbool.h>
#include <stdarg.h>
#include <limits.h>
#include <utils.h>
diff --git a/include/rule.h b/include/rule.h
index 13ab1bf3..8e876d0a 100644
--- a/include/rule.h
+++ b/include/rule.h
@@ -1,7 +1,6 @@
#ifndef NFTABLES_RULE_H
#define NFTABLES_RULE_H
-#include <stdint.h>
#include <nftables.h>
#include <list.h>
#include <netinet/in.h>
diff --git a/include/utils.h b/include/utils.h
index 6764f921..cee1e5c1 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -2,8 +2,6 @@
#define NFTABLES_UTILS_H
#include <asm/byteorder.h>
-#include <stdint.h>
-#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/src/dccpopt.c b/src/dccpopt.c
index d713d903..ebb645a9 100644
--- a/src/dccpopt.c
+++ b/src/dccpopt.c
@@ -1,7 +1,6 @@
#include <nft.h>
#include <stddef.h>
-#include <stdint.h>
#include <datatype.h>
#include <dccpopt.h>
diff --git a/src/evaluate.c b/src/evaluate.c
index 69a12351..1ae2ef0d 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -13,7 +13,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
#include <linux/netfilter.h>
diff --git a/src/expression.c b/src/expression.c
index 8ef00891..147320f0 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -13,7 +13,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <limits.h>
diff --git a/src/exthdr.c b/src/exthdr.c
index dd8c7581..8aba7da1 100644
--- a/src/exthdr.c
+++ b/src/exthdr.c
@@ -15,7 +15,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
diff --git a/src/ipopt.c b/src/ipopt.c
index 3ba67b01..37f779d4 100644
--- a/src/ipopt.c
+++ b/src/ipopt.c
@@ -1,6 +1,5 @@
#include <nft.h>
-#include <stdint.h>
#include <netinet/in.h>
#include <netinet/ip.h>
diff --git a/src/mergesort.c b/src/mergesort.c
index 9315093b..5965236a 100644
--- a/src/mergesort.c
+++ b/src/mergesort.c
@@ -8,7 +8,6 @@
#include <nft.h>
-#include <stdint.h>
#include <expression.h>
#include <gmputil.h>
#include <list.h>
diff --git a/src/meta.c b/src/meta.c
index fcb872e6..4f383269 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -17,7 +17,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <net/if.h>
#include <net/if_arp.h>
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index dfa816cf..1121f730 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -12,7 +12,6 @@
#include <nft.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <linux/netfilter/nf_tables.h>
diff --git a/src/nftutils.c b/src/nftutils.c
index 14cb1fcf..9c7fe5ed 100644
--- a/src/nftutils.c
+++ b/src/nftutils.c
@@ -6,7 +6,6 @@
#include <netdb.h>
#include <string.h>
-#include <stdint.h>
/* Buffer size used for getprotobynumber_r() and similar. The manual comments
* that a buffer of 1024 should be sufficient "for most applications"(??), so
diff --git a/src/nftutils.h b/src/nftutils.h
index cb584b9c..7db56f42 100644
--- a/src/nftutils.h
+++ b/src/nftutils.h
@@ -2,7 +2,6 @@
#ifndef NFTUTILS_H
#define NFTUTILS_H
-#include <stdbool.h>
#include <stddef.h>
/* The maximum buffer size for (struct protoent).p_name. It is excessively large,
diff --git a/src/parser_json.c b/src/parser_json.c
index 323d15bb..4ea5b432 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -9,7 +9,6 @@
#include <nft.h>
#include <errno.h>
-#include <stdint.h> /* needed by gmputil.h */
#include <string.h>
#include <syslog.h>
diff --git a/src/payload.c b/src/payload.c
index 9fdbf499..0afffb23 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -15,7 +15,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <net/if_arp.h>
#include <arpa/inet.h>
diff --git a/src/proto.c b/src/proto.c
index eb9c3ea1..4650e58c 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -13,7 +13,6 @@
#include <stddef.h>
#include <stdlib.h>
-#include <stdint.h>
#include <string.h>
#include <net/if_arp.h>
#include <arpa/inet.h>
diff --git a/src/rt.c b/src/rt.c
index 33820d4c..c8d75b36 100644
--- a/src/rt.c
+++ b/src/rt.c
@@ -14,7 +14,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
#include <linux/netfilter.h>
diff --git a/src/rule.c b/src/rule.c
index f2c4768e..8ea606e1 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -13,7 +13,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>
diff --git a/src/statement.c b/src/statement.c
index e6ea43d0..7b8e68f1 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -13,7 +13,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <syslog.h>
diff --git a/src/tcpopt.c b/src/tcpopt.c
index 5dd760a5..7b95a011 100644
--- a/src/tcpopt.c
+++ b/src/tcpopt.c
@@ -3,7 +3,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <netinet/in.h>
#include <netinet/ip6.h>