P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Testgen::PacketVars Class Reference

#include <packet_vars.h>

Static Public Attributes

static const IR::Member EMIT_BUFFER_LABEL
 
static const IR::Member INPUT_PACKET_LABEL
 
static const IR::Member PACKET_BUFFER_LABEL
 
static const IR::Type_Bits PACKET_SIZE_VAR_TYPE = IR::Type_Bits(32, false)
 
static const IR::SymbolicVariable PAYLOAD_SYMBOL
 

Detailed Description

Contains utility functions and variables related to the creation and manipulation of input packets.

Member Data Documentation

◆ EMIT_BUFFER_LABEL

const IR::Member P4::P4Tools::P4Testgen::PacketVars::EMIT_BUFFER_LABEL
static
Initial value:
=
IR::Member(new IR::PathExpression("*"), "emitBuffer")

The name of the emit buffer. Each time, emit is called, the emitted content is appended to this buffer. Typically, after exiting the control, the emit buffer is appended to the packet buffer.

◆ INPUT_PACKET_LABEL

const IR::Member P4::P4Tools::P4Testgen::PacketVars::INPUT_PACKET_LABEL
static
Initial value:
=
IR::Member(new IR::PathExpression("*"), "inputPacket")

The name of the input packet. The input packet defines the minimum size of the packet requires to pass this particular path. Typically, calls such as extract, advance, or lookahead cause the input packet to grow.

◆ PACKET_BUFFER_LABEL

const IR::Member P4::P4Tools::P4Testgen::PacketVars::PACKET_BUFFER_LABEL
static
Initial value:
=
IR::Member(new IR::PathExpression("*"), "packetBuffer")

The name of packet buffer. The packet buffer defines the data that can be consumed by the parser. If the packet buffer is empty, extract/advance/lookahead calls will cause the minimum packet size to grow. The packet buffer also forms the final output packet.

◆ PACKET_SIZE_VAR_TYPE

const IR::Type_Bits P4::P4Tools::P4Testgen::PacketVars::PACKET_SIZE_VAR_TYPE = IR::Type_Bits(32, false)
static

Specifies the type of the packet size variable. This is mostly used to generate bit vector constants.

◆ PAYLOAD_SYMBOL

const IR::SymbolicVariable P4::P4Tools::P4Testgen::PacketVars::PAYLOAD_SYMBOL
static
Initial value:
=
IR::SymbolicVariable(&PacketVars::PACKET_SIZE_VAR_TYPE, "*payload"_cs)
static const IR::Type_Bits PACKET_SIZE_VAR_TYPE
Definition packet_vars.h:14

Canonical name for the payload. This is used for consistent naming when attaching a payload to the packet.