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 final String fileName = "/users/varmarken/Desktop/wlan1.local.dns.pcap";
24 // final String fileName = "/home/rtrimana/pcap_processing/smart_home_traffic/Code/Projects/SmartPlugDetector/pcap/wlan1.local.remote.dns.pcap";
26 // ====== Debug code ======
29 handle = Pcaps.openOffline(fileName, PcapHandle.TimestampPrecision.NANO);
30 } catch (PcapNativeException pne) {
31 handle = Pcaps.openOffline(fileName);
33 FlowPatternFinder fpf = new FlowPatternFinder(handle, FlowPattern.TP_LINK_LOCAL_ON);
36 // ========================