P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::EBPF::TestTarget Class Reference

#include <target.h>

Inheritance diagram for P4::EBPF::TestTarget:
[legend]

Public Member Functions

cstring abortReturnCode () const override
 
cstring dataEnd (cstring base) const override
 
cstring dataOffset (cstring base) const override
 
cstring dropReturnCode () const override
 
void emitIncludes (Util::SourceCodeBuilder *builder) const override
 
void emitResizeBuffer (Util::SourceCodeBuilder *, cstring, cstring) const override
 
void emitTableDecl (Util::SourceCodeBuilder *builder, cstring tblName, TableKind tableKind, cstring keyType, cstring valueType, unsigned size) const override
 
cstring forwardReturnCode () const override
 
cstring packetDescriptorType () const override
 
cstring sysMapPath () const override
 
- Public Member Functions inherited from P4::EBPF::KernelSamplesTarget
 KernelSamplesTarget (bool emitTrace=false, cstring name="Linux kernel"_cs)
 
void annotateTableWithBTF (Util::SourceCodeBuilder *builder, cstring name, cstring keyType, cstring valueType) const
 
cstring dataLength (cstring base) const override
 
void emitCodeSection (Util::SourceCodeBuilder *builder, cstring sectionName) const override
 
void emitLicense (Util::SourceCodeBuilder *builder, cstring license) const override
 
void emitMain (Util::SourceCodeBuilder *builder, cstring functionName, cstring argName) const override
 
void emitMapInMapDecl (Util::SourceCodeBuilder *builder, cstring innerName, TableKind innerTableKind, cstring innerKeyType, cstring innerValueType, unsigned innerSize, cstring outerName, TableKind outerTableKind, cstring outerKeyType, unsigned outerSize) const override
 
void emitPreamble (Util::SourceCodeBuilder *builder) const override
 
void emitTableDeclSpinlock (Util::SourceCodeBuilder *builder, cstring tblName, TableKind tableKind, cstring keyType, cstring valueType, unsigned size) const override
 
void emitTableLookup (Util::SourceCodeBuilder *builder, cstring tblName, cstring key, cstring value) const override
 
void emitTableUpdate (Util::SourceCodeBuilder *builder, cstring tblName, cstring key, cstring value) const override
 
void emitTraceMessage (Util::SourceCodeBuilder *builder, const char *format, int argc=0,...) const override
 
void emitUserTableUpdate (Util::SourceCodeBuilder *builder, cstring tblName, cstring key, cstring value) const override
 
- Public Member Functions inherited from P4::EBPF::Target
virtual void emitTraceMessage (Util::SourceCodeBuilder *builder, const char *format) const
 

Additional Inherited Members

- Public Attributes inherited from P4::EBPF::Target
const cstring name
 
- Protected Member Functions inherited from P4::EBPF::Target
 Target (cstring name)
 
- Protected Attributes inherited from P4::EBPF::KernelSamplesTarget
bool emitTraceMessages
 

Detailed Description

A userspace test version with functionality equivalent to the kernel. Compiles with GCC.

Member Function Documentation

◆ abortReturnCode()

cstring P4::EBPF::TestTarget::abortReturnCode ( ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ dataEnd()

cstring P4::EBPF::TestTarget::dataEnd ( cstring base) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ dataOffset()

cstring P4::EBPF::TestTarget::dataOffset ( cstring base) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ dropReturnCode()

cstring P4::EBPF::TestTarget::dropReturnCode ( ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ emitIncludes()

void P4::EBPF::TestTarget::emitIncludes ( Util::SourceCodeBuilder * builder) const
overridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ emitResizeBuffer()

void P4::EBPF::TestTarget::emitResizeBuffer ( Util::SourceCodeBuilder * ,
cstring ,
cstring  ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ emitTableDecl()

void P4::EBPF::TestTarget::emitTableDecl ( Util::SourceCodeBuilder * builder,
cstring tblName,
TableKind tableKind,
cstring keyType,
cstring valueType,
unsigned size ) const
overridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ forwardReturnCode()

cstring P4::EBPF::TestTarget::forwardReturnCode ( ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ packetDescriptorType()

cstring P4::EBPF::TestTarget::packetDescriptorType ( ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.

◆ sysMapPath()

cstring P4::EBPF::TestTarget::sysMapPath ( ) const
inlineoverridevirtual

Reimplemented from P4::EBPF::KernelSamplesTarget.