P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4tools/common/lib/constants.h
1#ifndef BACKENDS_P4TOOLS_COMMON_LIB_CONSTANTS_H_
2#define BACKENDS_P4TOOLS_COMMON_LIB_CONSTANTS_H_
3
4namespace P4::P4Tools {
5
7 public:
8 // Parser error codes, copied from core.p4.
10 static constexpr int NO_ERROR = 0x0000;
12 static constexpr int PARSER_ERROR_PACKET_TOO_SHORT = 0x0001;
14 static constexpr int PARSER_ERROR_NO_MATCH = 0x0002;
16 static constexpr int PARSER_ERROR_STACK_OUT_OF_BOUNDS = 0x0003;
18 static constexpr int PARSER_ERROR_HEADER_TOO_SHORT = 0x0004;
20 static constexpr int PARSER_ERROR_TIMEOUT = 0x005;
23 static constexpr int PARSER_ERROR_INVALID_ARGUMENT = 0x0020;
25 static constexpr const char *MATCH_KIND_EXACT = "exact";
27 static constexpr const char *MATCH_KIND_TERNARY = "ternary";
29 static constexpr const char *MATCH_KIND_LPM = "lpm";
30};
31
32} // namespace P4::P4Tools
33
34#endif /* BACKENDS_P4TOOLS_COMMON_LIB_CONSTANTS_H_ */
Definition p4tools/common/lib/constants.h:6
static constexpr int PARSER_ERROR_TIMEOUT
Parser execution time limit exceeded.
Definition p4tools/common/lib/constants.h:20
static constexpr int PARSER_ERROR_HEADER_TOO_SHORT
Extracting too many bits into a varbit field.
Definition p4tools/common/lib/constants.h:18
static constexpr const char * MATCH_KIND_LPM
Longest-prefix match.
Definition p4tools/common/lib/constants.h:29
static constexpr const char * MATCH_KIND_TERNARY
Ternary match, using a mask.
Definition p4tools/common/lib/constants.h:27
static constexpr int PARSER_ERROR_PACKET_TOO_SHORT
Not enough bits in packet for 'extract'.
Definition p4tools/common/lib/constants.h:12
static constexpr int NO_ERROR
No error.
Definition p4tools/common/lib/constants.h:10
static constexpr const char * MATCH_KIND_EXACT
Match bits exactly.
Definition p4tools/common/lib/constants.h:25
static constexpr int PARSER_ERROR_NO_MATCH
'select' expression has no matches
Definition p4tools/common/lib/constants.h:14
static constexpr int PARSER_ERROR_STACK_OUT_OF_BOUNDS
Reference to invalid element of a header stack.
Definition p4tools/common/lib/constants.h:16
static constexpr int PARSER_ERROR_INVALID_ARGUMENT
Definition p4tools/common/lib/constants.h:23
Definition common/compiler/compiler_result.cpp:3