-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReactiveForwardMetrics.java
More file actions
57 lines (47 loc) · 1.46 KB
/
ReactiveForwardMetrics.java
File metadata and controls
57 lines (47 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package nctu.dosinhuda.test1;
/**
* Created by sdn on 5/29/17.
*/
import org.onlab.packet.MacAddress;
import static com.google.common.base.MoreObjects.toStringHelper;
/**
* Sample reactive forwarding application.
*/
public class ReactiveForwardMetrics {
private Long replyPacket = null;
private Long inPacket = null;
private Long droppedPacket = null;
private Long forwardedPacket = null;
private MacAddress macAddress;
ReactiveForwardMetrics(Long replyPacket, Long inPacket, Long droppedPacket,
Long forwardedPacket, MacAddress macAddress) {
this.replyPacket = replyPacket;
this.inPacket = inPacket;
this.droppedPacket = droppedPacket;
this.forwardedPacket = forwardedPacket;
this.macAddress = macAddress;
}
public void incremnetReplyPacket() {
replyPacket++;
}
public void incrementInPacket() {
inPacket++;
}
public void incrementDroppedPacket() {
droppedPacket++;
}
public void incrementForwardedPacket() {
forwardedPacket++;
}
public MacAddress getMacAddress() {
return macAddress;
}
@Override
public String toString() {
return toStringHelper(this)
.add("inpktCounter ", inPacket)
.add("replypktCounter ", replyPacket)
.add("forwardpktCounter ", forwardedPacket)
.add("droppktCounter ", droppedPacket).toString();
}
}