2019-08-17 13:28:12 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
|
|
|
#ifndef _NET_DROP_MONITOR_H_
|
|
|
|
#define _NET_DROP_MONITOR_H_
|
|
|
|
|
|
|
|
#include <linux/ktime.h>
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/skbuff.h>
|
2020-02-25 10:45:20 +00:00
|
|
|
#include <net/flow_offload.h>
|
2019-08-17 13:28:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct net_dm_hw_metadata - Hardware-supplied packet metadata.
|
|
|
|
* @trap_group_name: Hardware trap group name.
|
|
|
|
* @trap_name: Hardware trap name.
|
|
|
|
* @input_dev: Input netdevice.
|
2020-02-25 10:45:20 +00:00
|
|
|
* @fa_cookie: Flow action user cookie.
|
2019-08-17 13:28:12 +00:00
|
|
|
*/
|
|
|
|
struct net_dm_hw_metadata {
|
|
|
|
const char *trap_group_name;
|
|
|
|
const char *trap_name;
|
|
|
|
struct net_device *input_dev;
|
2020-02-25 10:45:20 +00:00
|
|
|
const struct flow_action_cookie *fa_cookie;
|
2019-08-17 13:28:12 +00:00
|
|
|
};
|
|
|
|
|
2020-03-11 06:29:25 +00:00
|
|
|
#if IS_REACHABLE(CONFIG_NET_DROP_MONITOR)
|
2019-08-17 13:28:12 +00:00
|
|
|
void net_dm_hw_report(struct sk_buff *skb,
|
|
|
|
const struct net_dm_hw_metadata *hw_metadata);
|
|
|
|
#else
|
|
|
|
static inline void
|
|
|
|
net_dm_hw_report(struct sk_buff *skb,
|
|
|
|
const struct net_dm_hw_metadata *hw_metadata)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _NET_DROP_MONITOR_H_ */
|