P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpfPsaRandom.h
1/*
2Copyright 2022-present Orange
3Copyright 2022-present Open Networking Foundation
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 http://www.apache.org/licenses/LICENSE-2.0
8Unless required by applicable law or agreed to in writing, software
9distributed under the License is distributed on an "AS IS" BASIS,
10WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11See the License for the specific language governing permissions and
12limitations under the License.
13*/
14#ifndef BACKENDS_EBPF_PSA_EXTERNS_EBPFPSARANDOM_H_
15#define BACKENDS_EBPF_PSA_EXTERNS_EBPFPSARANDOM_H_
16
17#include "backends/ebpf/ebpfObject.h"
18#include "frontends/p4/methodInstance.h"
19
20namespace P4::EBPF {
21
22class EBPFRandomPSA : public EBPFObject {
23 unsigned int minValue, maxValue;
24 long range;
25
26 public:
27 explicit EBPFRandomPSA(const IR::Declaration_Instance *di);
28
29 void processMethod(CodeBuilder *builder, const P4::ExternMethod *method) const;
30 void emitRead(CodeBuilder *builder) const;
31};
32
33} // namespace P4::EBPF
34
35#endif // BACKENDS_EBPF_PSA_EXTERNS_EBPFPSARANDOM_H_
Definition ebpf/codeGen.h:33
Base class for EBPF objects.
Definition ebpfObject.h:31
Definition ebpfPsaRandom.h:22
Definition methodInstance.h:168
Definition codeGen.cpp:25