P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpfPsaDigest.h
1
/*
2
Copyright 2022-present Orange
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations 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
23
namespace
P4::EBPF
{
24
25
class
DeparserBodyTranslatorPSA;
26
27
class
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,
44
DeparserBodyTranslatorPSA
*visitor);
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_ */
P4::EBPF::CodeBuilder
Definition
ebpf/codeGen.h:33
P4::EBPF::DeparserBodyTranslatorPSA
Definition
ebpfPsaDeparser.h:31
P4::EBPF::EBPFDigestPSA
Definition
ebpfPsaDigest.h:27
P4::EBPF::EBPFObject
Base class for EBPF objects.
Definition
ebpfObject.h:31
P4::EBPF::EBPFProgram
Definition
ebpfProgram.h:39
P4::EBPF::EBPFType
Base class for EBPF types.
Definition
ebpfType.h:29
P4::Inspector
Definition
visitor.h:400
P4::cstring
Definition
cstring.h:85
P4::EBPF
Definition
codeGen.cpp:25
backends
ebpf
psa
externs
ebpfPsaDigest.h
Generated by
1.12.0