Skipping packets that do not have etherType, e.g. XID, EAPOL, etc.
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / Packet.java
1 package edu.uci.iotproject;
2
3 import java.util.Objects;
4
5 /**
6  * Represents a network packet.
7  *
8  * @author Janus Varmarken
9  */
10 public class Packet {
11
12     /**
13      * The packet's length.
14      */
15     private final int length;
16
17     // TODO should we use hostname for src/dst such that we can map packets pertaining to the same host as similar even if they are sent to different IPs (due to load balancing)?
18
19     /**
20      * The packet's source (IP).
21      */
22     private final String source;
23
24     /**
25      * The packet's destination (IP).
26      */
27     private final String destionation;
28
29     public Packet(String src, String dst, int length) {
30         this.source = Objects.requireNonNull(src);
31         this.destionation = Objects.requireNonNull(dst);
32         this.length = length;
33     }
34
35 }