Merge branch 'master' of https://github.uci.edu/rtrimana/smart_home_traffic
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / Main.java
index 94d957d58f538931a26d21326e41e710c9d07640..239d8c18fdffb363f153c017d8703361056eca64 100644 (file)
@@ -1,14 +1,9 @@
 package edu.uci.iotproject;
 
 import org.pcap4j.core.*;
-import org.pcap4j.packet.*;
-import org.pcap4j.packet.DnsPacket;
-import org.pcap4j.packet.namednumber.DnsResourceRecordType;
 
 import java.io.EOFException;
-import java.net.Inet4Address;
 import java.net.UnknownHostException;
-import java.util.*;
 import java.util.concurrent.TimeoutException;
 
 /**
@@ -25,9 +20,8 @@ public class Main {
 
 
     public static void main(String[] args) throws PcapNativeException, NotOpenException, EOFException, TimeoutException, UnknownHostException {
-        //final String fileName = "/users/varmarken/Desktop/wlan1.local.dns.pcap";
-        final String fileName = "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/wlan1.local.remote.dns.pcap";
-        final String trainingFileName = "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/TP_LINK_LOCAL_OFF.pcap";
+        final String fileName = args.length > 0 ? args[0] : "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/wlan1.local.remote.dns.pcap";
+        final String trainingFileName = "./pcap/TP_LINK_LOCAL_OFF.pcap";
 
         // ====== Debug code ======
         PcapHandle handle;