blob: ab44040069a54369950413b0e878dab8e945654e [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
17package org.onosproject.pipelines.fabric;
18
19
20import org.onosproject.net.pi.model.PiCounterId;
21import org.onosproject.pipelines.basic.PortStatisticsDiscoveryImpl;
22
23/**
24 * Implementation of the PortStatisticsBehaviour for fabric.p4.
25 */
26public class FabricPortStatisticsDiscovery extends PortStatisticsDiscoveryImpl {
27
28 /**
29 * Returns the ID of the ingress port counter.
30 *
31 * @return counter ID
32 */
33 @Override
34 public PiCounterId ingressCounterId() {
Yi Tseng43ee7e82018-04-12 16:37:34 +080035 return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_INGRESS_PORT_COUNTER;
Yi Tsengbe342052017-11-03 10:21:23 -070036 }
37
38 /**
39 * Returns the ID of the egress port counter.
40 *
41 * @return counter ID
42 */
43 @Override
44 public PiCounterId egressCounterId() {
Yi Tseng43ee7e82018-04-12 16:37:34 +080045 return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_EGRESS_PORT_COUNTER;
Yi Tsengbe342052017-11-03 10:21:23 -070046 }
47}