blob: 312a0b415fb27ae2dcdbbde6eee27947f2d42d66 [file] [log] [blame]
Jonghwan Hyunb9358822017-12-06 17:55:27 -08001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.pipelines.basic;
18
19import org.onosproject.net.pi.model.PiActionId;
20import org.onosproject.net.pi.model.PiActionParamId;
21import org.onosproject.net.pi.model.PiCounterId;
22import org.onosproject.net.pi.model.PiMatchFieldId;
23import org.onosproject.net.pi.model.PiTableId;
24
Jonghwan Hyunb9358822017-12-06 17:55:27 -080025/**
26 * Constants for INT pipeline.
27 */
28public final class IntConstants {
29
30 // Hide default constructor
31 private IntConstants() {
32 }
33
Carmelo Cascone776be382018-12-12 19:03:57 -080034 private static final String HDR = "hdr";
35 private static final String DOT = ".";
36 private static final String STANDARD_METADATA = "standard_metadata";
37 private static final String LOCAL_METADATA = "local_metadata";
38
Jonghwan Hyunb9358822017-12-06 17:55:27 -080039 // Strings
Jonghwan Hyun722275f2018-05-14 15:44:56 -070040 private static final String EGRESS = "egress";
Jonghwan Hyunf5d57822018-05-09 10:19:50 -070041 private static final String CTRL_SET_SOURCE_SINK = EGRESS + DOT + "process_set_source_sink";
42 private static final String CTRL_INT_SOURCE = EGRESS + DOT + "process_int_source";
43 private static final String CTRL_INT_TRANSIT = EGRESS + DOT + "process_int_transit";
44 private static final String CTRL_INT_SINK = EGRESS + DOT + "process_int_sink";
45 private static final String CTRL_INT_OUTER_ENCAP = EGRESS + DOT + "process_int_outer_encap";
Jonghwan Hyun722275f2018-05-14 15:44:56 -070046 private static final String CTRL_INT_REPORT = EGRESS + DOT + "process_int_report";
Jonghwan Hyunb9358822017-12-06 17:55:27 -080047 private static final String INT_METADATA = "int_meta";
48 private static final String INT_HDR = "int_header";
49
50 // Header field IDs
51 public static final PiMatchFieldId LOCAL_META_SRC_PORT_ID =
52 PiMatchFieldId.of(LOCAL_METADATA + DOT + "l4_src_port");
53 public static final PiMatchFieldId LOCAL_META_DST_PORT_ID =
54 PiMatchFieldId.of(LOCAL_METADATA + DOT + "l4_dst_port");
55 public static final PiMatchFieldId INT_META_SINK_ID =
56 PiMatchFieldId.of(LOCAL_METADATA + DOT + INT_METADATA + DOT + "sink");
57 public static final PiMatchFieldId INT_HDR_INST_MASK_0003_ID =
58 PiMatchFieldId.of(HDR + DOT + INT_HDR + DOT + "instruction_mask_0003");
59 public static final PiMatchFieldId INT_HDR_INST_MASK_0407_ID =
60 PiMatchFieldId.of(HDR + DOT + INT_HDR + DOT + "instruction_mask_0407");
Jonghwan Hyunf5d57822018-05-09 10:19:50 -070061 public static final PiMatchFieldId HDR_OUT_PORT_ID =
Jonghwan Hyun6777d532018-11-18 20:50:16 +090062 PiMatchFieldId.of(STANDARD_METADATA + DOT + "egress_spec");
Jonghwan Hyun722275f2018-05-14 15:44:56 -070063 public static final PiMatchFieldId STD_META_INSTANCE_TYPE_ID =
64 PiMatchFieldId.of(STANDARD_METADATA + DOT + "instance_type");
Jonghwan Hyunb9358822017-12-06 17:55:27 -080065
66 // Table IDs
Jonghwan Hyunf5d57822018-05-09 10:19:50 -070067 public static final PiTableId TBL_SET_SOURCE_ID =
68 PiTableId.of(CTRL_SET_SOURCE_SINK + DOT + "tb_set_source");
69 public static final PiTableId TBL_SET_SINK_ID =
70 PiTableId.of(CTRL_SET_SOURCE_SINK + DOT + "tb_set_sink");
Jonghwan Hyunb9358822017-12-06 17:55:27 -080071 public static final PiTableId TBL_INT_SOURCE_ID =
72 PiTableId.of(CTRL_INT_SOURCE + DOT + "tb_int_source");
73 public static final PiTableId TBL_INT_INSERT_ID =
74 PiTableId.of(CTRL_INT_TRANSIT + DOT + "tb_int_insert");
75 public static final PiTableId TBL_INT_INST_0003_ID =
76 PiTableId.of(CTRL_INT_TRANSIT + DOT + "tb_int_inst_0003");
77 public static final PiTableId TBL_INT_INST_0407_ID =
78 PiTableId.of(CTRL_INT_TRANSIT + DOT + "tb_int_inst_0407");
Jonghwan Hyun722275f2018-05-14 15:44:56 -070079 public static final PiTableId TBL_GENERATE_REPORT_ID =
80 PiTableId.of(CTRL_INT_REPORT + DOT + "tb_generate_report");
Jonghwan Hyunb9358822017-12-06 17:55:27 -080081
82 // Counter IDs
83 public static final PiCounterId CNT_SET_SOURCE_SINK_ID =
84 PiCounterId.of(CTRL_SET_SOURCE_SINK + DOT + "counter_set_source_sink");
85 public static final PiCounterId CNT_INT_SOURCE_ID =
86 PiCounterId.of(CTRL_INT_SOURCE + DOT + "counter_int_source");
87 public static final PiCounterId CNT_INT_INSERT_ID =
88 PiCounterId.of(CTRL_INT_TRANSIT + DOT + "counter_int_insert");
89 public static final PiCounterId CNT_INT_INST_0003_ID =
90 PiCounterId.of(CTRL_INT_TRANSIT + DOT + "counter_int_inst_0003");
91 public static final PiCounterId CNT_INT_INST_0407_ID =
92 PiCounterId.of(CTRL_INT_TRANSIT + DOT + "counter_int_inst_0407");
93
94 // Action IDs
95 public static final PiActionId ACT_INT_SET_SOURCE_ID =
96 PiActionId.of(CTRL_SET_SOURCE_SINK + DOT + "int_set_source");
97 public static final PiActionId ACT_INT_SET_SINK_ID =
98 PiActionId.of(CTRL_SET_SOURCE_SINK + DOT + "int_set_sink");
99 public static final PiActionId ACT_INT_SOURCE_DSCP_ID =
100 PiActionId.of(CTRL_INT_SOURCE + DOT + "int_source_dscp");
101 public static final PiActionId ACT_INT_UPDATE_TOTAL_HOP_CNT_ID =
102 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_update_total_hop_cnt");
103 public static final PiActionId ACT_INT_TRANSIT_ID =
104 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_transit");
105 public static final PiActionId ACT_INT_SET_HEADER_0003_I0_ID =
106 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i0");
107 public static final PiActionId ACT_INT_SET_HEADER_0003_I1_ID =
108 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i1");
109 public static final PiActionId ACT_INT_SET_HEADER_0003_I2_ID =
110 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i2");
111 public static final PiActionId ACT_INT_SET_HEADER_0003_I3_ID =
112 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i3");
113 public static final PiActionId ACT_INT_SET_HEADER_0003_I4_ID =
114 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i4");
115 public static final PiActionId ACT_INT_SET_HEADER_0003_I5_ID =
116 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i5");
117 public static final PiActionId ACT_INT_SET_HEADER_0003_I6_ID =
118 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i6");
119 public static final PiActionId ACT_INT_SET_HEADER_0003_I7_ID =
120 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i7");
121 public static final PiActionId ACT_INT_SET_HEADER_0003_I8_ID =
122 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i8");
123 public static final PiActionId ACT_INT_SET_HEADER_0003_I9_ID =
124 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i9");
125 public static final PiActionId ACT_INT_SET_HEADER_0003_I10_ID =
126 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i10");
127 public static final PiActionId ACT_INT_SET_HEADER_0003_I11_ID =
128 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i11");
129 public static final PiActionId ACT_INT_SET_HEADER_0003_I12_ID =
130 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i12");
131 public static final PiActionId ACT_INT_SET_HEADER_0003_I13_ID =
132 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i13");
133 public static final PiActionId ACT_INT_SET_HEADER_0003_I14_ID =
134 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i14");
135 public static final PiActionId ACT_INT_SET_HEADER_0003_I15_ID =
136 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0003_i15");
137 public static final PiActionId ACT_INT_SET_HEADER_0407_I0_ID =
138 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i0");
139 public static final PiActionId ACT_INT_SET_HEADER_0407_I1_ID =
140 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i1");
141 public static final PiActionId ACT_INT_SET_HEADER_0407_I2_ID =
142 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i2");
143 public static final PiActionId ACT_INT_SET_HEADER_0407_I3_ID =
144 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i3");
145 public static final PiActionId ACT_INT_SET_HEADER_0407_I4_ID =
146 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i4");
147 public static final PiActionId ACT_INT_SET_HEADER_0407_I5_ID =
148 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i5");
149 public static final PiActionId ACT_INT_SET_HEADER_0407_I6_ID =
150 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i6");
151 public static final PiActionId ACT_INT_SET_HEADER_0407_I7_ID =
152 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i7");
153 public static final PiActionId ACT_INT_SET_HEADER_0407_I8_ID =
154 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i8");
155 public static final PiActionId ACT_INT_SET_HEADER_0407_I9_ID =
156 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i9");
157 public static final PiActionId ACT_INT_SET_HEADER_0407_I10_ID =
158 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i10");
159 public static final PiActionId ACT_INT_SET_HEADER_0407_I11_ID =
160 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i11");
161 public static final PiActionId ACT_INT_SET_HEADER_0407_I12_ID =
162 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i12");
163 public static final PiActionId ACT_INT_SET_HEADER_0407_I13_ID =
164 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i13");
165 public static final PiActionId ACT_INT_SET_HEADER_0407_I14_ID =
166 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i14");
167 public static final PiActionId ACT_INT_SET_HEADER_0407_I15_ID =
168 PiActionId.of(CTRL_INT_TRANSIT + DOT + "int_set_header_0407_i15");
169 public static final PiActionId ACT_INT_UPDATE_IPV4_ID =
170 PiActionId.of(CTRL_INT_OUTER_ENCAP + DOT + "int_update_ipv4");
171 public static final PiActionId ACT_INT_UPDATE_UDP_ID =
172 PiActionId.of(CTRL_INT_OUTER_ENCAP + DOT + "int_update_udp");
173 public static final PiActionId ACT_INT_UPDATE_SHIM_ID =
174 PiActionId.of(CTRL_INT_OUTER_ENCAP + DOT + "int_update_shim");
175 public static final PiActionId ACT_INT_RESTORE_HEADER_ID =
176 PiActionId.of(CTRL_INT_SINK + DOT + "restore_header");
177 public static final PiActionId ACT_INT_SINK_ID =
178 PiActionId.of(CTRL_INT_SINK + DOT + "int_sink");
Jonghwan Hyun722275f2018-05-14 15:44:56 -0700179 public static final PiActionId ACT_DO_REPORT_ENCAP_ID =
180 PiActionId.of(CTRL_INT_REPORT + DOT + "do_report_encapsulation");
Jonghwan Hyunb9358822017-12-06 17:55:27 -0800181
182 // Action param IDs
183 public static final PiActionParamId ACT_PRM_MAX_HOP_ID = PiActionParamId.of("max_hop");
184 public static final PiActionParamId ACT_PRM_INS_CNT_ID = PiActionParamId.of("ins_cnt");
185 public static final PiActionParamId ACT_PRM_INS_MASK0003_ID = PiActionParamId.of("ins_mask0003");
186 public static final PiActionParamId ACT_PRM_INS_MASK0407_ID = PiActionParamId.of("ins_mask0407");
187 public static final PiActionParamId ACT_PRM_SWITCH_ID = PiActionParamId.of("switch_id");
Jonghwan Hyun722275f2018-05-14 15:44:56 -0700188 public static final PiActionParamId ACT_PRM_SRC_MAC_ID = PiActionParamId.of("src_mac");
189 public static final PiActionParamId ACT_PRM_MON_MAC_ID = PiActionParamId.of("mon_mac");
190 public static final PiActionParamId ACT_PRM_SRC_IP_ID = PiActionParamId.of("src_ip");
191 public static final PiActionParamId ACT_PRM_MON_IP_ID = PiActionParamId.of("mon_ip");
192 public static final PiActionParamId ACT_PRM_MON_PORT_ID = PiActionParamId.of("mon_port");
193
Jonghwan Hyunb9358822017-12-06 17:55:27 -0800194}