+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="en">
+<head>
+<!-- Generated by javadoc (1.8.0_191) on Thu Mar 28 11:26:59 PDT 2019 -->
+<title>PcapPacketUtils</title>
+<meta name="date" content="2019-03-28">
+<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
+<script type="text/javascript" src="../../../../script.js"></script>
+</head>
+<body>
+<script type="text/javascript"><!--
+ try {
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="PcapPacketUtils";
+ }
+ }
+ catch(err) {
+ }
+//-->
+var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9};
+var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
+var altColor = "altColor";
+var rowColor = "rowColor";
+var tableTab = "tableTab";
+var activeTableTab = "activeTableTab";
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar.top">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.top.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-files/index-1.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li>Prev Class</li>
+<li><a href="../../../../edu/uci/iotproject/util/PrintUtils.html" title="class in edu.uci.iotproject.util"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?edu/uci/iotproject/util/PcapPacketUtils.html" target="_top">Frames</a></li>
+<li><a href="PcapPacketUtils.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_top");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li><a href="#constructor.summary">Constr</a> | </li>
+<li><a href="#method.summary">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#constructor.detail">Constr</a> | </li>
+<li><a href="#method.detail">Method</a></li>
+</ul>
+</div>
+<a name="skip.navbar.top">
+<!-- -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+<!-- ======== START OF CLASS DATA ======== -->
+<div class="header">
+<div class="subTitle">edu.uci.iotproject.util</div>
+<h2 title="Class PcapPacketUtils" class="title">Class PcapPacketUtils</h2>
+</div>
+<div class="contentContainer">
+<ul class="inheritance">
+<li>java.lang.Object</li>
+<li>
+<ul class="inheritance">
+<li>edu.uci.iotproject.util.PcapPacketUtils</li>
+</ul>
+</li>
+</ul>
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<hr>
+<br>
+<pre>public final class <span class="typeNameLabel">PcapPacketUtils</span>
+extends java.lang.Object</pre>
+<div class="block">Utility methods for inspecting <code>PcapPacket</code> properties.</div>
+</li>
+</ul>
+</div>
+<div class="summary">
+<ul class="blockList">
+<li class="blockList">
+<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor.summary">
+<!-- -->
+</a>
+<h3>Constructor Summary</h3>
+<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
+<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
+<tr>
+<th class="colOne" scope="col">Constructor and Description</th>
+</tr>
+<tr class="altColor">
+<td class="colOne"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#PcapPacketUtils--">PcapPacketUtils</a></span>()</code> </td>
+</tr>
+</table>
+</li>
+</ul>
+<!-- ========== METHOD SUMMARY =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="method.summary">
+<!-- -->
+</a>
+<h3>Method Summary</h3>
+<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
+<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
+<tr>
+<th class="colFirst" scope="col">Modifier and Type</th>
+<th class="colLast" scope="col">Method and Description</th>
+</tr>
+<tr id="i0" class="altColor">
+<td class="colFirst"><code>static java.util.List<java.util.List<org.pcap4j.core.PcapPacket>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#clusterToListOfPcapPackets-org.apache.commons.math3.stat.clustering.Cluster-">clusterToListOfPcapPackets</a></span>(org.apache.commons.math3.stat.clustering.Cluster<<a href="../../../../edu/uci/iotproject/analysis/PcapPacketPair.html" title="class in edu.uci.iotproject.analysis">PcapPacketPair</a>> cluster)</code>
+<div class="block">Transform a <code>Cluster</code> of <code>PcapPacketPair</code> objects into a <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects.</div>
+</td>
+</tr>
+<tr id="i1" class="rowColor">
+<td class="colFirst"><code>static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#concatSequences-java.util.List-java.util.List-">concatSequences</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ java.util.List<<a href="../../../../edu/uci/iotproject/trafficreassembly/layer3/Conversation.html" title="class in edu.uci.iotproject.trafficreassembly.layer3">Conversation</a>> conversations)</code>
+<div class="block">Concatenate sequences in <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+</td>
+</tr>
+<tr id="i2" class="altColor">
+<td class="colFirst"><code>static java.util.List<java.util.List<org.pcap4j.core.PcapPacket>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#extractRangeCorePoints-java.util.List-double-int-">extractRangeCorePoints</a></span>(java.util.List<java.util.List<org.pcap4j.core.PcapPacket>> pairs,
+ double eps,
+ int minPts)</code>
+<div class="block">Extract core point range in the form of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+</td>
+</tr>
+<tr id="i3" class="rowColor">
+<td class="colFirst"><code>static java.lang.String</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getDestinationIp-org.pcap4j.core.PcapPacket-">getDestinationIp</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the destination IP (in decimal format) of an IPv4 packet.</div>
+</td>
+</tr>
+<tr id="i4" class="altColor">
+<td class="colFirst"><code>static int</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getDestinationPort-org.pcap4j.core.PcapPacket-">getDestinationPort</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the destination port of a TCP packet.</div>
+</td>
+</tr>
+<tr id="i5" class="rowColor">
+<td class="colFirst"><code>static org.pcap4j.util.MacAddress</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getEthDstAddr-org.pcap4j.core.PcapPacket-">getEthDstAddr</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the destination address of the Ethernet part of <code>packet</code>.</div>
+</td>
+</tr>
+<tr id="i6" class="altColor">
+<td class="colFirst"><code>static org.pcap4j.util.MacAddress</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getEthSrcAddr-org.pcap4j.core.PcapPacket-">getEthSrcAddr</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the source address of the Ethernet part of <code>packet</code>.</div>
+</td>
+</tr>
+<tr id="i7" class="rowColor">
+<td class="colFirst"><code>static java.lang.String</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getSourceIp-org.pcap4j.core.PcapPacket-">getSourceIp</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the source IP (in decimal format) of an IPv4 packet.</div>
+</td>
+</tr>
+<tr id="i8" class="altColor">
+<td class="colFirst"><code>static int</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#getSourcePort-org.pcap4j.core.PcapPacket-">getSourcePort</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Gets the source port of a TCP packet.</div>
+</td>
+</tr>
+<tr id="i9" class="rowColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isAck-org.pcap4j.core.PcapPacket-">isAck</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Checks if <code>packet</code> wraps a TCP packet th at has the ACK flag set.</div>
+</td>
+</tr>
+<tr id="i10" class="altColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isConservativeChecking-java.util.List-java.util.List-double-">isConservativeChecking</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> otherSignature,
+ double eps)</code>
+<div class="block">Check if there is any overlap between the signature stored in this class and another signature.</div>
+</td>
+</tr>
+<tr id="i11" class="rowColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isDestination-org.pcap4j.core.PcapPacket-java.lang.String-int-">isDestination</a></span>(org.pcap4j.core.PcapPacket packet,
+ java.lang.String ip,
+ int port)</code>
+<div class="block">Helper method to determine if the given combination of IP and port matches the destination of the given packet.</div>
+</td>
+</tr>
+<tr id="i12" class="altColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isDstIpLocal-org.pcap4j.core.PcapPacket-">isDstIpLocal</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Checks if the destination IP address of the <code>IpV4Packet</code> contained in <code>packet</code> is a local address,
+ i.e., if it pertains to subnet 10.0.0.0/8, 172.16.0.0/16, or 192.168.0.0/16.</div>
+</td>
+</tr>
+<tr id="i13" class="rowColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isRangeBasedMatching-java.util.List-double-java.util.List...-">isRangeBasedMatching</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ double eps,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>>... otherSignatures)</code>
+<div class="block">Test the conservativeness of the signatures (basically whether we want strict or range-based matching).</div>
+</td>
+</tr>
+<tr id="i14" class="altColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isSource-org.pcap4j.core.PcapPacket-java.lang.String-int-">isSource</a></span>(org.pcap4j.core.PcapPacket packet,
+ java.lang.String ip,
+ int port)</code>
+<div class="block">Helper method to determine if the given combination of IP and port matches the source of the given packet.</div>
+</td>
+</tr>
+<tr id="i15" class="rowColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isSrcIpLocal-org.pcap4j.core.PcapPacket-">isSrcIpLocal</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Checks if the source IP address of the <code>IpV4Packet</code> contained in <code>packet</code> is a local address, i.e.,
+ if it pertains to subnet 10.0.0.0/8, 172.16.0.0/16, or 192.168.0.0/16.</div>
+</td>
+</tr>
+<tr id="i16" class="altColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isSyn-org.pcap4j.core.PcapPacket-">isSyn</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Checks if <code>packet</code> wraps a TCP packet that has the SYN flag set.</div>
+</td>
+</tr>
+<tr id="i17" class="rowColor">
+<td class="colFirst"><code>static boolean</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#isTcp-org.pcap4j.core.PcapPacket-">isTcp</a></span>(org.pcap4j.core.PcapPacket packet)</code>
+<div class="block">Determines if a given <code>PcapPacket</code> wraps a <code>TcpPacket</code>.</div>
+</td>
+</tr>
+<tr id="i18" class="altColor">
+<td class="colFirst"><code>static void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#printSignatures-java.util.List-java.io.PrintWriter-boolean-">printSignatures</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ java.io.PrintWriter resultsWriter,
+ boolean printToOutput)</code>
+<div class="block">Print signatures in <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+</td>
+</tr>
+<tr id="i19" class="rowColor">
+<td class="colFirst"><code>static void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#removeSequenceFromSignature-java.util.List-int-">removeSequenceFromSignature</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ int sequenceIndex)</code>
+<div class="block">Remove a sequence in a signature object.</div>
+</td>
+</tr>
+<tr id="i20" class="altColor">
+<td class="colFirst"><code>static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#sortSequences-java.util.List-">sortSequences</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures)</code>
+<div class="block">Sort the sequences in the <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+</td>
+</tr>
+<tr id="i21" class="rowColor">
+<td class="colFirst"><code>static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/uci/iotproject/util/PcapPacketUtils.html#useRangeBasedMatching-java.util.List-java.util.List-">useRangeBasedMatching</a></span>(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> corePointRange)</code>
+<div class="block">Test the conservativeness of the signatures (basically whether we want strict or range-based matching).</div>
+</td>
+</tr>
+</table>
+<ul class="blockList">
+<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
+<!-- -->
+</a>
+<h3>Methods inherited from class java.lang.Object</h3>
+<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="details">
+<ul class="blockList">
+<li class="blockList">
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor.detail">
+<!-- -->
+</a>
+<h3>Constructor Detail</h3>
+<a name="PcapPacketUtils--">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>PcapPacketUtils</h4>
+<pre>public PcapPacketUtils()</pre>
+</li>
+</ul>
+</li>
+</ul>
+<!-- ============ METHOD DETAIL ========== -->
+<ul class="blockList">
+<li class="blockList"><a name="method.detail">
+<!-- -->
+</a>
+<h3>Method Detail</h3>
+<a name="getEthSrcAddr-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getEthSrcAddr</h4>
+<pre>public static org.pcap4j.util.MacAddress getEthSrcAddr(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the source address of the Ethernet part of <code>packet</code>.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the Ethernet source address is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The source address of the Ethernet part of <code>packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="getEthDstAddr-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getEthDstAddr</h4>
+<pre>public static org.pcap4j.util.MacAddress getEthDstAddr(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the destination address of the Ethernet part of <code>packet</code>.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the Ethernet destination address is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The destination address of the Ethernet part of <code>packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isTcp-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isTcp</h4>
+<pre>public static boolean isTcp(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Determines if a given <code>PcapPacket</code> wraps a <code>TcpPacket</code>.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The <code>PcapPacket</code> to inspect.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> if <code>packet</code> wraps a <code>TcpPacket</code>, <code>false</code> otherwise.</dd>
+</dl>
+</li>
+</ul>
+<a name="getSourceIp-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getSourceIp</h4>
+<pre>public static java.lang.String getSourceIp(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the source IP (in decimal format) of an IPv4 packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the IPv4 source address is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The decimal representation of the source IP of <code>packet</code> <em>iff</em> <code>packet</code> wraps an
+ <code>IpV4Packet</code>.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.NullPointerException</code> - if <code>packet</code> does not encapsulate an <code>IpV4Packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="getDestinationIp-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getDestinationIp</h4>
+<pre>public static java.lang.String getDestinationIp(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the destination IP (in decimal format) of an IPv4 packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the IPv4 source address is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The decimal representation of the destination IP of <code>packet</code> <em>iff</em> <code>packet</code> wraps an
+ <code>IpV4Packet</code>.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.NullPointerException</code> - if <code>packet</code> does not encapsulate an <code>IpV4Packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="getSourcePort-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getSourcePort</h4>
+<pre>public static int getSourcePort(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the source port of a TCP packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the source port is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The source port of the <code>TcpPacket</code> encapsulated by <code>packet</code>.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.IllegalArgumentException</code> - if <code>packet</code> does not encapsulate a <code>TcpPacket</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="getDestinationPort-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>getDestinationPort</h4>
+<pre>public static int getDestinationPort(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Gets the destination port of a TCP packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the destination port is to be extracted.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>The destination port of the <code>TcpPacket</code> encapsulated by <code>packet</code>.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.IllegalArgumentException</code> - if <code>packet</code> does not encapsulate a <code>TcpPacket</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isSource-org.pcap4j.core.PcapPacket-java.lang.String-int-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isSource</h4>
+<pre>public static boolean isSource(org.pcap4j.core.PcapPacket packet,
+ java.lang.String ip,
+ int port)</pre>
+<div class="block">Helper method to determine if the given combination of IP and port matches the source of the given packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet to check.</dd>
+<dd><code>ip</code> - The IP to look for in the ip.src field of <code>packet</code>.</dd>
+<dd><code>port</code> - The port to look for in the tcp.port field of <code>packet</code>.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> if the given ip+port match the corresponding fields in <code>packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isDestination-org.pcap4j.core.PcapPacket-java.lang.String-int-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isDestination</h4>
+<pre>public static boolean isDestination(org.pcap4j.core.PcapPacket packet,
+ java.lang.String ip,
+ int port)</pre>
+<div class="block">Helper method to determine if the given combination of IP and port matches the destination of the given packet.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet to check.</dd>
+<dd><code>ip</code> - The IP to look for in the ip.dst field of <code>packet</code>.</dd>
+<dd><code>port</code> - The port to look for in the tcp.dstport field of <code>packet</code>.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> if the given ip+port match the corresponding fields in <code>packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isSrcIpLocal-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isSrcIpLocal</h4>
+<pre>public static boolean isSrcIpLocal(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Checks if the source IP address of the <code>IpV4Packet</code> contained in <code>packet</code> is a local address, i.e.,
+ if it pertains to subnet 10.0.0.0/8, 172.16.0.0/16, or 192.168.0.0/16.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the source IP address is to be examined.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> if <code>packet</code> wraps a <code>IpV4Packet</code> for which the source IP address is a local IP
+ address, <code>false</code> otherwise.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.NullPointerException</code> - if <code>packet</code> does not encapsulate an <code>IpV4Packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isDstIpLocal-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isDstIpLocal</h4>
+<pre>public static boolean isDstIpLocal(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Checks if the destination IP address of the <code>IpV4Packet</code> contained in <code>packet</code> is a local address,
+ i.e., if it pertains to subnet 10.0.0.0/8, 172.16.0.0/16, or 192.168.0.0/16.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - The packet for which the destination IP address is to be examined.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> if <code>packet</code> wraps a <code>IpV4Packet</code> for which the destination IP address is a local
+ IP address, <code>false</code> otherwise.</dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.NullPointerException</code> - if <code>packet</code> does not encapsulate an <code>IpV4Packet</code>.</dd>
+</dl>
+</li>
+</ul>
+<a name="isSyn-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isSyn</h4>
+<pre>public static boolean isSyn(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Checks if <code>packet</code> wraps a TCP packet that has the SYN flag set.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - A <code>PcapPacket</code> that is suspected to contain a <code>TcpPacket</code> for which the SYN flag is set.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> <em>iff</em> <code>packet</code> contains a <code>TcpPacket</code> for which the SYN flag is set,
+ <code>false</code> otherwise.</dd>
+</dl>
+</li>
+</ul>
+<a name="isAck-org.pcap4j.core.PcapPacket-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isAck</h4>
+<pre>public static boolean isAck(org.pcap4j.core.PcapPacket packet)</pre>
+<div class="block">Checks if <code>packet</code> wraps a TCP packet th at has the ACK flag set.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>packet</code> - A <code>PcapPacket</code> that is suspected to contain a <code>TcpPacket</code> for which the ACK flag is set.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd><code>true</code> <em>iff</em> <code>packet</code> contains a <code>TcpPacket</code> for which the ACK flag is set,
+ <code>false</code> otherwise.</dd>
+</dl>
+</li>
+</ul>
+<a name="clusterToListOfPcapPackets-org.apache.commons.math3.stat.clustering.Cluster-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>clusterToListOfPcapPackets</h4>
+<pre>public static java.util.List<java.util.List<org.pcap4j.core.PcapPacket>> clusterToListOfPcapPackets(org.apache.commons.math3.stat.clustering.Cluster<<a href="../../../../edu/uci/iotproject/analysis/PcapPacketPair.html" title="class in edu.uci.iotproject.analysis">PcapPacketPair</a>> cluster)</pre>
+<div class="block">Transform a <code>Cluster</code> of <code>PcapPacketPair</code> objects into a <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>cluster</code> - A <code>Cluster</code> of <a href="../../../../edu/uci/iotproject/analysis/PcapPacketPair.html" title="class in edu.uci.iotproject.analysis"><code>PcapPacketPair</code></a> objects that needs to be transformed.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects as the result of the transformation.</dd>
+</dl>
+</li>
+</ul>
+<a name="concatSequences-java.util.List-java.util.List-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>concatSequences</h4>
+<pre>public static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> concatSequences(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ java.util.List<<a href="../../../../edu/uci/iotproject/trafficreassembly/layer3/Conversation.html" title="class in edu.uci.iotproject.trafficreassembly.layer3">Conversation</a>> conversations)</pre>
+<div class="block">Concatenate sequences in <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.
+ We cross-check these with <code>List</code> of <code>Conversation</code> objects to see
+ if two <code>List</code> of <code>PcapPacket</code> objects actually belong to the same <code>Conversation</code>.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signatures</code> - A <code>List</code> of <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects that needs to be checked and concatenated.</dd>
+<dd><code>conversations</code> - A <code>List</code> of <a href="../../../../edu/uci/iotproject/trafficreassembly/layer3/Conversation.html" title="class in edu.uci.iotproject.trafficreassembly.layer3"><code>Conversation</code></a> objects as reference for concatenation.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A <code>List</code> of <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects as the result of the concatenation.</dd>
+</dl>
+</li>
+</ul>
+<a name="sortSequences-java.util.List-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>sortSequences</h4>
+<pre>public static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> sortSequences(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures)</pre>
+<div class="block">Sort the sequences in the <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.
+ The purpose of this is to sort the order of sequences in the sequence list. For detection purposes, we need
+ to know if one sequence occurs earlier/later in time with respect to the other sequences for more confidence
+ in detecting the occurrence of an event.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signatures</code> - A <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects that needs sorting.
+ We assume that innermost <code>List</code> of <code>PcapPacket</code> objects have been sorted ascending
+ by timestamps. By the time we use this method, we should have sorted it when calling the
+ <code>clusterToListOfPcapPackets</code> method.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A sorted <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</dd>
+</dl>
+</li>
+</ul>
+<a name="printSignatures-java.util.List-java.io.PrintWriter-boolean-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>printSignatures</h4>
+<pre>public static void printSignatures(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ java.io.PrintWriter resultsWriter,
+ boolean printToOutput)</pre>
+<div class="block">Print signatures in <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signatures</code> - A <code>List</code> of <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects that needs to be printed.</dd>
+<dd><code>resultsWriter</code> - PrintWriter object to write into log file.</dd>
+<dd><code>printToOutput</code> - Boolean to decide whether to print out to screen or just log file.</dd>
+</dl>
+</li>
+</ul>
+<a name="extractRangeCorePoints-java.util.List-double-int-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>extractRangeCorePoints</h4>
+<pre>public static java.util.List<java.util.List<org.pcap4j.core.PcapPacket>> extractRangeCorePoints(java.util.List<java.util.List<org.pcap4j.core.PcapPacket>> pairs,
+ double eps,
+ int minPts)</pre>
+<div class="block">Extract core point range in the form of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>pairs</code> - The pairs for core points extraction.</dd>
+<dd><code>eps</code> - Epsilon value for the DBSCAN algorithm.</dd>
+<dd><code>minPts</code> - minPts value for the DBSCAN algorithm.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects that contains core points range
+ in the first and second element.</dd>
+</dl>
+</li>
+</ul>
+<a name="isRangeBasedMatching-java.util.List-double-java.util.List...-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isRangeBasedMatching</h4>
+<pre>public static boolean isRangeBasedMatching(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ double eps,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>>... otherSignatures)</pre>
+<div class="block">Test the conservativeness of the signatures (basically whether we want strict or range-based matching).
+ We go for a conservative approach (strict matching) when there is no range or there are ranges but the
+ ranges overlap across multiple signatures, e.g., ON and OFF signatures.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signature</code> - The signature we want to check and overwrite if needed.</dd>
+<dd><code>eps</code> - Epsilon value for the DBSCAN algorithm.</dd>
+<dd><code>otherSignatures</code> - Other signatures we want to check against this signature.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A boolean that is True when range-based matching is used.</dd>
+</dl>
+</li>
+</ul>
+<a name="useRangeBasedMatching-java.util.List-java.util.List-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>useRangeBasedMatching</h4>
+<pre>public static java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> useRangeBasedMatching(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> corePointRange)</pre>
+<div class="block">Test the conservativeness of the signatures (basically whether we want strict or range-based matching).
+ We go for a conservative approach (strict matching) when there is no range or there are ranges but the
+ ranges overlap across multiple signatures, e.g., ON and OFF signatures.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signature</code> - The signature we want to check and overwrite if needed.</dd>
+<dd><code>corePointRange</code> - The core points range of this signature.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A boolean that is True when range-based matching is used.</dd>
+</dl>
+</li>
+</ul>
+<a name="isConservativeChecking-java.util.List-java.util.List-double-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>isConservativeChecking</h4>
+<pre>public static boolean isConservativeChecking(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signature,
+ java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> otherSignature,
+ double eps)</pre>
+<div class="block">Check if there is any overlap between the signature stored in this class and another signature.
+ Conditions:
+ 1) If both signatures do not have any range, then we need to do conservative checking (return true).
+ 2) If both signatures have the same number of packets/packet lengths, then we check the range; if the
+ numbers of packets/packet lengths are different then we assume that there is no overlap.
+ 3) If there is any range in the signatures, then we need to check for overlap.
+ 4) If there is overlap for EVERY packet/packet length, then we return true (conservative checking);
+ otherwise false (range-based checking).</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signature</code> - A <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects to be checked
+ for overlaps with the other signature.</dd>
+<dd><code>otherSignature</code> - A <code>List</code> of <code>List</code> of <code>List</code> of <code>PcapPacket</code> objects to be checked
+ for overlaps with the signature.</dd>
+<dd><code>eps</code> - Epsilon value for the DBSCAN algorithm.</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>A boolean that is true if there is an overlap; false otherwise.</dd>
+</dl>
+</li>
+</ul>
+<a name="removeSequenceFromSignature-java.util.List-int-">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>removeSequenceFromSignature</h4>
+<pre>public static void removeSequenceFromSignature(java.util.List<java.util.List<java.util.List<org.pcap4j.core.PcapPacket>>> signatures,
+ int sequenceIndex)</pre>
+<div class="block">Remove a sequence in a signature object.</div>
+<dl>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>signatures</code> - A <code>List</code> of <code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects.</dd>
+<dd><code>sequenceIndex</code> - An index for a sequence that consists of {<code>List</code> of <code>List</code> of
+ <code>PcapPacket</code> objects.</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<!-- ========= END OF CLASS DATA ========= -->
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar.bottom">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.bottom.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-files/index-1.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li>Prev Class</li>
+<li><a href="../../../../edu/uci/iotproject/util/PrintUtils.html" title="class in edu.uci.iotproject.util"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?edu/uci/iotproject/util/PcapPacketUtils.html" target="_top">Frames</a></li>
+<li><a href="PcapPacketUtils.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_bottom");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li><a href="#constructor.summary">Constr</a> | </li>
+<li><a href="#method.summary">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#constructor.detail">Constr</a> | </li>
+<li><a href="#method.detail">Method</a></li>
+</ul>
+</div>
+<a name="skip.navbar.bottom">
+<!-- -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+</body>
+</html>