|
|
@@ -105,8 +105,22 @@ public class App {
|
|
105
|
105
|
} catch( IOException e) {
|
|
106
|
106
|
e.printStackTrace();
|
|
107
|
107
|
}
|
|
108
|
|
-
|
|
|
108
|
+
|
|
|
109
|
+ // Print
|
|
|
110
|
+ for(int i = 0 ; i < networkNode.size(); i++){
|
|
|
111
|
+ System.out.println("<Node"+(i+1)+"> " + networkNode.elementAt(i).ip);
|
|
|
112
|
+ System.out.println("Total packet = " + networkNode.elementAt(i).getTotal_pkt());
|
|
|
113
|
+ System.out.println("Total byte = " + networkNode.elementAt(i).getTotal_bytes());
|
|
|
114
|
+ System.out.println("<Destination packet>");
|
|
|
115
|
+ for(int j=0; j< networkNode.elementAt(i).destination.size();j++){
|
|
|
116
|
+ System.out.println("("+ networkNode.elementAt(i).destination.elementAt(j).ip+","+networkNode.elementAt(i).destination.elementAt(j).port+")");
|
|
|
117
|
+ }
|
|
|
118
|
+ System.out.println("<Source port count>");
|
|
|
119
|
+ System.out.println(networkNode.elementAt(i).source.size());
|
|
|
120
|
+ }
|
|
|
121
|
+
|
|
109
|
122
|
}
|
|
|
123
|
+
|
|
110
|
124
|
public static Node findNode(Vector<Node> nodeVector, Object obj){
|
|
111
|
125
|
for(int i = 0; i < nodeVector.size(); i++){
|
|
112
|
126
|
if(nodeVector.elementAt(i).ip.equals((String)obj)){
|
|
|
@@ -116,12 +130,14 @@ public class App {
|
|
116
|
130
|
}
|
|
117
|
131
|
return null;
|
|
118
|
132
|
}
|
|
|
133
|
+
|
|
119
|
134
|
public static void insertNodeValue(Eips S, Nips D, Packet pkt){
|
|
120
|
135
|
S.setSourceIp(pkt.eip);
|
|
121
|
136
|
S.setSourcePort(pkt.eport);
|
|
122
|
137
|
D.setDestIp(pkt.nip);
|
|
123
|
138
|
D.setDestPort(pkt.nport);
|
|
124
|
139
|
}
|
|
|
140
|
+
|
|
125
|
141
|
public static void insertAddress(Eips S, Nips D, Node N){
|
|
126
|
142
|
N.source.addElement(S);
|
|
127
|
143
|
N.destination.addElement(D);
|