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
10
namespace
P4::P4Tools
{
11
12
class
P4Constants
{
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_ */
P4::P4Tools::P4Constants
Definition
p4tools/common/lib/constants.h:12
P4::P4Tools::P4Constants::PARSER_ERROR_TIMEOUT
static constexpr int PARSER_ERROR_TIMEOUT
Parser execution time limit exceeded.
Definition
p4tools/common/lib/constants.h:26
P4::P4Tools::P4Constants::PARSER_ERROR_HEADER_TOO_SHORT
static constexpr int PARSER_ERROR_HEADER_TOO_SHORT
Extracting too many bits into a varbit field.
Definition
p4tools/common/lib/constants.h:24
P4::P4Tools::P4Constants::MATCH_KIND_LPM
static constexpr const char * MATCH_KIND_LPM
Longest-prefix match.
Definition
p4tools/common/lib/constants.h:35
P4::P4Tools::P4Constants::MATCH_KIND_TERNARY
static constexpr const char * MATCH_KIND_TERNARY
Ternary match, using a mask.
Definition
p4tools/common/lib/constants.h:33
P4::P4Tools::P4Constants::PARSER_ERROR_PACKET_TOO_SHORT
static constexpr int PARSER_ERROR_PACKET_TOO_SHORT
Not enough bits in packet for 'extract'.
Definition
p4tools/common/lib/constants.h:18
P4::P4Tools::P4Constants::NO_ERROR
static constexpr int NO_ERROR
No error.
Definition
p4tools/common/lib/constants.h:16
P4::P4Tools::P4Constants::MATCH_KIND_EXACT
static constexpr const char * MATCH_KIND_EXACT
Match bits exactly.
Definition
p4tools/common/lib/constants.h:31
P4::P4Tools::P4Constants::PARSER_ERROR_NO_MATCH
static constexpr int PARSER_ERROR_NO_MATCH
'select' expression has no matches
Definition
p4tools/common/lib/constants.h:20
P4::P4Tools::P4Constants::PARSER_ERROR_STACK_OUT_OF_BOUNDS
static constexpr int PARSER_ERROR_STACK_OUT_OF_BOUNDS
Reference to invalid element of a header stack.
Definition
p4tools/common/lib/constants.h:22
P4::P4Tools::P4Constants::PARSER_ERROR_INVALID_ARGUMENT
static constexpr int PARSER_ERROR_INVALID_ARGUMENT
Definition
p4tools/common/lib/constants.h:29
P4::P4Tools
Definition
common/compiler/compiler_result.cpp:7
backends
p4tools
common
lib
constants.h
Generated by
1.13.2