FD.io VPP
v21.01.1
Vector Packet Processing
|
TunTap Kernel stack (reverse) punt/inject path. More...
Go to the source code of this file.
Data Structures | |
struct | subif_address_t |
struct | tuntap_per_thread_t |
TUNTAP per thread struct. More... | |
struct | tuntap_main_t |
TUNTAP node main state. More... | |
struct | in6_ifreq |
workaround for a known include file bug. More... | |
Variables | |
static vnet_device_class_t | tuntap_dev_class |
static vnet_hw_interface_class_t | tuntap_interface_class |
static tuntap_main_t | tuntap_main |
static vlib_node_registration_t | tuntap_tx_node |
(constructor) VLIB_REGISTER_NODE (tuntap_tx_node) More... | |
static char * | tuntap_rx_error_strings [] |
TUNTAP_RX error strings. More... | |
static vlib_node_registration_t | tuntap_rx_node |
(constructor) VLIB_REGISTER_NODE (tuntap_rx_node) More... | |
TunTap Kernel stack (reverse) punt/inject path.
This driver runs in one of two distinct modes:
By default, we select punt/inject mode.
Definition in file tuntap.c.
|
static |
CLI function for tun/tap config.
*vm | - vlib_main_t |
*input | - unformat_input_t |
Definition at line 484 of file tuntap.c.
|
static |
Clean up the tun/tap device.
*vm | - vlib_main_t |
Definition at line 434 of file tuntap.c.
|
static |
tun/tap node init
*vm | - vlib_main_t |
Definition at line 1011 of file tuntap.c.
|
static |
TX packet out tun/tap.
*vm | - vlib_main_t |
*node | - vlib_node_runtime_t |
*frame | - vlib_frame_t |
Definition at line 979 of file tuntap.c.
void tuntap_ip4_add_del_interface_address | ( | ip4_main_t * | im, |
uword | opaque, | ||
u32 | sw_if_index, | ||
ip4_address_t * | address, | ||
u32 | address_length, | ||
u32 | if_address_index, | ||
u32 | is_delete | ||
) |
Add or Del IP4 address to tun/tap interface.
*im | - ip4_main_t |
opaque | - uword |
sw_if_index | - u32 |
*address | - ip4_address_t |
is_delete | - u32 |
Tuntap disabled, or using a "normal" interface.
See if we already know about this subif
Definition at line 696 of file tuntap.c.
void tuntap_ip6_add_del_interface_address | ( | ip6_main_t * | im, |
uword | opaque, | ||
u32 | sw_if_index, | ||
ip6_address_t * | address, | ||
u32 | address_length, | ||
u32 | if_address_index, | ||
u32 | is_delete | ||
) |
Add or Del tun/tap interface address.
Both the v6 interface address API and the way ifconfig displays subinterfaces differ from their v4 counterparts. The code given here seems to work but YMMV.
*im | - ip6_main_t |
opaque | - uword |
sw_if_index | - u32 |
*address | - ip6_address_t |
address_length | - u32 |
if_address_index | - u32 |
is_delete | - u32 |
Definition at line 811 of file tuntap.c.
|
static |
Free the tun/tap frame.
*vm | - vlib_main_t |
*node | - vlib_node_runtime_t |
*frame | - vlib_frame_t |
Definition at line 934 of file tuntap.c.
|
static |
TX the tun/tap frame.
*vm | - vlib_main_t |
*node | - vlib_node_runtime_t |
*frame | - vlib_frame_t |
Definition at line 918 of file tuntap.c.
|
static |
Gets called when file descriptor is ready from epoll.
*uf | - clib_file_t |
Definition at line 418 of file tuntap.c.
|
static |
TUNTAP receive node.
tuntap-rx
*vm | - vlib_main_t |
*node | - vlib_node_runtime_t |
*frame | - vlib_frame_t |
Make sure we have some RX buffers.
Allocate RX buffers from end of rx_buffers. Turn them into iovecs to pass to readv.
We should have enough buffers left for an MTU sized packet.
Interface counters for tuntap interface.
Definition at line 241 of file tuntap.c.
|
static |
tuntap_tx
tuntap-tx
Output node, writes the buffers comprising the incoming frame to the tun/tap device, aka hands them to the Linux kernel stack.
*vm | - vlib_main_t |
*node | - vlib_node_runtime_t |
*frame | - vlib_frame_t |
VLIB buffer chain -> Unix iovec(s).
The normal interface path flattens the buffer chain
Definition at line 147 of file tuntap.c.
VNET_DEVICE_CLASS | ( | tuntap_dev_class | , |
static | |||
) |
VNET_HW_INTERFACE_CLASS | ( | tuntap_interface_class | , |
static | |||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
(constructor) VLIB_REGISTER_NODE (tuntap_rx_node)
|
static |
(constructor) VLIB_REGISTER_NODE (tuntap_tx_node)