Yi Tseng | be34205 | 2017-11-03 10:21:23 -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 | |
Carmelo Cascone | 356ab8b | 2019-09-25 01:02:53 -0700 | [diff] [blame] | 17 | package org.onosproject.pipelines.fabric.impl.behaviour; |
Yi Tseng | be34205 | 2017-11-03 10:21:23 -0700 | [diff] [blame] | 18 | |
| 19 | |
| 20 | import org.onosproject.net.pi.model.PiCounterId; |
| 21 | import org.onosproject.pipelines.basic.PortStatisticsDiscoveryImpl; |
Carmelo Cascone | 2102bfb | 2020-12-04 16:54:24 -0800 | [diff] [blame] | 22 | import org.onosproject.pipelines.fabric.FabricConstants; |
Yi Tseng | be34205 | 2017-11-03 10:21:23 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Implementation of the PortStatisticsBehaviour for fabric.p4. |
| 26 | */ |
| 27 | public class FabricPortStatisticsDiscovery extends PortStatisticsDiscoveryImpl { |
| 28 | |
| 29 | /** |
| 30 | * Returns the ID of the ingress port counter. |
| 31 | * |
| 32 | * @return counter ID |
| 33 | */ |
| 34 | @Override |
| 35 | public PiCounterId ingressCounterId() { |
Yi Tseng | 43ee7e8 | 2018-04-12 16:37:34 +0800 | [diff] [blame] | 36 | return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_INGRESS_PORT_COUNTER; |
Yi Tseng | be34205 | 2017-11-03 10:21:23 -0700 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns the ID of the egress port counter. |
| 41 | * |
| 42 | * @return counter ID |
| 43 | */ |
| 44 | @Override |
| 45 | public PiCounterId egressCounterId() { |
Yi Tseng | 43ee7e8 | 2018-04-12 16:37:34 +0800 | [diff] [blame] | 46 | return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_EGRESS_PORT_COUNTER; |
Yi Tseng | be34205 | 2017-11-03 10:21:23 -0700 | [diff] [blame] | 47 | } |
| 48 | } |