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