Skipping packets that do not have etherType, e.g. XID, EAPOL, etc.
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / Main.java
1 package edu.uci.iotproject;
2
3 import java.util.List;
4 import java.util.Map;
5
6 /**
7  * Entry point of the application.
8  *
9  * @author Janus Varmarken
10  */
11 public class Main {
12
13     public static void main(String[] args) throws Exception {
14         System.out.println("it works");
15         //String file = "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/gre-sample.pcap";
16         String file = "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/wlan1.local.dns.pcap";
17         
18         try {
19             Pcap data = Pcap.fromFile(file);
20             data.hdr();
21         } catch (Exception e) {
22             e.printStackTrace();
23         }
24     }
25
26     private String cloudIPAddress(String hostName) {
27         if (hostName.equals("events.tplinkra.com"))
28             return "205.251.203.26";
29         else
30             return null;
31     }
32
33     // TODO move to separate class
34     // Add parameter that is the trace to be analyzed (most like the pcap library's representation of a flow)
35     public String findPattern(Map<String, List<Integer>> hostnameToPacketLengths, String smartPlugIp) {
36
37         // No difference, output "Complete match"
38         // If difference, output <Packet no, deviation from expected> for each packet
39         return null;
40     }
41 }