P4C
The P4 Compiler
Loading...
Searching...
No Matches
ubpfParser.h
1/*
2Copyright 2019 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_UBPF_UBPFPARSER_H_
18#define BACKENDS_UBPF_UBPFPARSER_H_
19
20#include "backends/ebpf/ebpfParser.h"
21#include "ir/ir.h"
22#include "ubpfType.h"
23
24namespace P4::UBPF {
25
27 public:
28 UBPFParserState(const IR::ParserState *state, EBPF::EBPFParser *parser)
29 : EBPF::EBPFParserState(state, parser) {}
30 void emit(EBPF::CodeBuilder *builder);
31};
32
34 public:
35 std::vector<UBPFParserState *> states;
36 const IR::Parameter *metadata;
37 EBPF::EBPFType *metadataType;
38
39 UBPFParser(const EBPF::EBPFProgram *program, const IR::ParserBlock *block,
40 const P4::TypeMap *typeMap)
41 : EBPF::EBPFParser(program, block, typeMap) {}
42
43 void emit(EBPF::CodeBuilder *builder);
44 bool build();
45};
46
47} // namespace P4::UBPF
48
49#endif /* BACKENDS_UBPF_UBPFPARSER_H_ */
Definition ebpf/codeGen.h:33
Definition ebpfParser.h:79
Definition ebpfParser.h:67
Definition ebpfProgram.h:39
Base class for EBPF types.
Definition ebpfType.h:29
Definition typeMap.h:41
Definition ubpfParser.h:33
Definition ubpfParser.h:26