blob: 984e7582863f81b513d1d8a714f0f198a665cb19 [file] [log] [blame]
kalagesa1a1867a2017-03-07 13:06:41 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
kalagesa1a1867a2017-03-07 13:06:41 +05303 *
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 */
16package org.onosproject.fwd;
17
18import org.onlab.packet.MacAddress;
19import static com.google.common.base.MoreObjects.toStringHelper;
20
21/**
22 * Sample reactive forwarding application.
23 */
24public class ReactiveForwardMetrics {
25 private Long replyPacket = null;
26 private Long inPacket = null;
27 private Long droppedPacket = null;
28 private Long forwardedPacket = null;
29 private MacAddress macAddress;
30
31 ReactiveForwardMetrics(Long replyPacket, Long inPacket, Long droppedPacket,
32 Long forwardedPacket, MacAddress macAddress) {
33 this.replyPacket = replyPacket;
34 this.inPacket = inPacket;
35 this.droppedPacket = droppedPacket;
36 this.forwardedPacket = forwardedPacket;
37 this.macAddress = macAddress;
38 }
39
40 public void incremnetReplyPacket() {
41 replyPacket++;
42
43 }
44
45 public void incrementInPacket() {
46 inPacket++;
47 }
48
49 public void incrementDroppedPacket() {
50 droppedPacket++;
51 }
52
53 public void incrementForwardedPacket() {
54 forwardedPacket++;
55 }
56
57 public MacAddress getMacAddress() {
58 return macAddress;
59 }
60
61 @Override
62 public String toString() {
63 return toStringHelper(this)
64 .add("inpktCounter ", inPacket)
65 .add("replypktCounter ", replyPacket)
66 .add("forwardpktCounter ", forwardedPacket)
67 .add("droppktCounter ", droppedPacket).toString();
68 }
69}