13#ifndef ZEPHYR_INCLUDE_NET_CAPTURE_H_
14#define ZEPHYR_INCLUDE_NET_CAPTURE_H_
33struct net_capture_interface_api {
37 int (*cleanup)(
const struct device *dev);
40 int (*enable)(
const struct device *dev,
struct net_if *iface);
43 int (*disable)(
const struct device *dev);
72 const char *peer_addr,
const struct device **dev);
87#if defined(CONFIG_NET_CAPTURE)
88 const struct net_capture_interface_api *api =
89 (
const struct net_capture_interface_api *)dev->
api;
91 return api->cleanup(dev);
114#if defined(CONFIG_NET_CAPTURE)
115 const struct net_capture_interface_api *api =
116 (
const struct net_capture_interface_api *)dev->
api;
118 return api->enable(dev, iface);
136#if defined(CONFIG_NET_CAPTURE)
137 const struct net_capture_interface_api *api =
138 (
const struct net_capture_interface_api *)dev->
api;
140 return api->is_enabled(dev);
157#if defined(CONFIG_NET_CAPTURE)
158 const struct net_capture_interface_api *api =
159 (
const struct net_capture_interface_api *)dev->
api;
161 return api->disable(dev);
182#if defined(CONFIG_NET_CAPTURE)
183 const struct net_capture_interface_api *api =
184 (
const struct net_capture_interface_api *)dev->
api;
186 return api->send(dev, iface, pkt);
205#if defined(CONFIG_NET_CAPTURE)
206void net_capture_pkt(
struct net_if *iface,
struct net_pkt *pkt);
208static inline void net_capture_pkt(
struct net_if *iface,
struct net_pkt *pkt)
215struct net_capture_info {
216 const struct device *capture_dev;
217 struct net_if *capture_iface;
218 struct net_if *tunnel_iface;
231typedef void (*net_capture_cb_t)(
struct net_capture_info *info,
243#if defined(CONFIG_NET_CAPTURE)
244void net_capture_foreach(net_capture_cb_t cb,
void *
user_data);
246static inline void net_capture_foreach(net_capture_cb_t cb,
void *
user_data)
void
Definition: eswifi_shell.c:15
static int net_capture_disable(const struct device *dev)
Disable network packet capturing support.
Definition: capture.h:155
static int net_capture_send(const struct device *dev, struct net_if *iface, struct net_pkt *pkt)
Send captured packet.
Definition: capture.h:178
static bool net_capture_is_enabled(const struct device *dev)
Is network packet capture enabled or disabled.
Definition: capture.h:134
static int net_capture_cleanup(const struct device *dev)
Cleanup network packet capturing support.
Definition: capture.h:85
int net_capture_setup(const char *remote_addr, const char *my_local_addr, const char *peer_addr, const struct device **dev)
Setup network packet capturing support.
static int net_capture_enable(const struct device *dev, struct net_if *iface)
Enable network packet capturing support.
Definition: capture.h:111
#define ENOTSUP
Definition: errno.h:115
#define bool
Definition: stdbool.h:13
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373
Network Interface structure.
Definition: net_if.h:468
Network packet.
Definition: net_pkt.h:62
static const intptr_t user_data[5]
Definition: main.c:590
NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags)