]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
include: include <std{bool,int}.h> via <nft.h>
authorThomas Haller <thaller@redhat.com>
Fri, 25 Aug 2023 11:36:33 +0000 (13:36 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Aug 2023 12:59:19 +0000 (14:59 +0200)
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>
24 files changed:
include/datatype.h
include/dccpopt.h
include/expression.h
include/nft.h
include/nftables.h
include/rule.h
include/utils.h
src/dccpopt.c
src/evaluate.c
src/expression.c
src/exthdr.c
src/ipopt.c
src/mergesort.c
src/meta.c
src/netlink_delinearize.c
src/nftutils.c
src/nftutils.h
src/parser_json.c
src/payload.c
src/proto.c
src/rt.c
src/rule.c
src/statement.c
src/tcpopt.c

index be5c6d1b4011e18f7e11691509ab53f9f97d1862..9ce7359cd3404ffcaba199fd9209879d9ac7406a 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef NFTABLES_DATATYPE_H
 #define NFTABLES_DATATYPE_H
 
-#include <stdbool.h>
 #include <json.h>
 
 /**
index 9686932d74b7e8d0b1a83b489c1aec69d598594e..3617fc1ae7661249a51db11ff50e6b7f608bf4c1 100644 (file)
@@ -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
index 1f58a68c329f61444089d8f633a7cf2ff3ee1b81..733dd3cfc89cb62ffdf016d4e688ff260f43b229 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef NFTABLES_EXPRESSION_H
 #define NFTABLES_EXPRESSION_H
 
-#include <stdbool.h>
 #include <gmputil.h>
 #include <linux/netfilter/nf_tables.h>
 
index 0fd481c6ef04095b3e0191f793b7fb1edfdd82ef..967eb7bcea0965ee8c233b6662d8aea1fbe8b0a6 100644 (file)
@@ -4,4 +4,7 @@
 
 #include <config.h>
 
+#include <stdbool.h>
+#include <stdint.h>
+
 #endif /* NFTABLES_NFT_H */
index f073fa95a60d6f4bbb2634bcf72ef64c7422ffd1..219a101002064f816a5cb19aac35c972adeaa2dd 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef NFTABLES_NFTABLES_H
 #define NFTABLES_NFTABLES_H
 
-#include <stdbool.h>
 #include <stdarg.h>
 #include <limits.h>
 #include <utils.h>
index 13ab1bf3df5a8344a820a989b935688bb1efc1be..8e876d0a42ed5bf71cf6423b94da4a7db1500eaa 100644 (file)
@@ -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>
index 6764f9219ada1abddb0218df1ff8be725cb0bf0f..cee1e5c1e8aed00ce9392e925126beb629734829 100644 (file)
@@ -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>
index d713d9034c9202274e8165209acd3149a79d2b32..ebb645a98c5aa97379d2c77215c2490cbfa84cf2 100644 (file)
@@ -1,7 +1,6 @@
 #include <nft.h>
 
 #include <stddef.h>
-#include <stdint.h>
 
 #include <datatype.h>
 #include <dccpopt.h>
index 69a123511be8ccd5e13021b6fca6401a28ce2162..1ae2ef0de10c8573f1fce8a549b6739609b06e4e 100644 (file)
@@ -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>
index 8ef008910da59a7caa1744cbd60223c2de386b2f..147320f08937e1ac38df6a64cfda391de0c9d9b8 100644 (file)
@@ -13,7 +13,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <string.h>
 #include <limits.h>
 
index dd8c758153145ef18280bb865ee49c05765a5500..8aba7da1fa69603ef65108c35213586aee4fcb98 100644 (file)
@@ -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>
index 3ba67b011166f3d3bf209fa63bf06446d727d865..37f779d468ab7350368a9a85ce29d7c17aada0a9 100644 (file)
@@ -1,6 +1,5 @@
 #include <nft.h>
 
-#include <stdint.h>
 
 #include <netinet/in.h>
 #include <netinet/ip.h>
index 9315093b3359931d1b1747e8a24587e52a4d7e6d..5965236af6b7bd80f6a0f95a99af7aef243d9e42 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <nft.h>
 
-#include <stdint.h>
 #include <expression.h>
 #include <gmputil.h>
 #include <list.h>
index fcb872e669df64a51f40d40fd6c33c3c3ee184c1..4f383269d032f3cc25e5683aec08b10334847cac 100644 (file)
@@ -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>
index dfa816cfdfb6b3b6d945ab6924e0f581942c9714..1121f730ffa783d00c6150c45e0dff52cdeb5d10 100644 (file)
@@ -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>
index 14cb1fcf07de99a9f823695bd436290df19f8c2c..9c7fe5edc022e17dd7d1138536b6b6ed9b749e85 100644 (file)
@@ -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
index cb584b9ca32b932091c16ac0616a1b929d029f2c..7db56f428980a88c4433b6b75d729182e65807f5 100644 (file)
@@ -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,
index 323d15bb5b7117e87b4809834b5f8759385766b1..4ea5b4326a900d75953e7e765ec45b6f8a4f14b3 100644 (file)
@@ -9,7 +9,6 @@
 #include <nft.h>
 
 #include <errno.h>
-#include <stdint.h> /* needed by gmputil.h */
 #include <string.h>
 #include <syslog.h>
 
index 9fdbf4997c4e994223503a6360d3ba85a8b34611..0afffb2338ef5d064002c9aef6c5e94107c9f1f7 100644 (file)
@@ -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>
index eb9c3ea18e682e4fa935e7ecb3cf3b8849a8ab44..4650e58cd6ed517cd04c40144b90fdbf7e135f29 100644 (file)
@@ -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>
index 33820d4c871934291f248c28dca4a4c482164836..c8d75b369f8b9c34e77fe5a8a46718aa48bfcdcf 100644 (file)
--- 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>
index f2c4768e01ab30999306c51a22b2e950652097ba..8ea606e146b219dc955ac7c94d46f3875769f335 100644 (file)
@@ -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>
index e6ea43d0a4d11fdd66a3730dff869574640c104b..7b8e68f191179ffd70252e2281823c4b54f910e8 100644 (file)
@@ -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>
index 5dd760a51aabfe62e12037edb648445c302118fa..7b95a01134030e9d420b3774f7bded94e6ce64f7 100644 (file)
@@ -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>