Prechádzať zdrojové kódy

- Code documentation improvements
- Fixes returning a list by the IP address validator if only a single IP address was given

Patrick Jattke 8 rokov pred
rodič
commit
5043fd37a3

+ 1 - 1
README.md

@@ -196,7 +196,7 @@ last(...)    -> returns the last element from a list
 Attention: Named queries are designed to be combined with extractors, like ``random(all(ipAddress))``. But it is currently NOT possible to encapsulate multiple named queries, like `` macAddress(ipAddress=most_used(ipAddress))``. This can be circumvented by first querying ``most_used(ipAddress)`` and then inserting the result as argument in ``macAddress(…)``. 
 
 ## Versioning
-The [SemVer](http://semver.org/spec/v2.0.0.html) is used for versioning. For currently available versions of ID2T, see page [releases](https://git.tk.informatik.tu-darmstadt.de/emmanouil.vasilomano/ID2T-toolkit/releases).
+The [SemVer](http://semver.org/spec/v2.0.0.html) is used for versioning. For currently available versions of ID2T, see page [releases](https://git.tk.informatik.tu-darmstadt.de/SPIN/ID2T-toolkit/releases).
 
 ## Release History
 

+ 97 - 67
code/.idea/workspace.xml

@@ -5,7 +5,10 @@
     <option name="SCOPE_TYPE" value="2" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="ef10d9c8-0970-4ec8-90a9-81487fbad634" name="Default" comment="- Added comments to all classes and methods&#10;- Small code improvements" />
+    <list default="true" id="ef10d9c8-0970-4ec8-90a9-81487fbad634" name="Default" comment="- Added comments to all classes and methods&#10;- Small code improvements">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Attack/BaseAttack.py" afterPath="$PROJECT_DIR$/Attack/BaseAttack.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/CLI.py" afterPath="$PROJECT_DIR$/CLI.py" />
+    </list>
     <ignored path="code.iws" />
     <ignored path=".idea/workspace.xml" />
     <ignored path=".idea/dataSources.local.xml" />
@@ -20,7 +23,7 @@
     <SUITE FILE_PATH="coverage/code$pcapreader.coverage" NAME="pcapreader Coverage Results" MODIFIED="1470047802654" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/ID2TLib" />
     <SUITE FILE_PATH="coverage/code$Hasher.coverage" NAME="Hasher Coverage Results" MODIFIED="1475518961954" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/ID2TLib" />
     <SUITE FILE_PATH="coverage/code$ID2TLib.coverage" NAME="ID2TLib Coverage Results" MODIFIED="1467046039643" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/CLI" />
-    <SUITE FILE_PATH="coverage/code$CLI.coverage" NAME="CLI Coverage Results" MODIFIED="1476426510270" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+    <SUITE FILE_PATH="coverage/code$CLI.coverage" NAME="CLI Coverage Results" MODIFIED="1478076965558" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/code$PortscanAttack.coverage" NAME="PortscanAttack Coverage Results" MODIFIED="1470135189879" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Attack" />
     <SUITE FILE_PATH="coverage/code$FileHasher.coverage" NAME="FileHasher Coverage Results" MODIFIED="1470929280513" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/ID2TLib" />
     <SUITE FILE_PATH="coverage/code$BaseAttack.coverage" NAME="BaseAttack Coverage Results" MODIFIED="1470221704615" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Attack" />
@@ -45,7 +48,7 @@
     <favorites_list name="code" />
   </component>
   <component name="FileEditorManager">
-    <leaf />
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
   </component>
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
@@ -81,17 +84,17 @@
         <option value="$PROJECT_DIR$/ID2TLib/FileHasher.py" />
         <option value="$PROJECT_DIR$/Attack/__init__.py" />
         <option value="$PROJECT_DIR$/ID2TLib/Hasher.py" />
-        <option value="$PROJECT_DIR$/ID2TLib/AttackController.py" />
-        <option value="$PROJECT_DIR$/Attack/BaseAttack.py" />
-        <option value="$PROJECT_DIR$/Attack/PortscanAttack.py" />
         <option value="$PROJECT_DIR$/ID2TLib/Label.py" />
-        <option value="$PROJECT_DIR$/ID2TLib/LabelManager.py" />
         <option value="$PROJECT_DIR$/ID2TLib/PcapFile.py" />
-        <option value="$PROJECT_DIR$/ID2TLib/Controller.py" />
-        <option value="$PROJECT_DIR$/ID2TLib/Statistics.py" />
         <option value="$PROJECT_DIR$/ID2TLib/StatsDatabase.py" />
         <option value="$PROJECT_DIR$/Attack/AttackParameters.py" />
+        <option value="$PROJECT_DIR$/ID2TLib/AttackController.py" />
+        <option value="$PROJECT_DIR$/ID2TLib/LabelManager.py" />
+        <option value="$PROJECT_DIR$/ID2TLib/Controller.py" />
+        <option value="$PROJECT_DIR$/ID2TLib/Statistics.py" />
+        <option value="$PROJECT_DIR$/Attack/PortscanAttack.py" />
         <option value="$PROJECT_DIR$/CLI.py" />
+        <option value="$PROJECT_DIR$/Attack/BaseAttack.py" />
       </list>
     </option>
   </component>
@@ -157,6 +160,7 @@
     </navigator>
     <panes>
       <pane id="Scope" />
+      <pane id="Scratches" />
       <pane id="ProjectPane">
         <subPane>
           <PATH>
@@ -189,6 +193,20 @@
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
             </PATH_ELEMENT>
           </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="code" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="code" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="GUI" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
           <PATH>
             <PATH_ELEMENT>
               <option name="myItemId" value="code" />
@@ -205,12 +223,11 @@
           </PATH>
         </subPane>
       </pane>
-      <pane id="Scratches" />
     </panes>
   </component>
   <component name="PropertiesComponent">
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyIntegratedToolsModulesConfigurable" />
+    <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
     <property name="settings.editor.splitter.proportion" value="0.2" />
     <property name="com.intellij.database.dataSource.DataSourceTemplate" value="Sqlite (Xerial)" />
     <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth0" value="196" />
@@ -742,25 +759,25 @@
     <frame x="-1" y="0" width="1678" height="882" extended-state="6" />
     <editor active="false" />
     <layout>
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23128834" sideWeight="0.69342107" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24969324" sideWeight="0.6486842" order="2" side_tool="false" content_ui="combo" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32964602" sideWeight="0.497552" order="9" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16500553" sideWeight="0.504896" order="0" side_tool="true" content_ui="tabs" />
       <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32986537" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3276316" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16389811" sideWeight="0.49510404" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23128834" sideWeight="0.30657893" order="0" side_tool="true" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2118421" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" x="36" y="536" width="1640" height="280" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24969324" sideWeight="0.3513158" order="0" side_tool="true" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.29078948" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39933628" sideWeight="0.497552" order="6" side_tool="false" content_ui="tabs" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2118421" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" x="36" y="536" width="1640" height="280" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Inspection Results" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32890365" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32336655" sideWeight="0.49510404" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3223684" sideWeight="0.49510404" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2912514" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
     </layout>
   </component>
   <component name="Vcs.Log.UiProperties">
@@ -809,6 +826,16 @@
           <line>700</line>
           <option name="timeStamp" value="140" />
         </line-breakpoint>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/ID2TLib/Controller.py</url>
+          <line>47</line>
+          <option name="timeStamp" value="145" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/ID2TLib/AttackController.py</url>
+          <line>99</line>
+          <option name="timeStamp" value="146" />
+        </line-breakpoint>
       </breakpoints>
       <breakpoints-dialog>
         <breakpoints-dialog />
@@ -820,7 +847,7 @@
           </properties>
         </breakpoint>
       </default-breakpoints>
-      <option name="time" value="145" />
+      <option name="time" value="147" />
     </breakpoint-manager>
     <watches-manager />
   </component>
@@ -1040,117 +1067,120 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/__init__.py">
+    <entry file="file://$PROJECT_DIR$/Attack/__init__.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="0">
-          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+        <state relative-caret-position="135">
+          <caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Attack/__init__.py">
+    <entry file="file://$PROJECT_DIR$/_labels.xml" />
+    <entry file="file://$PROJECT_DIR$/__init__.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="135">
-          <caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
+        <state relative-caret-position="0">
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Attack/BaseAttack.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/Label.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="724">
-          <caret line="250" column="8" selection-start-line="250" selection-start-column="8" selection-end-line="250" selection-end-column="8" />
+        <state relative-caret-position="165">
+          <caret line="11" column="57" selection-start-line="11" selection-start-column="57" selection-end-line="11" selection-end-column="57" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Attack/PortscanAttack.py">
+    <entry file="file://$USER_HOME$/.PyCharm2016.2/system/python_stubs/-1247971765/_sha1.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="105">
-          <caret line="14" column="44" selection-start-line="14" selection-start-column="44" selection-end-line="14" selection-end-column="44" />
+        <state relative-caret-position="227">
+          <caret line="25" column="8" selection-start-line="25" selection-start-column="8" selection-end-line="25" selection-end-column="8" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/_labels.xml" />
-    <entry file="file://$PROJECT_DIR$/__init__.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/PcapFile.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="0">
-          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+        <state relative-caret-position="357">
+          <caret line="95" column="0" selection-start-line="95" selection-start-column="0" selection-end-line="95" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/config_example">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/StatsDatabase.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="0">
-          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+        <state relative-caret-position="1174">
+          <caret line="302" column="0" selection-start-line="302" selection-start-column="0" selection-end-line="302" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/Label.py">
+    <entry file="file://$PROJECT_DIR$/Attack/AttackParameters.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="165">
-          <caret line="11" column="57" selection-start-line="11" selection-start-column="57" selection-end-line="11" selection-end-column="57" />
+        <state relative-caret-position="221">
+          <caret line="16" column="41" selection-start-line="16" selection-start-column="41" selection-end-line="16" selection-end-column="41" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/LabelManager.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/__init__.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="682">
-          <caret line="64" column="0" selection-start-line="64" selection-start-column="0" selection-end-line="64" selection-end-column="0" />
-          <folding />
+        <state relative-caret-position="0">
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$USER_HOME$/.PyCharm2016.2/system/python_stubs/-1247971765/_sha1.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/LabelManager.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="227">
-          <caret line="25" column="8" selection-start-line="25" selection-start-column="8" selection-end-line="25" selection-end-column="8" />
+        <state relative-caret-position="390">
+          <caret line="117" column="8" selection-start-line="117" selection-start-column="8" selection-end-line="117" selection-end-column="8" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/PcapFile.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/Statistics.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="357">
-          <caret line="95" column="0" selection-start-line="95" selection-start-column="0" selection-end-line="95" selection-end-column="0" />
+        <state relative-caret-position="270">
+          <caret line="18" column="22" selection-start-line="18" selection-start-column="22" selection-end-line="18" selection-end-column="22" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/AttackController.py">
+    <entry file="file://$PROJECT_DIR$/config_example">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="192">
-          <caret line="83" column="30" selection-start-line="83" selection-start-column="30" selection-end-line="83" selection-end-column="30" />
+        <state relative-caret-position="0">
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/Controller.py">
+    <entry file="file://$PROJECT_DIR$/CLI.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="285">
-          <caret line="26" column="58" selection-start-line="26" selection-start-column="58" selection-end-line="26" selection-end-column="58" />
+        <state relative-caret-position="360">
+          <caret line="44" column="64" selection-start-line="44" selection-start-column="64" selection-end-line="44" selection-end-column="64" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/Statistics.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/Controller.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-2276">
-          <caret line="22" column="40" selection-start-line="22" selection-start-column="40" selection-end-line="22" selection-end-column="40" />
+        <state relative-caret-position="356">
+          <caret line="42" column="39" selection-start-line="42" selection-start-column="39" selection-end-line="42" selection-end-column="39" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ID2TLib/StatsDatabase.py">
+    <entry file="file://$PROJECT_DIR$/ID2TLib/AttackController.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1174">
-          <caret line="302" column="0" selection-start-line="302" selection-start-column="0" selection-end-line="302" selection-end-column="0" />
+        <state relative-caret-position="-207">
+          <caret line="64" column="8" selection-start-line="64" selection-start-column="8" selection-end-line="64" selection-end-column="8" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Attack/AttackParameters.py">
+    <entry file="file://$PROJECT_DIR$/Attack/BaseAttack.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="221">
-          <caret line="16" column="41" selection-start-line="16" selection-start-column="41" selection-end-line="16" selection-end-column="41" />
+        <state relative-caret-position="-252">
+          <caret line="187" column="8" selection-start-line="187" selection-start-column="8" selection-end-line="187" selection-end-column="8" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/CLI.py">
+    <entry file="file://$PROJECT_DIR$/Attack/PortscanAttack.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="116">
-          <caret line="93" column="0" selection-start-line="93" selection-start-column="0" selection-end-line="93" selection-end-column="0" />
+        <state relative-caret-position="305">
+          <caret line="65" column="15" selection-start-line="65" selection-start-column="15" selection-end-line="65" selection-end-column="15" />
           <folding />
         </state>
       </provider>

+ 8 - 4
code/Attack/BaseAttack.py

@@ -27,9 +27,9 @@ class BaseAttack(metaclass=ABCMeta):
         self.statistics = statistics
 
         # Class fields
-        self.attackName = name
-        self.attackDescription = description
-        self.attackType = attack_type
+        self.attack_name = name
+        self.attack_description = description
+        self.attack_type = attack_type
         self.params = {}
         self.supported_params = {}
         self.attack_start_utime = 0
@@ -76,7 +76,11 @@ class BaseAttack(metaclass=ABCMeta):
                 ip_address_output.append(ip)
             except ValueError:
                 return False, ip_address_output
-        return True, ip_address_output
+
+        if len(ip_address_output) == 1:
+            return True, ip_address_output[0]
+        else:
+            return True, ip_address_output
 
     @staticmethod
     def _is_port(ports_input: str):

+ 1 - 0
code/Attack/PortscanAttack.py

@@ -66,6 +66,7 @@ class PortscanAttack(BaseAttack.BaseAttack):
             """
             nonlocal timestamp_next_pkt, pps, maxdelay
             timestamp_current_packet = timestamp_next_pkt  # current timestamp
+            #TODO Derive timestamps based on pps rate given
             timestamp_next_pkt = timestamp_next_pkt + uniform(0.1 / pps, maxdelay)  # timestamp for next pkt
             return timestamp_current_packet
 

+ 16 - 16
code/CLI.py

@@ -109,22 +109,22 @@ def main(args):
 
 
 # Uncomment to enable calling by terminal
+#if __name__ == '__main__':
+#    main(sys.argv[1:])
+
 if __name__ == '__main__':
-    main(sys.argv[1:])
-
-# if __name__ == '__main__':
-#     FILE = ['-i', '/mnt/hgfs/datasets/95M.pcap']
-#
-#     ATTACK = ['-a', 'PortscanAttack', 'ip.src=most_used(ipAddress)', 'mac.dst=05:AB:47:B5:19:11',
-#               'inject.at-timestamp=1980733342', 'attack.note=First portscan Attack']
-#     ATTACK2 = ['-a', 'PortscanAttack', 'ip.dst=193.133.122.23, ip.src=192.124.34.12', 'inject.after-pkt=34']
-#
-#     STATS_RECALC = ['-r']
-#     STATS_PRINT = ['-s']
-#
-#     QUERY_MODE_LOOP = ['-q']
-#     QUERY_DB = ['-q', 'most_used(ttlValue)']
-#
-#     main(FILE + QUERY_DB)
+    FILE = ['-i', '/mnt/hgfs/datasets/95M.pcap']
+
+    ATTACK = ['-a', 'PortscanAttack', 'ip.src=10.2.2.4', 'mac.dst=05:AB:47:B5:19:11',
+              'inject.at-timestamp=1449038705.316721', 'attack.note=First portscan Attack']
+    ATTACK2 = ['-a', 'PortscanAttack', 'ip.dst=193.133.122.23, ip.src=192.124.34.12', 'inject.after-pkt=34']
+
+    STATS_RECALC = ['-r']
+    STATS_PRINT = ['-s']
+
+    QUERY_MODE_LOOP = ['-q']
+    QUERY_DB = ['-q', 'most_used(ttlValue)']
+
+    main(FILE + ATTACK)
 
     # main(['-c', '/home/pjattke/Thesis/development/code/config'])

+ 6 - 5
code/ID2TLib/AttackController.py

@@ -21,7 +21,6 @@ class AttackController:
         self.pcap_file = pcap_file
         self.label_mgr = label_manager
 
-        self.available_attacks = Attack.__all__
         self.current_attack = None
         self.added_attacks = []
         self.written_pcaps = []
@@ -65,10 +64,12 @@ class AttackController:
 
     def process_attack(self, attack: str, params: str):
         """
-
-        :param attack:
-        :param params:
-        :return:
+        Takes as input the name of an attack (classname) and the attack parameters as string. Parses the string of
+        attack parameters, creates the attack by writing the attack packets, merges these packets into the existing
+        dataset and stores the label file of the injected attacks.
+        :param attack: The classname of the attack to injecect.
+        :param params: The parameters for attack customization, see attack class for supported params.
+        :return: The file path to the created pcap file.
         """
         self.create_attack(attack)
 

+ 1 - 1
code/ID2TLib/Controller.py

@@ -36,7 +36,7 @@ class Controller:
         """
         self.statistics.load_pcap_statistics(flag_write_file, flag_recalculate_stats, flag_print_statistics)
 
-    def process_attacks(self, attacks_config):
+    def process_attacks(self, attacks_config: list):
         """
         Creates the attack based on the attack name and the attack parameters given in the attacks_config. The
         attacks_config is a list of attacks, e.g.

+ 11 - 11
code/ID2TLib/LabelManager.py

@@ -28,10 +28,10 @@ class LabelManager:
         self.labels = list()
 
         if filepath_pcap is not None:
-            self.labelFilePath = filepath_pcap.strip('.pcap') + '_labels.xml'
+            self.label_file_path = filepath_pcap.strip('.pcap') + '_labels.xml'
             # only load labels if label file is existing
-            if os.path.exists(self.labelFilePath):
-                self._load_labels()
+            if os.path.exists(self.label_file_path):
+                self.load_labels()
 
     def add_labels(self, labels):
         """
@@ -53,12 +53,12 @@ class LabelManager:
     def write_label_file(self, filepath=None):
         """
         Writes previously added/loaded labels to a XML file. Uses the given filepath as destination path, if no path is
-        given, uses the path in labelFilePath.
+        given, uses the path in label_file_path.
 
         :param filepath: The path where the label file should be written to.
         """
 
-        def get_subtree_timestamp(xml_tag_root, timestamp_entry) -> Element:
+        def get_subtree_timestamp(xml_tag_root, timestamp_entry):
             """
             Creates the subtree for a given timestamp, consisting of the unix time format (seconds) and a human-readable
             output.
@@ -83,7 +83,7 @@ class LabelManager:
             return timestamp_root
 
         if filepath is not None:
-            self.labelFilePath = filepath.strip('.pcap') + '_labels.xml'
+            self.label_file_path = filepath.strip('.pcap') + '_labels.xml'
 
         # Generate XML
         doc = Document()
@@ -111,23 +111,23 @@ class LabelManager:
         doc.appendChild(node)
 
         # Write XML to file
-        file = open(self.labelFilePath, 'w')
+        file = open(self.label_file_path, 'w')
         file.write(doc.toprettyxml())
         file.close()
 
-    def _load_labels(self):
+    def load_labels(self):
         """
-        Loads the labels from an already existing label XML file located at labelFilePath (set by constructor).
+        Loads the labels from an already existing label XML file located at label_file_path (set by constructor).
 
         """
         print("Label file found. Loading labels...")
-        dom = parse(self.labelFilePath)
+        dom = parse(self.label_file_path)
 
         # Check if version of parser and version of file match
         version = dom.getElementsByTagName(self.TAG_ROOT)[0].getAttribute(self.ATTR_VERSION)
         if not version == self.ATTR_VERSION_VALUE:
             raise ValueError(
-                "The file " + self.labelFilePath + " was created by another version of ID2TLib.LabelManager")
+                "The file " + self.label_file_path + " was created by another version of ID2TLib.LabelManager")
 
         # Parse attacks from XML file
         attacks = dom.getElementsByTagName(self.TAG_ATTACK)

+ 2 - 2
code/ID2TLib/PcapFile.py

@@ -14,7 +14,7 @@ class PcapFile(object):
         """
         self.pcap_file_path = pcap_file_path
 
-    def merge_attack(self, attack_pcap_path: str) -> str:
+    def merge_attack(self, attack_pcap_path: str):
         """
         Merges the loaded PCAP with the PCAP at attack_pcap_path.
 
@@ -30,7 +30,7 @@ class PcapFile(object):
 
         return file_out_path
 
-    def get_file_hash(self) -> str:
+    def get_file_hash(self):
         """
         Returns the hash for the loaded PCAP file. The hash is calculated bsaed on:
 

+ 9 - 10
code/ID2TLib/Statistics.py

@@ -16,8 +16,7 @@ class Statistics:
         """
         # Fields
         self.pcap_filepath = pcap_file.pcap_file_path
-        self.pcap_processor = None
-        pcap_file_hash = pcap_file.get_file_hash()
+        self.pcap_proc = None
 
         # Create folder for statistics database if required
         self.path_db = pcap_file.get_db_path()
@@ -48,9 +47,9 @@ class Statistics:
 
         # Recalculate statistics if database not exists OR param -r/--recalculate was provided
         if (not self.stats_db.get_db_exists()) or flag_recalculate_stats:
-            self.pcap_processor = pr.pcap_processor(self.pcap_filepath)
-            self.pcap_processor.collect_statistics()
-            self.pcap_processor.write_to_database(self.path_db)
+            self.pcap_proc = pr.pcap_processor(self.pcap_filepath)
+            self.pcap_proc.collect_statistics()
+            self.pcap_proc.write_to_database(self.path_db)
             outstring_datasource = "by PCAP file processor."
         else:
             outstring_datasource = "from statistics database."
@@ -94,7 +93,7 @@ class Statistics:
                 ("Avg. bandwidth out", self.file_info['avgBandwidthOut'], "kbit/s")]
 
     @staticmethod
-    def _write_list(desc_val_unit_list, func, line_ending="\n"):
+    def write_list(desc_val_unit_list, func, line_ending="\n"):
         """
         Takes a list of tuples (statistic name, statistic value, unit) as input, generates a string of these three values
         and applies the function func on this string.
@@ -129,9 +128,9 @@ class Statistics:
         Prints the basic file statistics to the terminal.
         """
         print("\nPCAP FILE INFORMATION ------------------------------")
-        Statistics._write_list(self.get_file_information(), print, "")
+        Statistics.write_list(self.get_file_information(), print, "")
         print("\nGENERAL FILE STATISTICS ----------------------------")
-        Statistics._write_list(self.get_general_file_statistics(), print, "")
+        Statistics.write_list(self.get_general_file_statistics(), print, "")
         print("\n")
 
     def write_statistics_to_file(self):
@@ -153,10 +152,10 @@ class Statistics:
         target.truncate()
 
         _write_header("PCAP file information")
-        Statistics._write_list(self.get_file_information(), target.write)
+        Statistics.write_list(self.get_file_information(), target.write)
 
         _write_header("General statistics")
-        Statistics._write_list(self.get_general_file_statistics(), target.write)
+        Statistics.write_list(self.get_general_file_statistics(), target.write)
 
         target.close()
 

BIN
code/ID2TLib/libpcapreader.so


+ 77 - 59
code_boost/src/.idea/workspace.xml

@@ -27,13 +27,19 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="d9c49765-9fd1-4a96-9963-862040c74354" name="Default" comment="- Cleaned up the code&#10;- Added code comments">
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Backup.cpp" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Column.cpp" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Database.cpp" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Exception.cpp" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Statement.cpp" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/SQLiteCpp/src/Transaction.cpp" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/release_test/libpcapreader.so" afterPath="$PROJECT_DIR$/release_test/libpcapreader.so" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/.idea/workspace.xml" afterPath="$PROJECT_DIR$/../../code/.idea/workspace.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/Attack/BaseAttack.py" afterPath="$PROJECT_DIR$/../../code/Attack/BaseAttack.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/Attack/PortscanAttack.py" afterPath="$PROJECT_DIR$/../../code/Attack/PortscanAttack.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/ID2TLib/AttackController.py" afterPath="$PROJECT_DIR$/../../code/ID2TLib/AttackController.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/ID2TLib/Controller.py" afterPath="$PROJECT_DIR$/../../code/ID2TLib/Controller.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/ID2TLib/LabelManager.py" afterPath="$PROJECT_DIR$/../../code/ID2TLib/LabelManager.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/ID2TLib/PcapFile.py" afterPath="$PROJECT_DIR$/../../code/ID2TLib/PcapFile.py" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../code/ID2TLib/Statistics.py" afterPath="$PROJECT_DIR$/../../code/ID2TLib/Statistics.py" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/cxx/pcap_processor.cpp" afterPath="$PROJECT_DIR$/cxx/pcap_processor.cpp" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/cxx/statistics.cpp" afterPath="$PROJECT_DIR$/cxx/statistics.cpp" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/cxx/statistics.h" afterPath="$PROJECT_DIR$/cxx/statistics.h" />
     </list>
     <ignored path="src.iws" />
     <ignored path=".idea/workspace.xml" />
@@ -54,7 +60,18 @@
     <favorites_list name="src" />
   </component>
   <component name="FileEditorManager">
-    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
+    <leaf>
+      <file leaf-file-name="statistics.h" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/cxx/statistics.h">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="389">
+              <caret line="177" column="0" selection-start-line="177" selection-start-column="0" selection-end-line="177" selection-end-column="0" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
   </component>
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
@@ -97,7 +114,6 @@
         <option value="$PROJECT_DIR$/cxx/pcapprocessor.h" />
         <option value="$PROJECT_DIR$/cxx/Statistics.h" />
         <option value="$PROJECT_DIR$/cxx/Statistics.cpp" />
-        <option value="$PROJECT_DIR$/cxx/statistics.h" />
         <option value="$PROJECT_DIR$/cxx/statistics.cpp" />
         <option value="$PROJECT_DIR$/cxx/StatisticsDB.h" />
         <option value="$PROJECT_DIR$/cxx/StatisticsDB.cpp" />
@@ -109,6 +125,7 @@
         <option value="$PROJECT_DIR$/cxx/pcap_processor.h" />
         <option value="$PROJECT_DIR$/cxx/pcap_processor.cpp" />
         <option value="$PROJECT_DIR$/release_test/pcapreader.py" />
+        <option value="$PROJECT_DIR$/cxx/statistics.h" />
       </list>
     </option>
   </component>
@@ -118,7 +135,7 @@
   <component name="OCFindUsagesOptions" text="true" ivars="false" properties="true" derivedClasses="false" />
   <component name="ProjectFrameBounds">
     <option name="width" value="1674" />
-    <option name="height" value="1022" />
+    <option name="height" value="882" />
   </component>
   <component name="ProjectInspectionProfilesVisibleTreeState">
     <entry key="Project Default">
@@ -213,6 +230,24 @@
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
             </PATH_ELEMENT>
           </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="build" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="Debug" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
           <PATH>
             <PATH_ELEMENT>
               <option name="myItemId" value="src" />
@@ -232,26 +267,26 @@
     </panes>
   </component>
   <component name="PropertiesComponent">
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/SQLiteCpp/src" />
+    <property name="last_opened_file_path" value="$USER_HOME$/PcapPlusPlus/Examples/PcapSplitter" />
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="settings.editor.selected.configurable" value="vcs.Git" />
     <property name="settings.editor.splitter.proportion" value="0.2" />
     <property name="full.screen.before.presentation.mode" value="false" />
   </component>
   <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="$PROJECT_DIR$/r0.2" />
+      <recent name="$USER_HOME$/DE/src/cxx" />
+    </key>
     <key name="MoveFile.RECENT_KEYS">
-      <recent name="$PROJECT_DIR$/release_test/dir" />
       <recent name="$PROJECT_DIR$/release_test" />
+      <recent name="$PROJECT_DIR$/release_test/dir" />
       <recent name="$PROJECT_DIR$/r0.3" />
       <recent name="$PROJECT_DIR$/cxx_boost" />
       <recent name="$PROJECT_DIR$/SQLiteCpp/src" />
     </key>
-    <key name="CopyFile.RECENT_KEYS">
-      <recent name="$PROJECT_DIR$/r0.2" />
-      <recent name="$USER_HOME$/DE/src/cxx" />
-    </key>
   </component>
-  <component name="RunManager" selected="Python.release_test">
+  <component name="RunManager" selected="Application.Build libpcapreader">
     <configuration default="false" name="release_test" type="PythonConfigurationType" factoryName="Python" temporary="true">
       <option name="INTERPRETER_OPTIONS" value="" />
       <option name="PARENT_ENVS" value="true" />
@@ -452,6 +487,9 @@
       <workItem from="1475421160575" duration="212000" />
       <workItem from="1475421616329" duration="244000" />
       <workItem from="1475422144846" duration="6415000" />
+      <workItem from="1477944449858" duration="91000" />
+      <workItem from="1478004715882" duration="253000" />
+      <workItem from="1478020631285" duration="152000" />
     </task>
     <task id="LOCAL-00001" summary="- Initial commit for PcapProcessing library, based on C++ and Boost">
       <created>1468938336718</created>
@@ -506,7 +544,7 @@
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="28364000" />
+    <option name="totallyTimeSpent" value="28860000" />
   </component>
   <component name="TodoView">
     <todo-panel id="selected-file">
@@ -518,17 +556,17 @@
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="0" y="0" width="1674" height="1022" extended-state="0" />
-    <editor active="false" />
+    <frame x="0" y="0" width="1674" height="882" extended-state="0" />
+    <editor active="true" />
     <layout>
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15342632" sideWeight="0.4586331" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15342632" sideWeight="0.43617022" order="0" side_tool="false" content_ui="combo" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32890365" sideWeight="0.45899633" order="4" side_tool="false" content_ui="tabs" />
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.38222224" sideWeight="0.41479686" order="10" side_tool="false" content_ui="tabs" />
-      <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.27555555" sideWeight="0.42995754" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.38157895" sideWeight="0.41479686" order="10" side_tool="false" content_ui="tabs" />
+      <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.275" sideWeight="0.42995754" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3298292" sideWeight="0.50211734" order="7" side_tool="true" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32890365" sideWeight="0.49788263" order="8" side_tool="false" content_ui="tabs" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.38222224" sideWeight="0.5852032" order="6" side_tool="true" content_ui="tabs" x="0" y="327" width="1676" height="187" />
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15342632" sideWeight="0.54136693" order="1" side_tool="true" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15342632" sideWeight="0.5638298" order="1" side_tool="true" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32890365" sideWeight="0.497552" order="9" side_tool="false" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.19358742" sideWeight="0.5045992" order="2" side_tool="true" content_ui="tabs" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28539824" sideWeight="0.49547374" order="1" side_tool="false" content_ui="tabs" />
@@ -878,69 +916,49 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/cxx/statistics.h">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="345">
-          <caret line="209" column="6" selection-start-line="209" selection-start-column="6" selection-end-line="209" selection-end-column="6" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$USER_HOME$/.CLion2016.2/clion64.vmoptions">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="240">
           <caret line="16" column="0" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
-          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/cxx_boost/pcapreader.h">
+    <entry file="file://$PROJECT_DIR$/cxx_boost/pcapreader.h" />
+    <entry file="file://$PROJECT_DIR$/cxx_boost/pcapreader.cxx" />
+    <entry file="file://$PROJECT_DIR$/cxx/pcap_processor.h">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="121">
-          <caret line="13" column="15" selection-start-line="13" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
-          <folding />
+        <state relative-caret-position="362">
+          <caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/cxx_boost/pcapreader.cxx">
+    <entry file="file://$PROJECT_DIR$/cxx/pcap_processor.cpp">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="283">
-          <caret line="247" column="55" selection-start-line="247" selection-start-column="55" selection-end-line="247" selection-end-column="55" />
-          <folding />
+        <state relative-caret-position="1622">
+          <caret line="226" column="0" selection-start-line="226" selection-start-column="0" selection-end-line="241" selection-end-column="3" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/cxx/pcap_processor.h">
+    <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="362">
-          <caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
+        <state relative-caret-position="-63">
+          <caret line="27" column="24" selection-start-line="27" selection-start-column="24" selection-end-line="27" selection-end-column="24" />
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/release_test/pcapreader.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="195">
+        <state relative-caret-position="180">
           <caret line="13" column="25" selection-start-line="13" selection-start-column="25" selection-end-line="13" selection-end-column="25" />
-          <folding>
-            <element signature="e#29#68#0" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/cxx/pcap_processor.cpp">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1622">
-          <caret line="226" column="0" selection-start-line="226" selection-start-column="0" selection-end-line="241" selection-end-column="3" />
-          <folding>
-            <marker date="1475431165897" expanded="true" signature="8313:8839" ph="//..." />
-          </folding>
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
+    <entry file="file://$PROJECT_DIR$/cxx/statistics.h">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="436">
-          <caret line="47" column="32" selection-start-line="47" selection-start-column="32" selection-end-line="47" selection-end-column="32" />
+        <state relative-caret-position="389">
+          <caret line="177" column="0" selection-start-line="177" selection-start-column="0" selection-end-line="177" selection-end-column="0" />
           <folding />
         </state>
       </provider>

+ 2 - 2
code_boost/src/cxx/pcap_processor.cpp

@@ -151,7 +151,7 @@ void pcap_processor::process_packets(const Packet &pkt) {
         stats.incrementProtocolCount(ipAddressSender, "IPv4");
 
         // Assign IP Address to MAC Address
-        stats.assign_mac_address(ipAddressSender, mac_address);
+        stats.assignMacAddress(ipAddressSender, mac_address);
 
     } // PDU is IPv6
     else if (pdu_l3_type == PDU::PDUType::IPv6) {
@@ -169,7 +169,7 @@ void pcap_processor::process_packets(const Packet &pkt) {
         stats.incrementProtocolCount(ipAddressSender, "IPv6");
 
         // Assign IP Address to MAC Address
-        stats.assign_mac_address(ipAddressSender, mac_address);
+        stats.assignMacAddress(ipAddressSender, mac_address);
     } else {
         std::cout << "Unknown PDU Type on L3: " << pdu_l3_type << std::endl;
     }

+ 1 - 1
code_boost/src/cxx/statistics.cpp

@@ -57,7 +57,7 @@ statistics::statistics(void) {
  * @param ipAddress The IP address belonging to the given MAC address.
  * @param macAddress The MAC address belonging to the given IP address.
  */
-void statistics::assign_mac_address(std::string ipAddress, std::string macAddress) {
+void statistics::assignMacAddress(std::string ipAddress, std::string macAddress) {
     ip_mac_mapping[ipAddress] = macAddress;
 }
 

+ 1 - 1
code_boost/src/cxx/statistics.h

@@ -174,7 +174,7 @@ public:
 
     void setTimestampLastPacket(Tins::Timestamp ts);
 
-    void assign_mac_address(std::string ipAddress, std::string macAddress);
+    void assignMacAddress(std::string ipAddress, std::string macAddress);
 
     void addIpStat_packetSent(std::string ipAddressSender, std::string ipAddressReceiver, long bytesSent);
 

BIN
code_boost/src/release_test/libpcapreader.so