Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Network packet capture

Network packet capture support functions. 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.
 

Detailed Description

Network packet capture support functions.

Function Documentation

◆ net_capture_cleanup()

static int net_capture_cleanup ( const struct device dev)
inlinestatic

#include <zephyr/net/capture.h>

Cleanup network packet capturing support.

This should be called after the capturing is done and resources can be released.

Parameters
devNetwork capture device. User must allocate using the net_capture_setup() function.
Returns
0 if ok, <0 if network packet capture cleanup failed

◆ net_capture_disable()

static int net_capture_disable ( const struct device dev)
inlinestatic

#include <zephyr/net/capture.h>

Disable network packet capturing support.

Parameters
devNetwork capture device
Returns
0 if ok, <0 if network packet capture disable failed

◆ net_capture_enable()

static int net_capture_enable ( const struct device dev,
struct net_if iface 
)
inlinestatic

#include <zephyr/net/capture.h>

Enable network packet capturing support.

This creates tunnel network interface where all the captured packets are pushed. The captured network packets are placed in UDP packets that are sent to tunnel peer.

Parameters
devNetwork capture device
ifaceNetwork interface we are starting to capture packets.
Returns
0 if ok, <0 if network packet capture enable failed

◆ net_capture_is_enabled()

static bool net_capture_is_enabled ( const struct device dev)
inlinestatic

#include <zephyr/net/capture.h>

Is network packet capture enabled or disabled.

Parameters
devNetwork capture device. If set to NULL, then the default capture device is used.
Returns
True if enabled, False if network capture is disabled.

◆ net_capture_setup()

int net_capture_setup ( const char *  remote_addr,
const char *  my_local_addr,
const char *  peer_addr,
const struct device **  dev 
)

#include <zephyr/net/capture.h>

Setup network packet capturing support.

Parameters
remote_addrThe value tells the tunnel remote/outer endpoint IP address. The IP address can be either IPv4 or IPv6 address. This address is used to select the network interface where the tunnel is created.
my_local_addrThe local/inner IP address of the tunnel. Can contain also port number which is used as UDP source port.
peer_addrThe peer/inner IP address of the tunnel. Can contain also port number which is used as UDP destination port.
devNetwork capture device. This is returned to the caller.
Returns
0 if ok, <0 if network packet capture setup failed