Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _NFT_META_H_
0003 #define _NFT_META_H_
0004 
0005 #include <net/netfilter/nf_tables.h>
0006 
0007 struct nft_meta {
0008     enum nft_meta_keys  key:8;
0009     u8          len;
0010     union {
0011         u8      dreg;
0012         u8      sreg;
0013     };
0014 };
0015 
0016 extern const struct nla_policy nft_meta_policy[];
0017 
0018 int nft_meta_get_init(const struct nft_ctx *ctx,
0019               const struct nft_expr *expr,
0020               const struct nlattr * const tb[]);
0021 
0022 int nft_meta_set_init(const struct nft_ctx *ctx,
0023               const struct nft_expr *expr,
0024               const struct nlattr * const tb[]);
0025 
0026 int nft_meta_get_dump(struct sk_buff *skb,
0027               const struct nft_expr *expr);
0028 
0029 int nft_meta_set_dump(struct sk_buff *skb,
0030               const struct nft_expr *expr);
0031 
0032 void nft_meta_get_eval(const struct nft_expr *expr,
0033                struct nft_regs *regs,
0034                const struct nft_pktinfo *pkt);
0035 
0036 void nft_meta_set_eval(const struct nft_expr *expr,
0037                struct nft_regs *regs,
0038                const struct nft_pktinfo *pkt);
0039 
0040 void nft_meta_set_destroy(const struct nft_ctx *ctx,
0041               const struct nft_expr *expr);
0042 
0043 int nft_meta_set_validate(const struct nft_ctx *ctx,
0044               const struct nft_expr *expr,
0045               const struct nft_data **data);
0046 
0047 bool nft_meta_get_reduce(struct nft_regs_track *track,
0048              const struct nft_expr *expr);
0049 #endif