Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
capture.h File Reference

Network packet capture definitions. More...

#include <zephyr/kernel.h>
#include <zephyr/device.h>

Go to the source code of this file.

Data Structures

struct  net_capture_cooked
 The context information for cooked mode capture. More...
struct  net_capture_info
 Network packet capture device information. More...

Macros

#define NET_CAPTURE_LL_ADDRLEN   8
 Maximum length of a link-layer address.

Typedefs

typedef void(* net_capture_cb_t) (struct net_capture_info *info, void *user_data)
 Callback used while iterating over capture devices.

Enumerations

enum  net_capture_packet_type {
  NET_CAPTURE_HOST , NET_CAPTURE_BROADCAST , NET_CAPTURE_MULTICAST , NET_CAPTURE_OTHERHOST ,
  NET_CAPTURE_OUTGOING
}
 The type and direction of the captured data. More...

Functions

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_cleanup (const struct device *dev)
 Cleanup network packet capturing support.
static int net_capture_enable (const struct device *dev, struct net_if *iface)
 Enable network packet capturing support.
static bool net_capture_is_enabled (const struct device *dev)
 Is network packet capture enabled or disabled.
static int net_capture_disable (const struct device *dev)
 Disable network packet capturing support.
static void net_capture_pkt (struct net_if *iface, struct net_pkt *pkt)
 Check if the network packet needs to be captured or not.
static int net_capture_cooked_setup (struct net_capture_cooked *ctx, uint16_t hatype, uint16_t halen, uint8_t *addr)
 Initialize cooked mode capture context.
static void net_capture_data (struct net_capture_cooked *ctx, const uint8_t *data, size_t len, enum net_capture_packet_type type, uint16_t ptype)
 Capture arbitrary data from source that does not have an interface.
static void net_capture_foreach (net_capture_cb_t cb, void *user_data)
 Go through all the capture devices in order to get information about them.

Detailed Description

Network packet capture definitions.

Definitions for capturing network packets.