Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [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 | |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 19 | import org.onosproject.net.pi.model.PiActionId; |
| 20 | import org.onosproject.net.pi.model.PiActionParamId; |
| 21 | import org.onosproject.net.pi.model.PiActionProfileId; |
| 22 | import org.onosproject.net.pi.model.PiControlMetadataId; |
| 23 | import org.onosproject.net.pi.model.PiCounterId; |
| 24 | import org.onosproject.net.pi.model.PiMatchFieldId; |
| 25 | import org.onosproject.net.pi.model.PiTableId; |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 26 | /** |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 27 | * Constants for basic pipeline. |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 28 | */ |
| 29 | public final class BasicConstants { |
| 30 | |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 31 | // hide default constructor |
| 32 | private BasicConstants() { |
| 33 | } |
Carmelo Cascone | 81929aa | 2018-04-07 01:38:55 -0700 | [diff] [blame] | 34 | |
| 35 | // Header field IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 36 | public static final PiMatchFieldId HDR_HDR_IPV4_PROTOCOL = |
| 37 | PiMatchFieldId.of("hdr.ipv4.protocol"); |
| 38 | public static final PiMatchFieldId HDR_HDR_IPV4_SRC_ADDR = |
| 39 | PiMatchFieldId.of("hdr.ipv4.src_addr"); |
| 40 | public static final PiMatchFieldId HDR_HDR_ETHERNET_ETHER_TYPE = |
| 41 | PiMatchFieldId.of("hdr.ethernet.ether_type"); |
| 42 | public static final PiMatchFieldId HDR_HDR_ETHERNET_SRC_ADDR = |
| 43 | PiMatchFieldId.of("hdr.ethernet.src_addr"); |
| 44 | public static final PiMatchFieldId HDR_LOCAL_METADATA_L4_DST_PORT = |
| 45 | PiMatchFieldId.of("local_metadata.l4_dst_port"); |
| 46 | public static final PiMatchFieldId HDR_LOCAL_METADATA_L4_SRC_PORT = |
| 47 | PiMatchFieldId.of("local_metadata.l4_src_port"); |
| 48 | public static final PiMatchFieldId HDR_STANDARD_METADATA_INGRESS_PORT = |
| 49 | PiMatchFieldId.of("standard_metadata.ingress_port"); |
| 50 | public static final PiMatchFieldId HDR_HDR_IPV4_DST_ADDR = |
| 51 | PiMatchFieldId.of("hdr.ipv4.dst_addr"); |
| 52 | public static final PiMatchFieldId HDR_LOCAL_METADATA_NEXT_HOP_ID = |
| 53 | PiMatchFieldId.of("local_metadata.next_hop_id"); |
| 54 | public static final PiMatchFieldId HDR_HDR_ETHERNET_DST_ADDR = |
| 55 | PiMatchFieldId.of("hdr.ethernet.dst_addr"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 56 | // Table IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 57 | public static final PiTableId INGRESS_WCMP_CONTROL_WCMP_TABLE = |
| 58 | PiTableId.of("ingress.wcmp_control.wcmp_table"); |
| 59 | public static final PiTableId INGRESS_HOST_METER_CONTROL_HOST_METER_TABLE = |
| 60 | PiTableId.of("ingress.host_meter_control.host_meter_table"); |
| 61 | public static final PiTableId INGRESS_TABLE0_CONTROL_TABLE0 = |
| 62 | PiTableId.of("ingress.table0_control.table0"); |
| 63 | // Indirect Counter IDs |
| 64 | public static final PiCounterId EGRESS_PORT_COUNTERS_EGRESS_EGRESS_PORT_COUNTER = |
| 65 | PiCounterId.of("egress.port_counters_egress.egress_port_counter"); |
| 66 | public static final PiCounterId INGRESS_PORT_COUNTERS_INGRESS_INGRESS_PORT_COUNTER = |
| 67 | PiCounterId.of("ingress.port_counters_ingress.ingress_port_counter"); |
| 68 | // Direct Counter IDs |
| 69 | public static final PiCounterId INGRESS_WCMP_CONTROL_WCMP_TABLE_COUNTER = |
| 70 | PiCounterId.of("ingress.wcmp_control.wcmp_table_counter"); |
| 71 | public static final PiCounterId INGRESS_TABLE0_CONTROL_TABLE0_COUNTER = |
| 72 | PiCounterId.of("ingress.table0_control.table0_counter"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 73 | // Action IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 74 | public static final PiActionId INGRESS_TABLE0_CONTROL_SEND_TO_CPU = |
| 75 | PiActionId.of("ingress.table0_control.send_to_cpu"); |
| 76 | public static final PiActionId NO_ACTION = PiActionId.of("NoAction"); |
| 77 | public static final PiActionId INGRESS_WCMP_CONTROL_SET_EGRESS_PORT = |
| 78 | PiActionId.of("ingress.wcmp_control.set_egress_port"); |
| 79 | public static final PiActionId INGRESS_TABLE0_CONTROL_SET_NEXT_HOP_ID = |
| 80 | PiActionId.of("ingress.table0_control.set_next_hop_id"); |
| 81 | public static final PiActionId INGRESS_TABLE0_CONTROL_SET_EGRESS_PORT = |
| 82 | PiActionId.of("ingress.table0_control.set_egress_port"); |
| 83 | public static final PiActionId DROP = PiActionId.of("_drop"); |
| 84 | public static final PiActionId INGRESS_HOST_METER_CONTROL_READ_METER = |
| 85 | PiActionId.of("ingress.host_meter_control.read_meter"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 86 | // Action Param IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 87 | public static final PiActionParamId PORT = PiActionParamId.of("port"); |
| 88 | public static final PiActionParamId NEXT_HOP_ID = |
Carmelo Cascone | 81929aa | 2018-04-07 01:38:55 -0700 | [diff] [blame] | 89 | PiActionParamId.of("next_hop_id"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 90 | // Action Profile IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 91 | public static final PiActionProfileId INGRESS_WCMP_CONTROL_WCMP_SELECTOR = |
| 92 | PiActionProfileId.of("ingress.wcmp_control.wcmp_selector"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 93 | // Packet Metadata IDs |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 94 | public static final PiControlMetadataId PADDING = |
| 95 | PiControlMetadataId.of("_padding"); |
| 96 | public static final PiControlMetadataId INGRESS_PORT = |
Carmelo Cascone | 81929aa | 2018-04-07 01:38:55 -0700 | [diff] [blame] | 97 | PiControlMetadataId.of("ingress_port"); |
Carmelo Cascone | 776be38 | 2018-12-12 19:03:57 -0800 | [diff] [blame] | 98 | public static final PiControlMetadataId EGRESS_PORT = |
| 99 | PiControlMetadataId.of("egress_port"); |
Carmelo Cascone | ca94bcf | 2017-10-27 14:16:59 -0700 | [diff] [blame] | 100 | } |