Browse Source

Merge branch 'merge_v1' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-hostage-v3 into merge_v1

Julien Clauter 9 years ago
parent
commit
92dc30741a

+ 13 - 1
src/de/tudarmstadt/informatik/hostage/logging/MessageRecord.java

@@ -133,7 +133,19 @@ public class MessageRecord implements Parcelable, Serializable{
 	public String getPacket() {
 		return packet;
 	}
-	/**
+
+    @Override
+    public String toString() {
+        return "MessageRecord{" +
+                "id=" + id +
+                ", attack_id=" + attack_id +
+                ", timestamp=" + timestamp +
+                ", type=" + type +
+                ", packet='" + packet + '\'' +
+                '}';
+    }
+
+    /**
 	 * @param packet the packet to set
 	 */
 	public void setPacket(String packet) {

+ 11 - 0
src/de/tudarmstadt/informatik/hostage/logging/NetworkRecord.java

@@ -156,4 +156,15 @@ public class NetworkRecord implements Parcelable, Serializable {
 				latitude, longitude, timestampLocation, -1, -1);
 	}
 
+    @Override
+    public String toString() {
+        return "NetworkRecord{" +
+                "bssid='" + bssid + '\'' +
+                ", ssid='" + ssid + '\'' +
+                ", timestampLocation=" + timestampLocation +
+                ", latitude=" + latitude +
+                ", longitude=" + longitude +
+                ", accuracy=" + accuracy +
+                '}';
+    }
 }

+ 20 - 0
src/de/tudarmstadt/informatik/hostage/logging/SyncRecord.java

@@ -327,5 +327,25 @@ public class SyncRecord implements Parcelable, Serializable {
     private long number_of_attacks;
     private long number_of_portscans;
 
+    @Override
+    public String toString() {
+        return "SyncRecord{" +
+                "attack_id=" + attack_id +
+                ", sync_id=" + sync_id +
+                ", bssid='" + bssid + '\'' +
+                ", device='" + device + '\'' +
+                ", protocol='" + protocol + '\'' +
+                ", localIP='" + localIP + '\'' +
+                ", localPort=" + localPort +
+                ", remoteIP='" + remoteIP + '\'' +
+                ", remotePort=" + remotePort +
+                ", externalIP='" + externalIP + '\'' +
+                ", wasInternalAttack=" + wasInternalAttack +
+                ", attackRecord=" + attackRecord +
+                ", messageRecords=" + messageRecords +
+                ", number_of_attacks=" + number_of_attacks +
+                ", number_of_portscans=" + number_of_portscans +
+                '}';
+    }
 }
 

+ 0 - 2
src/de/tudarmstadt/informatik/hostage/nio/Reader.java

@@ -20,10 +20,8 @@ public class Reader {
 	public Packet read() throws IOException {
 		ByteArrayOutputStream payload = new ByteArrayOutputStream();
         while(in.available() > 0){
-            System.out.println(in.available());
 			payload.write(in.read());
 		}
-        payload.write(0x00);
 		return new Packet(payload.toByteArray(), protocol);
 	}
 

+ 3 - 0
src/de/tudarmstadt/informatik/hostage/sync/bluetooth/CommunicationThread.java

@@ -114,6 +114,9 @@ public class CommunicationThread extends Thread {
                 SyncData thisSyncData = synchronizer.getSyncData(otherSyncInfo);
                 write(new SyncMessage(SyncMessage.SYNC_RESPONSE_DATA, thisSyncData));
 
+                System.out.println("----------------------- Sent: " + thisSyncData.syncRecords.toString());
+                System.out.println("----------------------- Sent: " + thisSyncData.networkRecords.toString());
+
 				break;
             case SyncMessage.SYNC_RESPONSE_DATA:
                 SyncData otherData = (SyncData) message.getPayload();