be2861dc36
This patch adds support for packet mirroring and redirection. The nft_fwd_dup_netdev_offload() function configures the flow_action object for the fwd and the dup actions. Extend nft_flow_rule_destroy() to release the net_device object when the flow_rule object is released, since nft_fwd_dup_netdev_offload() bumps the net_device reference counter. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: wenxu <wenxu@ucloud.cn>
17 lines
461 B
C
17 lines
461 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _NF_DUP_NETDEV_H_
|
|
#define _NF_DUP_NETDEV_H_
|
|
|
|
#include <net/netfilter/nf_tables.h>
|
|
|
|
void nf_dup_netdev_egress(const struct nft_pktinfo *pkt, int oif);
|
|
void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif);
|
|
|
|
struct nft_offload_ctx;
|
|
struct nft_flow_rule;
|
|
|
|
int nft_fwd_dup_netdev_offload(struct nft_offload_ctx *ctx,
|
|
struct nft_flow_rule *flow,
|
|
enum flow_action_id id, int oif);
|
|
#endif
|