|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+//Main Class
|
|
1
|
2
|
package com.mycompany.app;
|
|
2
|
3
|
|
|
3
|
4
|
import java.io.BufferedReader;
|
|
|
@@ -120,7 +121,7 @@ public class App {
|
|
120
|
121
|
}
|
|
121
|
122
|
|
|
122
|
123
|
}
|
|
123
|
|
-
|
|
|
124
|
+ // Find Node
|
|
124
|
125
|
public static Node findNode(Vector<Node> nodeVector, Object obj){
|
|
125
|
126
|
for(int i = 0; i < nodeVector.size(); i++){
|
|
126
|
127
|
if(nodeVector.elementAt(i).ip.equals((String)obj)){
|
|
|
@@ -130,14 +131,14 @@ public class App {
|
|
130
|
131
|
}
|
|
131
|
132
|
return null;
|
|
132
|
133
|
}
|
|
133
|
|
-
|
|
|
134
|
+ // Insert packet value in Node Class
|
|
134
|
135
|
public static void insertNodeValue(Eips S, Nips D, Packet pkt){
|
|
135
|
136
|
S.setSourceIp(pkt.eip);
|
|
136
|
137
|
S.setSourcePort(pkt.eport);
|
|
137
|
138
|
D.setDestIp(pkt.nip);
|
|
138
|
139
|
D.setDestPort(pkt.nport);
|
|
139
|
140
|
}
|
|
140
|
|
-
|
|
|
141
|
+ // Insert source & destination ip/port number in Node Class
|
|
141
|
142
|
public static void insertAddress(Eips S, Nips D, Node N){
|
|
142
|
143
|
N.source.addElement(S);
|
|
143
|
144
|
N.destination.addElement(D);
|