Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Virtual network interface support functions. More...
Data Structures | |
struct | virtual_interface_api |
struct | virtual_interface_context |
Macros | |
#define | NET_VIRTUAL_INTERFACE_INIT(dev_name, drv_name, init_fn, pm_control_fn, data, cfg, prio, api, mtu) |
Create a virtual network interface. Binding to another interface is done at runtime by calling net_virtual_interface_attach(). The attaching is done automatically when setting up tunneling when peer IP address is set in IP tunneling driver. More... | |
Enumerations | |
enum | virtual_interface_caps { VIRTUAL_INTERFACE_IPIP = BIT(1) } |
Functions | |
int | net_virtual_interface_attach (struct net_if *virtual_iface, struct net_if *iface) |
Attach virtual network interface to the given network interface. More... | |
struct net_if * | net_virtual_get_iface (struct net_if *iface) |
Return network interface related to this virtual network interface. The returned network interface is below this virtual network interface. More... | |
char * | net_virtual_get_name (struct net_if *iface, char *buf, size_t len) |
Return the name of the virtual network interface L2. More... | |
void | net_virtual_set_name (struct net_if *iface, const char *name) |
Set the name of the virtual network interface L2. More... | |
enum net_l2_flags | net_virtual_set_flags (struct net_if *iface, enum net_l2_flags flags) |
Set the L2 flags of the virtual network interface. More... | |
enum net_verdict | net_virtual_input (struct net_if *input_iface, struct net_addr *remote_addr, struct net_pkt *pkt) |
Feed the IP pkt to stack if tunneling is enabled. More... | |
Virtual network interface support functions.
#define NET_VIRTUAL_INTERFACE_INIT | ( | dev_name, | |
drv_name, | |||
init_fn, | |||
pm_control_fn, | |||
data, | |||
cfg, | |||
prio, | |||
api, | |||
mtu | |||
) |
#include <include/net/virtual.h>
Create a virtual network interface. Binding to another interface is done at runtime by calling net_virtual_interface_attach(). The attaching is done automatically when setting up tunneling when peer IP address is set in IP tunneling driver.
dev_name | Network device name. |
drv_name | The name this instance of the driver exposes to the system. |
init_fn | Address to the init function of the driver. |
pm_control_fn | Pointer to pm_control function. Can be NULL if not implemented. |
data | Pointer to the device's private data. |
cfg | The address to the structure containing the configuration information for this instance of the driver. |
prio | The initialization level at which configuration occurs. |
api | Provides an initial pointer to the API function struct used by the driver. Can be NULL. |
mtu | Maximum transfer unit in bytes for this network interface. This is the default value and its value can be tweaked at runtime. |
#include <include/net/virtual.h>
Virtual interface capabilities
Enumerator | |
---|---|
VIRTUAL_INTERFACE_IPIP | IPIP tunnel |
#include <include/net/virtual.h>
Return network interface related to this virtual network interface. The returned network interface is below this virtual network interface.
iface | Virtual network interface. |
char * net_virtual_get_name | ( | struct net_if * | iface, |
char * | buf, | ||
size_t | len | ||
) |
#include <include/net/virtual.h>
Return the name of the virtual network interface L2.
iface | Virtual network interface. |
buf | Buffer to store the name |
len | Max buffer length |
enum net_verdict net_virtual_input | ( | struct net_if * | input_iface, |
struct net_addr * | remote_addr, | ||
struct net_pkt * | pkt | ||
) |
#include <include/net/virtual.h>
Feed the IP pkt to stack if tunneling is enabled.
input_iface | Network interface receiving the pkt. |
remote_addr | IP address of the sender. |
pkt | Network packet. |
#include <include/net/virtual.h>
Attach virtual network interface to the given network interface.
virtual_iface | Virtual network interface. |
iface | Network interface we are attached to. This can be NULL, if we want to detach. |
enum net_l2_flags net_virtual_set_flags | ( | struct net_if * | iface, |
enum net_l2_flags | flags | ||
) |
#include <include/net/virtual.h>
Set the L2 flags of the virtual network interface.
iface | Virtual network interface. |
flags | L2 flags to set. |
#include <include/net/virtual.h>
Set the name of the virtual network interface L2.
iface | Virtual network interface. |
name | Name of the virtual L2 layer. |