]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
include: fix missing definitions in <cache.h>/<headers.h>
authorThomas Haller <thaller@redhat.com>
Wed, 20 Sep 2023 14:26:03 +0000 (16:26 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Sep 2023 16:15:38 +0000 (18:15 +0200)
The headers should be self-contained so they can be included in any
order. With exception of <nft.h>, which any internal header can rely on.

Some fixes for <cache.h>/<headers.h>.

In case of <cache.h>, forward declare some of the structs instead of
including the headers. <headers.h> uses struct in6_addr.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/cache.h
include/headers.h

index 934c3a74fa958170e7a1c9e8a371a44ba97bc95a..e66b0af5fe0f637263f2da7e196bcbc522593283 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <string.h>
 
+#include <list.h>
+
 struct handle;
 
 enum cache_level_bits {
@@ -66,6 +68,7 @@ struct nft_cache_filter {
 };
 
 struct nft_cache;
+struct nft_ctx;
 enum cmd_ops;
 
 int nft_cache_evaluate(struct nft_ctx *nft, struct list_head *cmds,
@@ -97,6 +100,8 @@ void chain_cache_add(struct chain *chain, struct table *table);
 void chain_cache_del(struct chain *chain);
 struct chain *chain_cache_find(const struct table *table, const char *name);
 
+struct set;
+
 void set_cache_add(struct set *set, struct table *table);
 void set_cache_del(struct set *set);
 struct set *set_cache_find(const struct table *table, const char *name);
@@ -121,6 +126,8 @@ void table_cache_del(struct table *table);
 struct table *table_cache_find(const struct cache *cache, const char *name,
                               uint32_t family);
 
+struct obj;
+
 void obj_cache_add(struct obj *obj, struct table *table);
 void obj_cache_del(struct obj *obj);
 struct obj *obj_cache_find(const struct table *table, const char *name,
@@ -138,6 +145,8 @@ struct nft_cache {
        uint32_t                flags;
 };
 
+struct netlink_ctx;
+
 void nft_chain_cache_update(struct netlink_ctx *ctx, struct table *table,
                            const char *chain);
 
index 759f93bf8c7a9e3928f49cfd809e8cbe0645090e..13324c72c734202cfae7fda34436f3d9d3770de4 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef NFTABLES_HEADERS_H
 #define NFTABLES_HEADERS_H
 
+#include <netinet/in.h>
+
 #ifndef IPPROTO_UDPLITE
 # define IPPROTO_UDPLITE       136
 #endif