1 package edu.uci.iotproject;
3 import org.pcap4j.core.*;
5 import java.io.EOFException;
6 import java.net.UnknownHostException;
7 import java.util.concurrent.TimeoutException;
10 * This is a system that reads PCAP files to compare
11 * patterns of DNS hostnames, packet sequences, and packet
12 * lengths with training data to determine certain events
13 * or actions for smart home devices.
15 * @author Janus Varmarken
16 * @author Rahmadi Trimananda (rtrimana@uci.edu)
22 public static void main(String[] args) throws PcapNativeException, NotOpenException, EOFException, TimeoutException, UnknownHostException {
23 String fileName = args.length > 0 ? args[0] : "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/wlan1.local.remote.dns.pcap";
25 // ====== Debug code ======
28 handle = Pcaps.openOffline(fileName, PcapHandle.TimestampPrecision.NANO);
29 } catch (PcapNativeException pne) {
30 handle = Pcaps.openOffline(fileName);
32 FlowPatternFinder fpf = new FlowPatternFinder(handle, FlowPattern.TP_LINK_LOCAL_ON);
35 // ========================