17#ifndef BACKENDS_EBPF_PSA_EBPFPSADEPARSER_H_
18#define BACKENDS_EBPF_PSA_EBPFPSADEPARSER_H_
20#include "backends/ebpf/ebpfDeparser.h"
21#include "backends/ebpf/psa/ebpfPsaParser.h"
22#include "backends/ebpf/psa/externs/ebpfPsaChecksum.h"
23#include "backends/ebpf/psa/externs/ebpfPsaDigest.h"
24#include "ebpfPsaControl.h"
41 const IR::Parameter *user_metadata;
42 const IR::Parameter *istd;
43 const IR::Parameter *resubmit_meta;
44 std::map<cstring, EBPFChecksumPSA *> checksums;
45 std::map<cstring, EBPFDigestPSA *> digests;
48 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
49 :
EBPFDeparser(program, control, parserHeaders), istd(istd) {
54 void emitDigestInstances(
CodeBuilder *builder)
const;
55 void emitDeclaration(
CodeBuilder *builder,
const IR::Declaration *decl)
override;
58 auto result = ::P4::get(checksums, name);
59 BUG_CHECK(result !=
nullptr,
"No checksum named %1%", name);
64 auto result = ::P4::get(digests, name);
65 BUG_CHECK(result !=
nullptr,
"No digest named %1%", name);
70 controlBlock->container->body->apply(*codeGen);
80 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
83 bool build()
override;
91 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
94 bool build()
override;
102 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
113 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
122 const IR::ControlBlock *control,
123 const IR::Parameter *parserHeaders,
124 const IR::Parameter *istd)
127 void emitDeparserExternCalls(
CodeBuilder *builder)
override {
138 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
149 const IR::Parameter *parserHeaders,
const IR::Parameter *istd)
Definition ebpf/codeGen.h:33
This translator emits deparser externs.
Definition ebpfDeparser.h:27
Definition ebpfPsaDeparser.h:31
Definition ebpfPsaChecksum.h:25
Definition ebpfDeparser.h:63
Definition ebpfPsaDeparser.h:39
Definition ebpfPsaDigest.h:27
Definition ebpfProgram.h:39
Definition ebpfPsaDeparser.h:88
Definition ebpfPsaDeparser.h:77
Definition ebpfPsaDeparser.h:110
Definition ebpfPsaDeparser.h:119
void emitPreDeparser(CodeBuilder *builder) override
Definition ebpfPsaDeparser.cpp:181
Definition ebpfPsaDeparser.h:99
void emitPreDeparser(CodeBuilder *builder) override
Definition ebpfPsaDeparser.cpp:137
Definition ebpfPsaDeparser.h:146
void emitPreDeparser(CodeBuilder *builder) override
Definition ebpfPsaDeparser.cpp:291
Definition ebpfPsaDeparser.h:135
void emitPreDeparser(CodeBuilder *builder) override
Definition ebpfPsaDeparser.cpp:196
Definition methodInstance.h:194
Definition methodInstance.h:168
Definition codeGen.cpp:25