P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
tc_defines.h
1/*
2Copyright (C) 2023 Intel Corporation
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
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing,
11software distributed 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
14and limitations under the License.
15*/
16
17#ifndef BACKENDS_TC_TC_DEFINES_H_
18#define BACKENDS_TC_TC_DEFINES_H_
19
20namespace TC {
21
22inline constexpr auto DEFAULT_TABLE_ENTRIES = 2048;
23inline constexpr auto DEFAULT_KEY_MASK = 8;
24inline constexpr auto PORTID_BITWIDTH = 32;
25inline constexpr auto DEFAULT_KEY_ID = 1;
26inline constexpr auto DEFAULT_METADATA_ID = 1;
27inline constexpr auto BITWIDTH = 32;
28inline constexpr auto DEFAULT_TIMER_PROFILES = 4;
29
30// Supported data types.
31inline constexpr auto BIT_TYPE = 0;
32inline constexpr auto DEV_TYPE = 1;
33inline constexpr auto MACADDR_TYPE = 2;
34inline constexpr auto IPV4_TYPE = 3;
35inline constexpr auto IPV6_TYPE = 4;
36inline constexpr auto BE16_TYPE = 5;
37inline constexpr auto BE32_TYPE = 6;
38inline constexpr auto BE64_TYPE = 7;
39
40inline constexpr auto PARAM_INDEX_0 = 0;
41inline constexpr auto PARAM_INDEX_1 = 1;
42inline constexpr auto PARAM_INDEX_2 = 2;
43inline constexpr auto PARAM_INDEX_3 = 3;
44
45inline constexpr auto SET = 1;
46inline constexpr auto RESET = 0;
47
48// PNA parser metadata fields.
49inline constexpr auto PARSER_RECIRCULATED = 0;
50inline constexpr auto PARSER_INPUT_PORT = 1;
51
52// PNA input metadata fields.
53inline constexpr auto INPUT_RECIRCULATED = 0;
54inline constexpr auto INPUT_TIMESTAMP = 1;
55inline constexpr auto INPUT_PARSER_ERROR = 2;
56inline constexpr auto INPUT_CLASS_OF_SERVICE = 3;
57inline constexpr auto INPUT_INPUT_PORT = 4;
58
59// PNA output metadata fields.
60inline constexpr auto OUTPUT_CLASS_OF_SERVICE = 0;
61
62// Kernel metadata fields.
63inline constexpr auto UNDEFINED = 0;
64inline constexpr auto UNSUPPORTED = 1;
65inline constexpr auto SKBREDIR = 2;
66inline constexpr auto SKBIIF = 3;
67inline constexpr auto SKBTSTAMP = 4;
68inline constexpr auto SKBPRIO = 5;
69
70inline constexpr auto MAX_PNA_PARSER_META = 2;
71inline constexpr auto MAX_PNA_INPUT_META = 5;
72inline constexpr auto MAX_PNA_OUTPUT_META = 1;
73
74inline constexpr auto TABLEDEFAULT = 0;
75inline constexpr auto TABLEONLY = 1;
76inline constexpr auto DEFAULTONLY = 2;
77
78inline constexpr auto EXACT_TYPE = 0;
79inline constexpr auto LPM_TYPE = 1;
80inline constexpr auto TERNARY_TYPE = 2;
81} // namespace TC
82
83#endif /* BACKENDS_TC_TC_DEFINES_H_ */
This file defines functions for the pass to generate the introspection file.
Definition backend.cpp:24