P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/ebpf/table_stepper.h
1/*
2 * SPDX-FileCopyrightText: 2022 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TABLE_STEPPER_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TABLE_STEPPER_H_
9
10#include <vector>
11
12#include "ir/ir.h"
13
14#include "backends/p4tools/modules/testgen/core/small_step/table_stepper.h"
15#include "backends/p4tools/modules/testgen/lib/execution_state.h"
16#include "backends/p4tools/modules/testgen/lib/test_spec.h"
17#include "backends/p4tools/modules/testgen/targets/ebpf/expr_stepper.h"
18
19namespace P4::P4Tools::P4Testgen::EBPF {
20
21class EBPFTableStepper : public TableStepper {
22 private:
28 enum class TableImplementation { standard, constant, skip };
29
31 struct EBPFProperties {
33 TableImplementation implementaton = TableImplementation::standard;
34 } EBPFProperties;
35
36 protected:
38 const std::vector<const IR::ActionListElement *> &tableActionList) override;
39
40 void evalTargetTable(
41 const std::vector<const IR::ActionListElement *> &tableActionList) override;
42
43 public:
44 explicit EBPFTableStepper(EBPFExprStepper *stepper, const IR::P4Table *table);
45};
46
47} // namespace P4::P4Tools::P4Testgen::EBPF
48
49#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TABLE_STEPPER_H_ */
Definition targets/ebpf/expr_stepper.h:21
void checkTargetProperties(const std::vector< const IR::ActionListElement * > &tableActionList) override
Definition targets/ebpf/table_stepper.cpp:20
void evalTargetTable(const std::vector< const IR::ActionListElement * > &tableActionList) override
Definition targets/ebpf/table_stepper.cpp:37
const IR::P4Table * table
The table for this particular stepper.
Definition core/small_step/table_stepper.h:32
ExprStepper * stepper
Reference to the calling expression stepper.
Definition core/small_step/table_stepper.h:29