P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpfPsaDigest.h
1/*
2Copyright 2022-present Orange
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef BACKENDS_EBPF_PSA_EXTERNS_EBPFPSADIGEST_H_
18#define BACKENDS_EBPF_PSA_EXTERNS_EBPFPSADIGEST_H_
19
20#include "backends/ebpf/ebpfObject.h"
21#include "backends/ebpf/ebpfProgram.h"
22
23namespace P4::EBPF {
24
25class DeparserBodyTranslatorPSA;
26
27class EBPFDigestPSA : public EBPFObject {
28 private:
29 cstring instanceName;
30 const EBPFProgram *program;
31 cstring valueTypeName;
32 const IR::Declaration_Instance *declaration;
35 int maxDigestQueueSize = 128;
36
37 public:
38 EBPFType *valueType;
39 EBPFDigestPSA(const EBPFProgram *program, const IR::Declaration_Instance *di);
40
41 void emitTypes(CodeBuilder *builder);
42 void emitInstance(CodeBuilder *builder) const;
43 void processMethod(CodeBuilder *builder, cstring method, const IR::MethodCallExpression *expr,
45
46 virtual void emitPushElement(CodeBuilder *builder, const IR::Expression *elem,
47 Inspector *codegen) const;
48 virtual void emitPushElement(CodeBuilder *builder, cstring elem) const;
49};
50
51} // namespace P4::EBPF
52
53#endif /* BACKENDS_EBPF_PSA_EXTERNS_EBPFPSADIGEST_H_ */
Definition ebpf/codeGen.h:33
Definition ebpfPsaDeparser.h:31
Definition ebpfPsaDigest.h:27
Base class for EBPF objects.
Definition ebpfObject.h:31
Definition ebpfProgram.h:39
Base class for EBPF types.
Definition ebpfType.h:29
Definition visitor.h:400
Definition cstring.h:85
Definition codeGen.cpp:25