bmv2
Designing your own switch target with bmv2
Public Member Functions | List of all members
bm::Deparser Class Reference
Inheritance diagram for bm::Deparser:
Inheritance graph
[legend]

Public Member Functions

void deparse (Packet *pkt) const
 
- Public Member Functions inherited from bm::NamedP4Object
const std::string & get_name () const
 Get the name of the P4 instance. More...
 
p4object_id_t get_id () const
 Get the compiler-provided id. More...
 
 NamedP4Object (const NamedP4Object &other)=delete
 Deleted copy constructor. More...
 
NamedP4Objectoperator= (const NamedP4Object &other)=delete
 Deleted copy assignment operator. More...
 
 NamedP4Object (NamedP4Object &&other)=default
 Default move constructor. More...
 
NamedP4Objectoperator= (NamedP4Object &&other)=default
 Default assignment operator. More...
 

Detailed Description

Implements a P4 deparser. Since there are no deparser objects per se in the P4 language yet, the deparser logic is obtained by generating a topological sorting of the parse graph.

Member Function Documentation

◆ deparse()

void bm::Deparser::deparse ( Packet pkt) const

Deparse all valid headers (including headers in stacks) in the correct order, in front of the packet data; the packet data being everything that was not extracted by the parser. This function also updates checksums. After calling this method, the packet data consists of header data + payload, and you can transmit the packet. You can get the packet data and data size by calling respectively Packet::data() and Packet::get_data_size().


The documentation for this class was generated from the following file: