Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.pipelines.basic; |
| 18 | |
| 19 | import org.onosproject.net.pi.model.PiActionId; |
| 20 | import org.onosproject.net.pi.model.PiActionParamId; |
| 21 | import org.onosproject.net.pi.model.PiCounterId; |
| 22 | import org.onosproject.net.pi.model.PiMatchFieldId; |
| 23 | import org.onosproject.net.pi.model.PiTableId; |
| 24 | |
Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 25 | /** |
| 26 | * Constants for INT pipeline. |
| 27 | */ |
| 28 | public final class IntConstants { |
| 29 | |
| 30 | // Hide default constructor |
| 31 | private IntConstants() { |
| 32 | } |
| 33 | |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame^] | 34 | 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 Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 39 | // Strings |
Jonghwan Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 40 | private static final String EGRESS = "egress"; |
Jonghwan Hyun | f5d5782 | 2018-05-09 10:19:50 -0700 | [diff] [blame] | 41 | 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 Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 46 | private static final String CTRL_INT_REPORT = EGRESS + DOT + "process_int_report"; |
Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 47 | 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 Hyun | f5d5782 | 2018-05-09 10:19:50 -0700 | [diff] [blame] | 61 | public static final PiMatchFieldId HDR_OUT_PORT_ID = |
Jonghwan Hyun | 6777d53 | 2018-11-18 20:50:16 +0900 | [diff] [blame] | 62 | PiMatchFieldId.of(STANDARD_METADATA + DOT + "egress_spec"); |
Jonghwan Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 63 | public static final PiMatchFieldId STD_META_INSTANCE_TYPE_ID = |
| 64 | PiMatchFieldId.of(STANDARD_METADATA + DOT + "instance_type"); |
Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 65 | |
| 66 | // Table IDs |
Jonghwan Hyun | f5d5782 | 2018-05-09 10:19:50 -0700 | [diff] [blame] | 67 | 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 Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 71 | 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 Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 79 | public static final PiTableId TBL_GENERATE_REPORT_ID = |
| 80 | PiTableId.of(CTRL_INT_REPORT + DOT + "tb_generate_report"); |
Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 81 | |
| 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 Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 179 | public static final PiActionId ACT_DO_REPORT_ENCAP_ID = |
| 180 | PiActionId.of(CTRL_INT_REPORT + DOT + "do_report_encapsulation"); |
Jonghwan Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 181 | |
| 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 Hyun | 722275f | 2018-05-14 15:44:56 -0700 | [diff] [blame] | 188 | 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 Hyun | b935882 | 2017-12-06 17:55:27 -0800 | [diff] [blame] | 194 | } |