Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _NFT_FIB_H_
0003 #define _NFT_FIB_H_
0004 
0005 #include <net/netfilter/nf_tables.h>
0006 
0007 struct nft_fib {
0008     u8          dreg;
0009     u8          result;
0010     u32         flags;
0011 };
0012 
0013 extern const struct nla_policy nft_fib_policy[];
0014 
0015 static inline bool
0016 nft_fib_is_loopback(const struct sk_buff *skb, const struct net_device *in)
0017 {
0018     return skb->pkt_type == PACKET_LOOPBACK || in->flags & IFF_LOOPBACK;
0019 }
0020 
0021 int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr);
0022 int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
0023          const struct nlattr * const tb[]);
0024 int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr,
0025              const struct nft_data **data);
0026 
0027 
0028 void nft_fib4_eval_type(const struct nft_expr *expr, struct nft_regs *regs,
0029             const struct nft_pktinfo *pkt);
0030 void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs,
0031            const struct nft_pktinfo *pkt);
0032 
0033 void nft_fib6_eval_type(const struct nft_expr *expr, struct nft_regs *regs,
0034             const struct nft_pktinfo *pkt);
0035 void nft_fib6_eval(const struct nft_expr *expr, struct nft_regs *regs,
0036            const struct nft_pktinfo *pkt);
0037 
0038 void nft_fib_store_result(void *reg, const struct nft_fib *priv,
0039               const struct net_device *dev);
0040 
0041 bool nft_fib_reduce(struct nft_regs_track *track,
0042             const struct nft_expr *expr);
0043 #endif