blob: 219e3707827d96fbed2c2386318ab23046beca6f [file] [log] [blame]
Yi Tsengbe342052017-11-03 10:21:23 -07001/*
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 Cascone356ab8b2019-09-25 01:02:53 -070017package org.onosproject.pipelines.fabric.impl.behaviour;
Yi Tsengbe342052017-11-03 10:21:23 -070018
19
20import org.onosproject.net.pi.model.PiCounterId;
21import org.onosproject.pipelines.basic.PortStatisticsDiscoveryImpl;
Carmelo Cascone2102bfb2020-12-04 16:54:24 -080022import org.onosproject.pipelines.fabric.FabricConstants;
Yi Tsengbe342052017-11-03 10:21:23 -070023
24/**
25 * Implementation of the PortStatisticsBehaviour for fabric.p4.
26 */
27public 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 Tseng43ee7e82018-04-12 16:37:34 +080036 return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_INGRESS_PORT_COUNTER;
Yi Tsengbe342052017-11-03 10:21:23 -070037 }
38
39 /**
40 * Returns the ID of the egress port counter.
41 *
42 * @return counter ID
43 */
44 @Override
45 public PiCounterId egressCounterId() {
Yi Tseng43ee7e82018-04-12 16:37:34 +080046 return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_EGRESS_PORT_COUNTER;
Yi Tsengbe342052017-11-03 10:21:23 -070047 }
48}