![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Class for VLAN packet rewriting. More...
#include <vlan.h>
Public Member Functions | |
Virtio_vlan_mangle () | |
Default constructor. | |
l4_uint32_t | copy_pkt (Buffer &dst, Buffer &src) |
Copy packet from src to dst. | |
void | rewrite_hdr (Virtio_net::Hdr *hdr) |
Rewrite the virtio network header. | |
Static Public Member Functions | |
static constexpr Virtio_vlan_mangle | add (l4_uint16_t tci) |
Construct an object that adds a VLAN tag. | |
static constexpr Virtio_vlan_mangle | remove () |
Construct an object that removes the VLAN tag. | |
|
inline |
|
inlinestaticconstexpr |
Construct an object that adds a VLAN tag.
tci | The TCI field of the VLAN tag to add. |
It is the callers responsibility to ensure that the packet is not already tagged.
Definition at line 64 of file vlan.h.
References Virtio_vlan_mangle().
Referenced by Virtio_port::handle_request().
|
inline |
Copy packet from src to dst.
src | Source packet buffer |
dst | Destination packet buffer |
Copy the data from src to dst, possibly rewriting parts of the packet. The method is expected to be called repeatedly until the source packet is finished. Partial copies are allowed (including reading nothing from the source buffer) as long as progress is made, i.e. repeatedly calling this function eventually consumes the source buffer.
Definition at line 93 of file vlan.h.
References L4virtio::Svr::Data_buffer::copy_to(), L4_LIKELY, L4virtio::Svr::Data_buffer::left, L4virtio::Svr::Data_buffer::pos, and L4virtio::Svr::Data_buffer::skip().
Referenced by Virtio_net_transfer::transfer().
|
inlinestaticconstexpr |
Construct an object that removes the VLAN tag.
This object assumes that the Ethernet packet has a VLAN tag and will slavishly remove the necessary bytes from the packet.
Definition at line 75 of file vlan.h.
References Virtio_vlan_mangle().
Referenced by Virtio_port::handle_request().
|
inline |
Rewrite the virtio network header.
hdr | The virtio header of the packet |
This method is called exactly once for every virtio network packet. Any necessary changes to the header are done in-place.
Definition at line 142 of file vlan.h.
References L4_UNLIKELY.
Referenced by Virtio_net_transfer::transfer().