summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/packetmatcher
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/MonitoringTool/PacketTracking/packetmatcher')
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/.gitignore7
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/nbactions.xml15
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/pom.xml119
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ExportTask.java293
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/FileExporter.java287
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Generator.java84
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/JenkinsHash.java180
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Matcher.java586
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/MatchingTask.java48
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIDSetComparator.java33
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdMatcher.java94
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecord.java156
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecordComparator.java50
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Console.java412
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Probe.java345
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtInterfaceStats.java96
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtMin.java63
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeLocation.java119
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeStats.java78
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtSync.java80
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtl.java71
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtlIP.java88
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtMin.java99
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtSync.java131
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtl.java139
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtlIP.java174
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceDescription.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceName.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessage.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageId.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageValue.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatDrop.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatRecv.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuSys.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuUser.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemRss.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemVzs.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemCpuIdle.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemMemFree.java91
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/resources/log4j.properties28
40 files changed, 5058 insertions, 0 deletions
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/.gitignore b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/.gitignore
new file mode 100644
index 0000000..9ad20d8
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/.gitignore
@@ -0,0 +1,7 @@
+*.log
+.m2classpath
+.classpath
+.project
+.settings/*
+target/*
+matcher_data/*
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/nbactions.xml b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/nbactions.xml
new file mode 100644
index 0000000..54bb66e
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/nbactions.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+ <action>
+ <actionName>run</actionName>
+ <goals>
+ <goal>process-classes</goal>
+ <goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal>
+ </goals>
+ <properties>
+ <exec.classpathScope>runtime</exec.classpathScope>
+ <exec.args>-classpath %classpath de.fhg.fokus.net.packetmatcher.Matcher</exec.args>
+ <exec.executable>java</exec.executable>
+ </properties>
+ </action>
+ </actions>
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/pom.xml b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/pom.xml
new file mode 100644
index 0000000..105a8ac
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/pom.xml
@@ -0,0 +1,119 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>de.fhg.fokus.net</groupId>
+ <artifactId>packetmatcher</artifactId>
+ <name>PacketMatcher</name>
+ <version>1.0-jan2012</version>
+ <description>packetID matcher</description>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <archive>
+ <manifest>
+ <mainClass>
+ org.kohsuke.args4j.Starter
+ </mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id> <!-- this is used for inheritance merges -->
+ <phase>package</phase> <!-- append to the packaging phase. -->
+ <goals>
+ <goal>single</goal> <!-- goals == mojos -->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>de.fhg.fokus.net</groupId>
+ <artifactId>ipfix-collector</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>de.fhg.fokus.net</groupId>
+ <artifactId>pt-api</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ <version>2.0.12</version>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <executable>../scripts/m2classpath.sh</executable>
+ <arguments>
+ <argument>create_classpath_file</argument>
+ <classpath />
+ </arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ExportTask.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ExportTask.java
new file mode 100644
index 0000000..c11faaf
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ExportTask.java
@@ -0,0 +1,293 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.io.IOException;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.TimeUnit;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ptapi.BaseRecord;
+import de.fhg.fokus.net.ptapi.PacketTrackRecord;
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+
+public class ExportTask {
+ // -- sys --
+ private static final Logger logger = LoggerFactory
+ .getLogger(ExportTask.class);
+ private Map<Integer, ConcurrentSkipListSet<PacketIdRecord>> pktIdMap;
+ public Executor pool = Executors.newFixedThreadPool(7);
+
+ // export task should be rewritten, for the meanwhile let's make
+ // get the file exporter from matcher
+ private final FileExporter fileExporter;
+
+ // -- model --
+ /**
+ * Timeout to switch between export queues. The export task will way this time
+ * for an element to be available in the queue. If an element were not available
+ * after this time, the next export queue will be checked. Currently there are
+ * two export queues: exportqueue, and exportqueueStats.
+ *
+ */
+ private long exportQueuePoolTimeoutMillis = 200;
+
+ private BlockingQueue<SortedSet<PacketIdRecord>> exportQueue;
+
+ /**
+ * Used for relaying stats and sampling records from to
+ * netview.
+ */
+ private final BlockingQueue<ProbeRecord> exportQueueProbeRecords = new LinkedBlockingDeque<ProbeRecord>();
+ private ObjectOutput out;
+ private Socket client;
+ private final InetSocketAddress remoteSocketAddr;
+ private Boolean ttlcheck=false;
+
+ private long numberOfStatsRecordsSent = 0;
+ private long numberOfTracRecordsSent = 0;
+
+ // -- util --
+ private JenkinsHash hashBOBCalculator = new JenkinsHash();
+
+ @Override
+ public String toString() {
+ if(exportQueue==null){
+ return "ExportTask:{ \"not yet initialized\"}";
+ }
+ return String.format(
+ "ExportTask:{\n" +
+ " exportQueue{ size: %d, recs: %d }, \n" +
+ " exportQueueStats{ size: %d, recs: %d }" +
+ "}",
+ exportQueue.size(),
+ numberOfTracRecordsSent,
+ exportQueueProbeRecords.size(),
+ numberOfStatsRecordsSent);
+ }
+ private PacketTrackRecord getRecord(SortedSet<PacketIdRecord> set) {
+
+ int i = 0;
+ PacketTrackRecord record = null;
+
+ if (set != null) {
+ // System.out.println("Set-Size:" + set.size() + " packetID: ");
+ // System.out.println( set.first().getPacketID() + " \n" );
+ // record.content.packetLength = set.first().getPacketSize();
+ // record.content.version = set.first().getVersion();
+ // record.content.protocol = set.first().getProtocol();
+
+ /*
+ * in case there are multiple observations of one packet at one
+ * observationPoint we will drop the second observation so there
+ * will be no weird packet reordering due to bad time synchronisation -
+ * there is only the ordering problem with the first observation which
+ * will only be seen once with the same TTL as the second observation
+ * and in case pcap does not observe all packets twice
+ */
+
+ ArrayList<Integer> nodeSet = new ArrayList<Integer>();
+ PacketIdRecord probablefirstobservationpoint = set.first();
+ int current_ttl = probablefirstobservationpoint.getTtl();
+ for (PacketIdRecord pir : set) {
+ if (!nodeSet.contains(pir.getProbeID())) {
+ nodeSet.add(pir.getProbeID());
+ i++;
+ }
+ if (ttlcheck) {
+ if (pir.getTtl() < (current_ttl-1)) {
+ logger.debug("TTL decreased more than 1 - record dropped");
+ return null;
+ }
+ }
+ else {
+ current_ttl = pir.getTtl();
+ }
+ }
+
+ record = new PacketTrackRecord(i);
+ ByteBuffer bBuffer = ByteBuffer.allocate(4 * i);
+ nodeSet.clear();
+
+ i=0;
+ for (PacketIdRecord pir : set) {
+
+ if (!nodeSet.contains(pir.getProbeID())) {
+ nodeSet.add(pir.getProbeID());
+ record.oids[i] = pir.getProbeID();
+ record.ts[i] = pir.getTimeStamp();
+ record.ttl[i] = pir.getTtl();
+ record.size = pir.getPacketSize();
+ // Setting source and destination addresses / ports
+ record.sourceAddress = pir.getSourceAddress();
+ record.sourcePort = pir.getSourcePort();
+ record.destinationAddress = pir.getDestinationAddress();
+ record.destinationPort = pir.getDestinationPort();
+
+ bBuffer.putInt(pir.getProbeID());
+ i++;
+ } else {
+ if ((pir.getProbeID() == probablefirstobservationpoint.getProbeID()) && (i == 2) ) {
+ /**
+ * there may be a timestamp reordering problem between first and second observation
+ * example A (ts1,ttl64)-B (ts2,ttl64)-A (ts3,ttl63) - isin a wrong order - it must be B,A,A
+ * we just exchange A and B and give B the earlier timestamp ...
+ */
+ record.oids[0] = record.oids[1];
+ record.oids[1] = pir.getProbeID();
+ }
+ }
+ record.trackid = (int) hashBOBCalculator.hash(bBuffer.array());
+ record.pktid = set.first().getPacketID();
+ }
+ }
+ return record;
+
+ }
+
+ /**
+ * Create an export task
+ *
+ * @param exportqueue
+ * @param iaddr
+ * @param portnumber
+ * @throws UnknownHostException
+ * @throws IOException
+ */
+ public ExportTask(FileExporter fileExporter, BlockingQueue<SortedSet<PacketIdRecord>> exportqueue,
+ InetAddress iaddr, int portnumber, Map<Integer, ConcurrentSkipListSet<PacketIdRecord>> pktIdMap) {
+ this.fileExporter = fileExporter;
+ this.exportQueue = exportqueue;
+ this.remoteSocketAddr = new InetSocketAddress(iaddr, portnumber);
+ this.pktIdMap = pktIdMap;
+ }
+
+ /**
+ * Connect to collector
+ *
+ * @return
+ * @throws IOException
+ */
+ public ExportTask start() throws IOException {
+ logger.debug("Starting export task");
+ this.client = new Socket(remoteSocketAddr.getAddress(),
+ remoteSocketAddr.getPort());
+ if (this.client.isConnected()) {
+ logger.debug("ExportTask connected to {}",
+ this.client.getRemoteSocketAddress());
+ }
+ OutputStream outStream = client.getOutputStream();
+ this.out = new ObjectOutputStream(outStream);
+ logger.debug("starting queue handling task");
+ pool.execute(new Runnable() {
+ @Override
+ public void run() {
+ handlequeues();
+ }
+ });
+ return this;
+ }
+
+ private void handlequeues() {
+ SortedSet<PacketIdRecord> set = null;
+ int count = 0;
+ try {
+ while (true) {
+ if( count < 20 && exportQueue.size() > 0 ) {
+ set = exportQueue.poll(exportQueuePoolTimeoutMillis, TimeUnit.MILLISECONDS);
+ count++;
+ PacketTrackRecord record = getRecord(set);
+ if (record != null) {
+ if(record.oids.length > 1) {
+// logger.debug("export record {}", record.toString() );
+ out.writeObject(record);
+ out.flush();
+ numberOfTracRecordsSent++;
+ fileExporter.putSentRecord(record);
+ }
+ }
+ pktIdMap.remove(record.pktid);
+ } else {
+ count=0;
+ BaseRecord stats = exportQueueProbeRecords.poll(exportQueuePoolTimeoutMillis, TimeUnit.MILLISECONDS);
+ if(stats != null){
+ out.writeObject(stats);
+ out.flush();
+ numberOfStatsRecordsSent++;
+ fileExporter.putSentRecord(stats);
+ continue;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ logger.info("finshed connection");
+ client =null;
+ }
+ }
+
+ public InetSocketAddress getRemoteSocketAddr() {
+ return remoteSocketAddr;
+ }
+
+ public Socket getClient() {
+ return client;
+ }
+
+ public void setTtlcheck(Boolean ttlcheck) {
+ this.ttlcheck = ttlcheck;
+ }
+
+ public void close() throws IOException {
+ if(out!=null ){
+ out.close();
+ }
+ if(client!=null){
+ client.close();
+ }
+ }
+
+ public long getExportQueuePoolTimeoutMillis() {
+ return exportQueuePoolTimeoutMillis;
+ }
+
+ public void setExportQueuePoolTimeoutMillis(long exportQueuePoolTimeoutMillis) {
+ this.exportQueuePoolTimeoutMillis = exportQueuePoolTimeoutMillis;
+ }
+ public boolean putProbeRecord( ProbeRecord prec ){
+ return exportQueueProbeRecords.offer(prec);
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/FileExporter.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/FileExporter.java
new file mode 100644
index 0000000..fb8b5bb
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/FileExporter.java
@@ -0,0 +1,287 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ptapi.BaseRecord;
+
+/**
+ * The FileExporter is responsible for writing measurement and export data to
+ * files. There are two types of data. The data the matcher receives (via
+ * IPFIX4Java) and the data it sends (to netview) .
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public class FileExporter {
+ // -- constants --
+ private static final int QUEUE_SIZE = 10000;
+ private static final int QUEUE_TIMEOUT_MILLIS = 300;
+ // -- sys --
+ public final Executor executor = Executors.newCachedThreadPool();
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
+ // -- model --
+ private final AtomicLong counter = new AtomicLong(0);
+ private File exportFolder = new File("matcher_data");
+ private boolean enableCsv = false;
+ private boolean enableObj = false;
+ /**
+ *
+ */
+ private boolean stopped = true;
+
+ public boolean isStopped() {
+ return stopped;
+ }
+
+ // represents the set of export data
+ // there are currently two:
+ // - received: data matcher receives
+ // - sent: data matcher sents
+ private class ExportSet {
+ final String name;
+ File outputDir;
+ ObjectOutputStream oos;
+ final BlockingQueue<BaseRecord> queue = new ArrayBlockingQueue<BaseRecord>(
+ QUEUE_SIZE);
+ ConcurrentMap<Class<?>, BufferedWriter> csvWriterMap = new ConcurrentHashMap<Class<?>, BufferedWriter>();
+
+ public ExportSet(String name) {
+ this.name = name;
+ }
+ }
+
+ private final ExportSet received = new ExportSet("received");
+ private final ExportSet sent = new ExportSet("sent");
+ private ExportSet group[] = { received, sent };
+
+ // data folder format
+ private final SimpleDateFormat dateFmtFolder = new SimpleDateFormat(
+ "yyyyMMdd'_'HHmmss");
+ // file header timestamp format
+ private final SimpleDateFormat dateFmtHeader = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss.S");
+
+ /**
+ * Insert a record into "received" queue.
+ *
+ * @param rec
+ */
+ public void putReceivedRecord(BaseRecord rec) {
+ if (stopped) {
+ return;
+ }
+ if (rec == null) {
+ logger.warn("received a null record, ignoring it.");
+ return;
+ }
+ if (!received.queue.offer(rec)) {
+ logger.warn("queue full, dropping: {}", rec.csvData());
+ }
+ }
+
+ /**
+ * Insert a recort into "sent" queue.
+ *
+ * @param rec
+ */
+ public void putSentRecord(BaseRecord rec) {
+ if (stopped) {
+ return;
+ }
+ if (rec == null) {
+ logger.warn("received a null record, ignoring it.");
+ return;
+ }
+ if (!sent.queue.offer(rec)) {
+ logger.warn("queue full, dropping: {}", rec.csvData());
+ }
+ }
+
+ private void export(final ExportSet es) {
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ if (enableObj) {
+ File file = new File(es.outputDir.getAbsolutePath()
+ + File.separator + es.name + ".obj");
+ try {
+ es.oos = new ObjectOutputStream(new FileOutputStream(
+ file));
+ } catch (IOException e) {
+ logger.error(e.getMessage());
+ }
+
+ }
+ try {
+ logger.info("Exporting data to {}" + File.separator,
+ es.outputDir.getAbsolutePath());
+ while (!stopped) {
+ // release block from time to time so we can
+ // quit the loop
+ BaseRecord rec = es.queue.poll(QUEUE_TIMEOUT_MILLIS,
+ TimeUnit.MILLISECONDS);
+ if (rec == null) {
+ continue;
+ }
+ if (enableObj && es.oos != null) {
+ es.oos.writeObject(rec);
+ es.oos.flush();
+ }
+ if (enableCsv) {
+ BufferedWriter csv = es.csvWriterMap.get(rec
+ .getClass());
+ if (csv == null) {
+ File file = new File(es.outputDir
+ .getAbsolutePath()
+ + File.separator
+ + rec.getClass().getSimpleName()
+ + ".csv");
+ csv = new BufferedWriter(new FileWriter(file,
+ true));
+ // saving writer for future reference
+ es.csvWriterMap.put(rec.getClass(), csv);
+ // write header
+ csv.write("# "
+ + dateFmtHeader.format(new Date()));
+ csv.newLine();
+ csv.write("# "
+ + rec.getClass().getCanonicalName());
+ csv.newLine();
+ csv.write("# record_id, ");
+ csv.write(rec.csvFields());
+ csv.newLine();
+ }
+ csv.write(counter.addAndGet(1) + ", ");
+ csv.write(rec.csvData());
+ csv.newLine();
+ csv.flush();
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ logger.error(e.getMessage());
+ FileExporter.this.stop();
+ }
+ }
+ });
+ }
+
+ public FileExporter() {
+
+ }
+
+ public void start() {
+ start(exportFolder);
+ }
+
+ public void start(File exportFolder) {
+ this.exportFolder = exportFolder;
+ this.stopped = false;
+ String folder = dateFmtFolder.format(new Date());
+
+ for (ExportSet es : group) {
+ es.outputDir = new File(exportFolder.getAbsolutePath()
+ + File.separator + folder + File.separator + es.name);
+ if (!es.outputDir.mkdirs()) {
+ throw new RuntimeException("could not create export folder "
+ + es.outputDir.getAbsoluteFile());
+ }
+ // start writing thread
+ export(es);
+ }
+ }
+
+ public void stop() {
+ if (stopped) {
+ return;
+ }
+ logger.info("stopping file exporter.");
+ for (ExportSet es : group) {
+ for (BufferedWriter wr : es.csvWriterMap.values()) {
+ try {
+ wr.close();
+ } catch (IOException e) {
+ logger.warn(e.getMessage());
+ }
+ }
+ try {
+ if (es.oos != null) {
+ es.oos.close();
+ }
+ } catch (IOException e) {
+ logger.warn(e.getMessage());
+ }
+ es.csvWriterMap.clear();
+ }
+ this.stopped = true;
+ // reset counter
+ counter.set(0);
+ }
+
+ @Override
+ public String toString() {
+ String outputDir = "";
+ if (received.outputDir != null && !stopped) {
+ outputDir = String.format(",\n outputDir: \"%s\" ",
+ this.exportFolder.getName() + File.separator
+ + received.outputDir.getParentFile().getName());
+ }
+ return String
+ .format("FileExporter{ running: %s, obj: %s, csv: %s, receivedQueue:%d, sentQueue:%d, written:%d"
+ + outputDir + " }", !stopped, enableObj, enableCsv,
+ received.queue.size(), sent.queue.size(), counter.get());
+ }
+
+ public boolean isEnableCsv() {
+ return enableCsv;
+ }
+
+ public void setEnableCsv(boolean enableCsv) {
+ this.enableCsv = enableCsv;
+ }
+
+ public boolean isEnableObj() {
+ return enableObj;
+ }
+
+ public void setEnableObj(boolean enableObj) {
+ this.enableObj = enableObj;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Generator.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Generator.java
new file mode 100644
index 0000000..641bff8
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Generator.java
@@ -0,0 +1,84 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.SortedSet;
+import java.util.concurrent.ArrayBlockingQueue;
+
+public class Generator implements Runnable{
+
+ class PacketSchedule implements Runnable {
+ private int pktid;
+ Thread thread;
+
+ public PacketSchedule(int pktid) {
+ this.pktid = pktid;
+ thread = new Thread(this);
+ thread.start();
+
+ }
+
+ @Override
+ public void run() {
+ for (int j = 0; j < probeIDs.length; j++) {
+ if (Math.random() < 0.5D) {
+ try {
+ Thread.sleep(Math.round(Math.random()*15));
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ PacketIdRecord rec = new PacketIdRecord(pktid, System.currentTimeMillis(), probeIDs[j], (short)100, 0 );
+ pktidmap.addPacketIdRecord(rec);
+ }
+ }
+ }
+
+ }
+
+ private PacketIdMatcher pktidmap;
+ private int [] probeIDs = { -1062731518, -1062731514, -1062731510, -1062731506,
+ -1062731502, -1062731515, -1062731511, -1062731503,
+ -1062731519, -1062731507 };
+
+
+ public Generator(PacketIdMatcher pktidmap) {
+ this.pktidmap = pktidmap;
+ }
+
+
+ // Socket client = collector.setUpClient();
+
+ @Override
+ public void run() {
+ for (int i = 0; i < 100; i++) {
+ PacketSchedule sched = new PacketSchedule(i);
+ }
+ }
+
+ public static void main(String[] args) throws IOException {
+ ArrayBlockingQueue<SortedSet<PacketIdRecord>> queue = new ArrayBlockingQueue<SortedSet<PacketIdRecord>>(10000);
+ PacketIdMatcher pktidmap = new PacketIdMatcher(1000, 1000, queue);
+ Generator ger = new Generator(pktidmap);
+ Thread generatorThread = new Thread(ger);
+ generatorThread.start();
+ ExportTask export = new ExportTask(null,queue, InetAddress.getLocalHost(), 12345, pktidmap.getPktIdMap());
+ export.start();
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/JenkinsHash.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/JenkinsHash.java
new file mode 100644
index 0000000..2b75ea5
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/JenkinsHash.java
@@ -0,0 +1,180 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+
+/**
+ * Hash algorithm by Bob Jenkins, 1996.
+ *
+ * You may use this code any way you wish, private, educational, or commercial. It's free.
+ * See: http://burtleburtle.net/bob/hash/doobs.html
+ *
+ * Use for hash table lookup, or anything where one collision in 2^^32
+ * is acceptable. Do NOT use for cryptographic purposes.
+ *
+ * Java port by Gray Watson http://256.com/gray/
+ */
+public class JenkinsHash {
+
+ // max value to limit it to 4 bytes
+ private static final long MAX_VALUE = 0xFFFFFFFFL;
+
+ // internal variables used in the various calculations
+ long a;
+ long b;
+ long c;
+
+ /**
+ * Convert a byte into a long value without making it negative.
+ */
+ private long byteToLong(byte b) {
+ long val = b & 0x7F;
+ if ((b & 0x80) != 0) {
+ val += 128;
+ }
+ return val;
+ }
+
+ /**
+ * Do addition and turn into 4 bytes.
+ */
+ private long add(long val, long add) {
+ return (val + add) & MAX_VALUE;
+ }
+
+ /**
+ * Do subtraction and turn into 4 bytes.
+ */
+ private long subtract(long val, long subtract) {
+ return (val - subtract) & MAX_VALUE;
+ }
+
+ /**
+ * Left shift val by shift bits and turn in 4 bytes.
+ */
+ private long xor(long val, long xor) {
+ return (val ^ xor) & MAX_VALUE;
+ }
+
+ /**
+ * Left shift val by shift bits. Cut down to 4 bytes.
+ */
+ private long leftShift(long val, int shift) {
+ return (val << shift) & MAX_VALUE;
+ }
+
+ /**
+ * Convert 4 bytes from the buffer at offset into a long value.
+ */
+ private long fourByteToLong(byte[] bytes, int offset) {
+ return (byteToLong(bytes[offset + 0])
+ + (byteToLong(bytes[offset + 1]) << 8)
+ + (byteToLong(bytes[offset + 2]) << 16)
+ + (byteToLong(bytes[offset + 3]) << 24));
+ }
+
+ /**
+ * Mix up the values in the hash function.
+ */
+ private void hashMix() {
+ a = subtract(a, b); a = subtract(a, c); a = xor(a, c >> 13);
+ b = subtract(b, c); b = subtract(b, a); b = xor(b, leftShift(a, 8));
+ c = subtract(c, a); c = subtract(c, b); c = xor(c, (b >> 13));
+ a = subtract(a, b); a = subtract(a, c); a = xor(a, (c >> 12));
+ b = subtract(b, c); b = subtract(b, a); b = xor(b, leftShift(a, 16));
+ c = subtract(c, a); c = subtract(c, b); c = xor(c, (b >> 5));
+ a = subtract(a, b); a = subtract(a, c); a = xor(a, (c >> 3));
+ b = subtract(b, c); b = subtract(b, a); b = xor(b, leftShift(a, 10));
+ c = subtract(c, a); c = subtract(c, b); c = xor(c, (b >> 15));
+ }
+
+ /**
+ * Hash a variable-length key into a 32-bit value. Every bit of the
+ * key affects every bit of the return value. Every 1-bit and 2-bit
+ * delta achieves avalanche. The best hash table sizes are powers of 2.
+ *
+ * @param buffer Byte array that we are hashing on.
+ * @param initialValue Initial value of the hash if we are continuing from
+ * a previous run. 0 if none.
+ * @return Hash value for the buffer.
+ */
+ public long hash(byte[] buffer, long initialValue) {
+ int len, pos;
+
+ // set up the internal state
+ // the golden ratio; an arbitrary value
+ a = 0x09e3779b9L;
+ // the golden ratio; an arbitrary value
+ b = 0x09e3779b9L;
+ // the previous hash value
+ c = initialValue;
+
+ // handle most of the key
+ pos = 0;
+ for (len = buffer.length; len >=12; len -= 12) {
+ a = add(a, fourByteToLong(buffer, pos));
+ b = add(b, fourByteToLong(buffer, pos + 4));
+ c = add(c, fourByteToLong(buffer, pos + 8));
+ hashMix();
+ pos += 12;
+ }
+
+ c += buffer.length;
+
+ // all the case statements fall through to the next on purpose
+ switch(len) {
+ case 11:
+ c = add(c, leftShift(byteToLong(buffer[pos + 10]), 24));
+ case 10:
+ c = add(c, leftShift(byteToLong(buffer[pos + 9]), 16));
+ case 9:
+ c = add(c, leftShift(byteToLong(buffer[pos + 8]), 8));
+ // the first byte of c is reserved for the length
+ case 8:
+ b = add(b, leftShift(byteToLong(buffer[pos + 7]), 24));
+ case 7:
+ b = add(b, leftShift(byteToLong(buffer[pos + 6]), 16));
+ case 6:
+ b = add(b, leftShift(byteToLong(buffer[pos + 5]), 8));
+ case 5:
+ b = add(b, byteToLong(buffer[pos + 4]));
+ case 4:
+ a = add(a, leftShift(byteToLong(buffer[pos + 3]), 24));
+ case 3:
+ a = add(a, leftShift(byteToLong(buffer[pos + 2]), 16));
+ case 2:
+ a = add(a, leftShift(byteToLong(buffer[pos + 1]), 8));
+ case 1:
+ a = add(a, byteToLong(buffer[pos + 0]));
+ // case 0: nothing left to add
+ }
+
+ hashMix();
+
+ return c;
+ }
+
+ /**
+ * See hash(byte[] buffer, long initialValue)
+ * @param buffer Byte array that we are hashing on.
+ * @return Hash value for the buffer.
+ */
+ public long hash(byte[] buffer) {
+ return hash(buffer, 0);
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Matcher.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Matcher.java
new file mode 100644
index 0000000..b0bba46
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/Matcher.java
@@ -0,0 +1,586 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.kohsuke.args4j.Option;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ipfix.IpfixCollector;
+import de.fhg.fokus.net.ipfix.api.IpfixCollectorListener;
+import de.fhg.fokus.net.ipfix.api.IpfixConnectionHandler;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixSet;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateRecord;
+import de.fhg.fokus.net.ipfix.util.HexDump;
+import de.fhg.fokus.net.packetmatcher.ctrl.Console;
+import de.fhg.fokus.net.packetmatcher.ctrl.Probe;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtProbeLocation;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtInterfaceStats;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtMin;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtProbeStats;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtSync;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtTsTtl;
+import de.fhg.fokus.net.packetmatcher.ipfix.IpfixReaderPtTsTtlIP;
+import de.fhg.fokus.net.packetmatcher.ipfix.PtMin;
+import de.fhg.fokus.net.packetmatcher.ipfix.PtSync;
+import de.fhg.fokus.net.packetmatcher.ipfix.PtTsTtl;
+import de.fhg.fokus.net.packetmatcher.ipfix.PtTsTtlIP;
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+import de.fhg.fokus.net.ptapi.PtInterfaceStats;
+import de.fhg.fokus.net.ptapi.PtProbeLocation;
+import de.fhg.fokus.net.ptapi.PtProbeStats;
+
+/**
+ * Packet Matcher
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public class Matcher {
+ // -- constants --
+ public static final String VERSION = "v.2010-11";
+ // -- config --
+
+ @Option(name="-exportHost",usage="host to send packet records to (localhost)")
+ private String exportHost = "localhost";
+
+ @Option(name="-exportPort", usage="export port (40123)")
+ private int exportPort = 40123;
+
+ @Option(name="-exportReconnectInterval",usage="export reconnect interval in second (7)")
+ private int exportReconnectTimeSeconds = 7;
+
+ @Option(name="-consolePort", usage="console port (4000)")
+ private int consolePort = 4000;
+
+ @Option(name="-listenPort", usage="IPFIX listen port (4739)")
+ private int listenPort = 4739;
+
+ @Option(name="-ttlcheck", usage="perform ttl checks by matching (no)")
+ private boolean ttlcheck = false;
+
+ @Option(name="-verbose", usage="verbose log output (no)")
+ private boolean verbose = false;
+
+ @Option(name="-csv", usage="export data to csv files (no)")
+ private boolean fileExportEnableCsv = false;
+
+ @Option(name="-obj", usage="export data to java obj files (no)")
+ private boolean fileExportEnableObj = false;
+
+ @Option(name="-exportFolder", usage="export Folder (matcher_data)")
+ private String fileExportFolder = "matcher_data";
+
+ // -- sys --
+ private static final Logger logger = LoggerFactory.getLogger(Matcher.class);
+ private static final ScheduledExecutorService scheduler = Executors
+ .newScheduledThreadPool(2);
+ // -- model --
+ private final IpfixCollector ipfixCollector = new IpfixCollector();
+ private int matchingTimeoutMillis = 5000;
+ private int matchingPeriodMillis = 5000;
+
+
+ // TODO add support for stopping/starting export task
+ private ExportTask exportTask;
+ private PacketIdMatcher packetIdMatcher;
+
+ private int initialQueueSize = 20000;
+
+ private final FileExporter fileExporter = new FileExporter();
+
+ private interface RecordHandler {
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec);
+ }
+
+ private Map<Class<?>, RecordHandler> recordHandlerMap = new HashMap<Class<?>, Matcher.RecordHandler>();
+
+ // -- probe sync --
+ private Console consoleSync;
+
+
+ private Thread shutdownHook= new Thread ( "ShutdownHook"){
+ @Override
+ public void run() {
+ fileExporter.stop();
+ shutdown();
+
+ logger.info("bye");
+ }
+ };
+ public Matcher() {
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
+ }
+
+ public void shutdown(){
+ logger.info("shutting down..");
+ if(consoleSync!=null){
+ consoleSync.shutdown();
+ }
+ scheduler.shutdown();
+ try {
+ if(exportTask!=null){
+ exportTask.close();
+ }
+ } catch (IOException e) {
+ logger.debug(e.getMessage());
+ }
+ }
+ /**
+ * Depending on the record received various actions are taken. These actions
+ * are implemented via callbacks defined in this function. Dispatching
+ * callbacks is done via recordHandlerMap.
+ */
+ private void setupRecordHandlers() {
+
+ // Probe location
+ recordHandlerMap.put(PtProbeLocation.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtProbeLocation r = (PtProbeLocation) rec;
+ /*logger.debug("-------------------------------------------------");
+ logger.debug("Observation Time: " + r.getObservationTimeMilliseconds());
+ logger.debug("Source IPv4: " + r.getSourceIpv4Address());
+ logger.debug("Latitude: " + r.getLatitude());
+ logger.debug("Longitude: " + r.getLongitude());
+ logger.debug("Probe Name: " + r.getProbeName());
+ logger.debug("Probe Location Name: " + r.getProbeLocationName());
+ logger.debug("-------------------------------------------------");*/
+ if (probe != null) {
+ probe.setLocation(r.getLatitude(),r.getLongitude());
+ }
+ if (!exportTask.putProbeRecord(r)) {
+ logger.warn("export queue not ready, dropping record: {}",
+ rec);
+ }
+ }
+ });
+
+ // Pktid records
+ // - create PacketIdRecord and
+ // - forward it to matcher
+ recordHandlerMap.put(PtMin.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtMin r = (PtMin) rec;
+ if (probe != null) {
+ probe.incPktIdRecords();
+ }
+ // TODO add support to packet size
+ PacketIdRecord pir = new PacketIdRecord((int) r
+ .getDigestHashValue(), r
+ .getObservationTimeMicroseconds().longValue(),
+ (int) msg.getObservationDomainID(), 0, r.getIpTTL());
+ packetIdMatcher.addPacketIdRecord(pir);
+
+ }
+ });
+ // Pktid records
+ // - create PacketIdRecord with IP-Addresses and Ports and
+ // - forward it to matcher
+ recordHandlerMap.put(PtTsTtl.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtTsTtl r = (PtTsTtl) rec;
+ if (probe != null) {
+ probe.incPktIdRecords();
+ }
+ PacketIdRecord pir = new PacketIdRecord((int) r
+ .getDigestHashValue(), r
+ .getObservationTimeMicroseconds().longValue(),
+ (int) msg.getObservationDomainID(), r.getTotalLengthIPv4(), r.getIpTTL());
+ pir.setVersion((byte)r.getIpVersion());
+ pir.setProtocol(r.getProtocolIdentifier());
+ packetIdMatcher.addPacketIdRecord(pir);
+ }
+ });
+ recordHandlerMap.put(PtTsTtlIP.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtTsTtlIP r = (PtTsTtlIP) rec;
+ if (probe != null) {
+ probe.incPktIdRecords();
+ }
+ // TODO add support to packet size
+ PacketIdRecord pir = new PacketIdRecord((int) r
+ .getDigestHashValue(), r
+ .getObservationTimeMicroseconds().longValue(),
+ (int) msg.getObservationDomainID(), r.getTotalLengthIPv4(), r.getIpTTL(),
+ r.sourceAddress, r.sourcePort, r.destinationAddress, r.destinationPort);
+ pir.setVersion((byte)r.getIpVersion());
+ pir.setProtocol(r.getProtocolIdentifier());
+ packetIdMatcher.addPacketIdRecord(pir);
+ }
+ });
+ // Probe statistics
+ // - forward to output queue
+ recordHandlerMap.put(PtProbeStats.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtProbeStats r = (PtProbeStats) rec;
+ if (probe != null) {
+ probe.incProbeStatsRecords();
+ probe.setLastProbeStatsRecord(r);
+ }
+
+ if (!exportTask.putProbeRecord(r)) {
+ logger.warn("export queue not ready, dropping record: {}",
+ rec);
+ }
+ }
+ });
+ // Sampling statistics
+ // - forward to output queue
+ recordHandlerMap.put(PtInterfaceStats.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ PtInterfaceStats r = (PtInterfaceStats) rec;
+ if (probe != null) {
+ probe.setLastInterfaceStatsRecord(r);
+ }
+ if (!exportTask.putProbeRecord(r)) {
+ logger.warn("export queue not ready, dropping record: {}",
+ rec);
+ }
+ }
+ });
+ // Template records
+ // - add to statistics
+ recordHandlerMap.put(IpfixTemplateRecord.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ if (probe != null) {
+ probe.incTemplateRecords();
+ }
+ }
+ });
+
+ // PTSync responses
+ //
+ recordHandlerMap.put(PtSync.class, new RecordHandler() {
+ @Override
+ public void onRecord(IpfixMessage msg, Probe probe, Object rec) {
+ consoleSync.receive(probe, (PtSync) rec);
+ if (probe != null) {
+ probe.incSyncResponseRecords();
+ }
+ }
+ });
+
+ }
+
+ private void init() throws UnknownHostException, IOException {
+ BlockingQueue<SortedSet<PacketIdRecord>> queue = new ArrayBlockingQueue<SortedSet<PacketIdRecord>>(
+ initialQueueSize);
+
+ packetIdMatcher = new PacketIdMatcher(matchingTimeoutMillis,
+ matchingPeriodMillis, queue);
+ exportTask = new ExportTask(this.fileExporter, queue, InetAddress.getByName(exportHost),
+ exportPort, packetIdMatcher.getPktIdMap());
+
+ }
+
+ public int getInitialQueueSize() {
+ return initialQueueSize;
+ }
+
+ /**
+ * @param initialQueueSize
+ * initial size of internal queue used for matching packets.
+ */
+ public Matcher setInitialQueueSize(int initialQueueSize) {
+ this.initialQueueSize = initialQueueSize;
+ return this;
+ }
+ public void startFileExporter(){
+ if(fileExportEnableCsv||fileExportEnableObj){
+ fileExporter.setEnableCsv(fileExportEnableCsv);
+ fileExporter.setEnableObj(fileExportEnableObj);
+ fileExporter.start(new File(fileExportFolder));
+ }
+ }
+ public FileExporter getFileExporter() {
+ return fileExporter;
+ }
+
+ public void stopFileExporter(){
+ fileExporter.stop();
+ }
+ /**
+ * start matcher
+ *
+ * @return
+ * @throws IOException
+ */
+ public Matcher start() throws IOException {
+ init();
+ startFileExporter();
+ System.out.println(toString());
+
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtMin());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtProbeStats());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtInterfaceStats());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtTsTtl());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtSync());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtProbeLocation());
+ ipfixCollector.registerDataRecordReader(new IpfixReaderPtTsTtlIP());
+
+ logger.debug("adding EventListener ... ");
+
+ ipfixCollector.addEventListener(new IpfixCollectorListener() {
+
+ @Override
+ public void onMessage(IpfixConnectionHandler handler,
+ IpfixMessage msg) {
+ try {
+ logger.debug(msg+"");
+ if (msg == null) {
+ logger.warn("Strange, msg is null, this might be a bug in the IPFIX collector");
+ return;
+ }
+ Probe probe = (Probe) handler.getAttachment();
+ if (probe == null) { // this should never happen
+ logger.warn("onMessage dispatched before onConnect, you may lose some probe statistics");
+ }
+ // reading records and dispatching dispatching record handlers
+ for (IpfixSet set : msg) {
+ for (Object rec : set) {
+ RecordHandler recordHandler = recordHandlerMap.get(rec
+ .getClass());
+ if (recordHandler != null) {
+ if( verbose ){
+ logger.debug("No record handler for: {}", rec);
+ }
+ // This might have been set in the respective data record reader,
+ // let's assure it here anyway
+ if (rec instanceof ProbeRecord) {
+ ProbeRecord prec = (ProbeRecord) rec;
+ prec.setOid(msg.getObservationDomainID());
+ prec.setExportTime(msg.getExportTime());
+ fileExporter.putReceivedRecord(prec);
+ }
+ recordHandler.onRecord(msg, probe, rec);
+ } else {
+ logger.warn("unknown record received:{}, {}", rec
+ .getClass().getSimpleName(), rec);
+ }
+ }
+ }
+ if (probe != null) {
+ probe.incUnknownSets(msg.getNumberOfunknownSets());
+ }
+ } catch (Exception e) {
+ logger.debug(e.getMessage());
+ logger.debug(HexDump.toHexString(msg.getMessageBuffer()));
+// try {
+// handler.getSocket().close();
+// } catch (IOException e1) {
+// e1.printStackTrace();
+// }
+
+ }
+
+ }
+
+ @Override
+ public void onConnect(IpfixConnectionHandler handler) {
+ logger.debug("handler: {}", handler.hashCode());
+ Probe probe;
+ try {
+ probe = new Probe(handler);
+ } catch (IOException e) {
+ logger.warn(
+ "Could not initialize probe, dropping connection: {}",
+ handler.getSocket().getRemoteSocketAddress());
+ logger.debug(e.getMessage());
+ try {
+ handler.getSocket().close();
+ } catch (IOException e1) {
+ logger.debug(e.getMessage());
+ }
+ return;
+ }
+ handler.setAttachment(probe);
+ consoleSync.addProbe(probe);
+ logger.debug("Exporter CONNECTED from {} ", handler.getSocket()
+ .getRemoteSocketAddress());
+ }
+
+ @Override
+ public void onDisconnect(IpfixConnectionHandler handler) {
+ Probe probe = (Probe) handler.getAttachment();
+ if (probe != null) {
+ consoleSync.removeProbe(probe);
+
+ } else {
+ logger.warn("strange, attachment should not be null.");
+ }
+
+ logger.debug("Exporter DISCONNECTED from {}", handler
+ .getSocket().getRemoteSocketAddress());
+ }
+ });
+ // Debug timer
+ if( verbose ){
+ scheduler.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+ if(consoleSync!=null){
+ for( Probe probe: consoleSync.getProbeList()){
+ if(probe!=null){
+ logger.debug("PROBE_DETAILED_STATS: {}",probe.getStats().replaceAll("\\s+|\n", " "));
+ logger.debug("MATCHER_STATS: {}",toString().replaceAll("\\s+|\n", " ") );
+ }
+ }
+ }
+ }
+ } , 0,
+ 10, TimeUnit.SECONDS);
+ }
+
+ // Reconnect timer
+ scheduler.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+ Socket client = exportTask.getClient();
+ if (client == null || !client.isConnected()) {
+ try {
+ exportTask.start();
+ } catch (IOException e) {
+ logger.error("ExportTask: could not connect to: {}",
+ exportTask.getRemoteSocketAddr());
+ }
+ }
+ }
+ }, 0, exportReconnectTimeSeconds, TimeUnit.SECONDS);
+ ipfixCollector.bind(listenPort);
+ return this;
+ }
+
+ public int getMatchingTimeoutMillis() {
+ return matchingTimeoutMillis;
+ }
+
+ public Matcher setMatchingTimeoutMillis(int matchingTimeoutMillis) {
+ this.matchingTimeoutMillis = matchingTimeoutMillis;
+ return this;
+ }
+
+ public int getMatchingPeriodMillis() {
+ return matchingPeriodMillis;
+ }
+
+ public Matcher setMatchingPeriodMillis(int matchingPeriodMillis) {
+ this.matchingPeriodMillis = matchingPeriodMillis;
+ return this;
+ }
+
+ public int getExportPort() {
+ return exportPort;
+ }
+
+ /**
+ * @param exportPort
+ * port GUI is listening to
+ * @return
+ */
+ public Matcher setExportPort(int exportPort) {
+ this.exportPort = exportPort;
+ return this;
+ }
+
+ public String getExportHost() {
+ return exportHost;
+ }
+
+ /**
+ * @param exportHost
+ * host where GUI is running
+ */
+ public Matcher setExportHost(String exportHost) {
+ this.exportHost = exportHost;
+ return this;
+ }
+
+ public IpfixCollector getIpfixCollector() {
+ return ipfixCollector;
+ }
+
+ public ExportTask getExportTask() {
+ return exportTask;
+ }
+
+ public void setExportTask(ExportTask exportTask) {
+ this.exportTask = exportTask;
+ }
+ @Override
+ public String toString() {
+ String exportTaskStr = "ExportTask:{\"not available\"}";
+ if(exportTask!=null){
+ exportTaskStr = exportTask.toString();
+ }
+ return String.format(
+ "Matcher { export: \"%s:%d\", console:\"localhost:%d\" \n" +
+ " ttlcheck: %s, verbose: %s, \n" +
+ " %s \n" +
+ " %s \n" +
+ "} ",
+ exportHost, exportPort, consolePort,
+ ttlcheck , verbose ,exportTaskStr, fileExporter.toString() );
+ }
+ // used by args4j
+ public void run(){
+ System.out.println("starting Packet Matcher, logging to matcher_debug.log");
+ logger.info("=== Matcher ===");
+ try {
+ this.consoleSync = new Console(this,consolePort);
+ setupRecordHandlers();
+ this.consoleSync.start();
+ start();
+ // FIXME review
+ if(ttlcheck){
+ exportTask.setTtlcheck(ttlcheck);
+ }
+
+
+ } catch (IOException e) {
+ logger.debug(e.getMessage());
+ }
+ }
+ // -- main --
+ public static void main(String[] args) throws IOException {
+ logger.info("== Packet Matcher ==");
+ new Matcher().run();
+
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/MatchingTask.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/MatchingTask.java
new file mode 100644
index 0000000..cc90872
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/MatchingTask.java
@@ -0,0 +1,48 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.util.SortedSet;
+import java.util.TimerTask;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentSkipListSet;
+
+public class MatchingTask extends TimerTask {
+ ConcurrentSkipListSet<PacketIdRecord> pktidRecords;
+ private final BlockingQueue<SortedSet<PacketIdRecord>> queue;
+
+ public MatchingTask(ConcurrentSkipListSet<PacketIdRecord> pktidRecords, BlockingQueue<SortedSet<PacketIdRecord>> queue) {
+ this.pktidRecords = pktidRecords;
+ this.queue = queue;
+ }
+
+ @Override
+ public void run() {
+ try {
+ // System.out.println("TimeOut: recordSize = " + pktidRecords.size());
+ if (pktidRecords.size() > 1) {
+ queue.put(pktidRecords);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+};
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIDSetComparator.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIDSetComparator.java
new file mode 100644
index 0000000..c35c5c3
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIDSetComparator.java
@@ -0,0 +1,33 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.util.Comparator;
+import java.util.SortedSet;
+
+public class PacketIDSetComparator implements Comparator<SortedSet<PacketIdRecord>> {
+
+ @Override
+ public int compare(SortedSet<PacketIdRecord> o1,
+ SortedSet<PacketIdRecord> o2) {
+ if (o1.first().getTimeStamp() < o1.first().getTimeStamp()) return -1;
+ if (o1.first().getTimeStamp() > o1.first().getTimeStamp()) return 1;
+ return -1;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdMatcher.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdMatcher.java
new file mode 100644
index 0000000..b107609
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdMatcher.java
@@ -0,0 +1,94 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.Timer;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListSet;
+
+
+public class PacketIdMatcher {
+ private final Map<Integer, ConcurrentSkipListSet<PacketIdRecord>> pktIdMap = new ConcurrentHashMap<Integer, ConcurrentSkipListSet<PacketIdRecord>>();
+ private static final long serialVersionUID = -5308076544397098015L;
+ private long timeout;
+ private BlockingQueue<SortedSet<PacketIdRecord>> exportqueue;
+ private final Timer timer = new Timer();
+
+ public PacketIdMatcher() {
+ }
+
+ public PacketIdMatcher(int matching_timeout_ms, int matching_period, BlockingQueue<SortedSet<PacketIdRecord>> queue) {
+ this.timeout = matching_timeout_ms;
+ this.exportqueue = queue;
+ }
+
+ public void addPacketIdRecord(PacketIdRecord pir) {
+ ConcurrentSkipListSet<PacketIdRecord> tmpSet = pktIdMap.get(pir.getPacketID());
+
+ if (tmpSet == null) {
+ ConcurrentSkipListSet<PacketIdRecord> newSet = new ConcurrentSkipListSet<PacketIdRecord>( new PacketIdRecordComparator());
+ newSet.add(pir);
+ pktIdMap.put(pir.getPacketID(), newSet);
+ timer.schedule(new MatchingTask(newSet, exportqueue), timeout);
+ } else {
+ tmpSet.add(pir);
+ }
+ }
+
+// public synchronized void evalMatchingPacketSets(long now) {
+// // System.out.println("time: " + (long) now);
+// for (SortedSet<PacketIdRecord> set : pktIdMap.values()) {
+// if (set.size() <= 1 )
+// continue;
+//
+// // TODO check for gaps and (possibly) "move" only a subset of records in this set into the vector v
+// // export found set in the vector
+//
+// if (set.first().getTimeStamp()> now + this.timeout ) {
+// PacketTrackRecord record = new PacketTrackRecord(set.size());
+// int i=0;
+// for (PacketIdRecord pir : set) {
+// record.probeIds[i] = pir.getProbeID();
+// record.ts[i] = pir.getTimeStamp();
+// i++;
+// }
+//
+// }
+//
+// // delete the set from the hashmap (this)
+// pktIdMap.remove(set.first().getPacketID());
+//
+// }
+//
+// }
+
+ public long getTimeout() {
+ return timeout;
+ }
+
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+ public Map<Integer, ConcurrentSkipListSet<PacketIdRecord>> getPktIdMap() {
+ return pktIdMap;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecord.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecord.java
new file mode 100644
index 0000000..d534634
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecord.java
@@ -0,0 +1,156 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+import java.net.Inet4Address;
+
+
+public class PacketIdRecord {
+
+ private int packetID = 0;
+ private long timeStamp = 0;
+ private int probeID = 0;
+ private int packetSize = 0;
+ private int ttl = 0;
+ private byte version = 0;
+ private int protocol = 0;
+ private Inet4Address sourceAddress;
+ private int sourcePort = 0;
+ private Inet4Address destinationAddress;
+ private int destinationPort = 0;
+
+ public PacketIdRecord() {
+
+ }
+
+ public PacketIdRecord(int packetID, long timeStamp, int probeID,
+ int packetSize, int ttl) {
+ this.packetID = packetID;
+ this.timeStamp = timeStamp;
+ this.probeID = probeID;
+ this.packetSize = packetSize;
+ this.ttl = ttl;
+ }
+
+ public PacketIdRecord(int packetID, long timeStamp, int probeID,
+ int packetSize, int ttl, Inet4Address sourceAddress, int sourcePort,
+ Inet4Address destinationAddress, int destinationPort) {
+ this.packetID = packetID;
+ this.timeStamp = timeStamp;
+ this.probeID = probeID;
+ this.packetSize = packetSize;
+ this.ttl = ttl;
+ this.sourceAddress = sourceAddress;
+ this.sourcePort = sourcePort;
+ this.destinationAddress = destinationAddress;
+ this.destinationPort = destinationPort;
+ }
+
+
+ public int getPacketSize() {
+ return packetSize;
+ }
+
+ public int getTtl() {
+ return ttl;
+ }
+
+ public byte getVersion() {
+ return version;
+ }
+
+ public int getProtocol() {
+ return protocol;
+ }
+
+ public void setPacketSize(int packetSize) {
+ this.packetSize = packetSize;
+ }
+
+ public void setTtl(int ttl) {
+ this.ttl = ttl;
+ }
+
+ public void setVersion(byte version) {
+ this.version = version;
+ }
+
+ public void setProtocol(int protocol) {
+ this.protocol = protocol;
+ }
+
+ public int getPacketID() {
+ return packetID;
+ }
+
+ public long getTimeStamp() {
+ return timeStamp;
+ }
+
+ public int getProbeID() {
+ return probeID;
+ }
+
+ public void setPacketID(int packetID) {
+ this.packetID = packetID;
+ }
+
+ public void setTimeStamp(long timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+
+ public void setProbeID(int probeID) {
+ this.probeID = probeID;
+ }
+
+ public Inet4Address getSourceAddress() {
+ return sourceAddress;
+ }
+
+ public void setSourceAddress(Inet4Address sourceAddress) {
+ this.sourceAddress = sourceAddress;
+ }
+
+ public int getSourcePort() {
+ return sourcePort;
+ }
+
+ public void setSourcePort(int sourcePort) {
+ this.sourcePort = sourcePort;
+ }
+
+ public Inet4Address getDestinationAddress() {
+ return destinationAddress;
+ }
+
+ public void setDestinationAddress(Inet4Address destinationAddress) {
+ this.destinationAddress = destinationAddress;
+ }
+
+ public int getDestinationPort() {
+ return destinationPort;
+ }
+
+ public void setDestinationPort(int destinationPort) {
+ this.destinationPort = destinationPort;
+ }
+
+ public String toString() {
+ return "packetID: " + String.valueOf(packetID) + " sourceID " + String.valueOf(probeID) + " timestamp:" + timeStamp;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecordComparator.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecordComparator.java
new file mode 100644
index 0000000..ca94ef0
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/PacketIdRecordComparator.java
@@ -0,0 +1,50 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher;
+
+import java.util.Comparator;
+
+public class PacketIdRecordComparator implements Comparator<PacketIdRecord> {
+
+ public int compare(PacketIdRecord arg0, PacketIdRecord arg1) {
+ /* if TTL is present then we do compare by TTL - else by timestamp */
+ if (arg0.getTtl() != 0 ) {
+ if (arg0.getTtl() < arg1.getTtl())
+ return 1;
+ if (arg0.getTtl() > arg1.getTtl())
+ return -1;
+ if (arg0.getTtl() == arg1.getTtl()) {
+ if (arg0.getTimeStamp() < arg1.getTimeStamp())
+ return -1;
+ if (arg0.getTimeStamp() > arg1.getTimeStamp())
+ return 1;
+ if (arg0.getTimeStamp() == arg1.getTimeStamp())
+ return 1;
+ }
+ }
+ else {
+ if (arg0.getTimeStamp() < arg1.getTimeStamp())
+ return -1;
+ if (arg0.getTimeStamp() == arg1.getTimeStamp())
+ return 1;
+ if (arg0.getTimeStamp() > arg1.getTimeStamp())
+ return 1;
+ }
+ return -1;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Console.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Console.java
new file mode 100644
index 0000000..4fd18aa
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Console.java
@@ -0,0 +1,412 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ctrl;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.packetmatcher.Matcher;
+import de.fhg.fokus.net.packetmatcher.ipfix.PtSync;
+
+/**
+ * Handles synchronization of configuration parameters of connected probes.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class Console {
+ // -- constants --
+ private static final String WELCOME_MSG = "===== PT Matcher "+Matcher.VERSION+" ===== \n";
+ private static final String PROMPT = "sync> ";
+ private static final String CMD_OK = "ok";
+ private static final String CMD_SENT = "cmd_sent";
+ private static final String CMD_FAILED = "failed";
+ private static final String BYE_MSG = "bye";
+ private static final String HELP =
+ "h,? this help\n" +
+ "c clear terminal \n" +
+ "f show file exporter status \n" +
+ "f 0|1 file exporter on(1) or off(0) \n"+
+ "m matcher statistics \n" +
+ "l,p,p* list connected probes\n" +
+ "p<nr> shows statistics for probe nr \n" +
+ "p<nr> x close probe connection \n" +
+ " -r <sampling rate> set sampling rate\n"+
+ "x exit console\n" ;
+
+ // -- sys --
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+ private final ExecutorService executor = Executors.newCachedThreadPool();
+ private static final AtomicLong messageIdCounter = new AtomicLong(1);
+ // -- model --
+ private final Matcher matcher;
+ private final int port;
+ private boolean exit = false;
+ private final ServerSocket serverSocket;
+ private final List<Probe> probeList = new CopyOnWriteArrayList<Probe>();
+ public List<Probe> getProbeList() {
+ return probeList;
+ }
+ private final List<Connection> connList = new CopyOnWriteArrayList<Console.Connection>();
+ private final Map<Long, Connection> requestMap = new ConcurrentHashMap<Long, Console.Connection>();
+ // models a command received via console
+ private interface CmdHandler {
+ // note that arg[0] will contain the command itself, so you'll
+ // need to look for arg[1] for the first argument
+ String execute(Connection conn, String[] args) throws IOException;
+ }
+ private final Map<String, CmdHandler> cmdMap = new HashMap<String, Console.CmdHandler>();
+
+ private String executeCommand(Connection conn, String cmd) throws IOException {
+ if( cmd.length()==0 ){
+ return "";
+ }
+ // logger.debug("cmd: {}",HexDump.toHexString(cmd.getBytes()));
+ // map ^L to clear
+ if(cmd.length()==1 && cmd.getBytes("ascii")[0]==0x0c){
+ cmd = "c";
+ }
+ String args[] = cmd.split("[\\s]+");
+ if(args!=null&& args.length > 0){
+ CmdHandler cmdHandler = cmdMap.get(args[0]);
+ if( cmdHandler!=null){
+ return cmdHandler.execute(conn, args);
+ }
+ }
+ if(cmd.startsWith("p")){
+ return "probe not found: "+cmd;
+ }
+
+ return CMD_FAILED;
+ }
+ /**
+ * Handles console connection
+ *
+ */
+ private final class Connection {
+ private final Socket socket;
+ private final String remoteName; // used for reporting
+ private BufferedWriter out;
+ private BufferedReader in;
+
+ public Connection(Socket socket) {
+ this.socket = socket;
+ this.remoteName = socket.getRemoteSocketAddress().toString();
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ in = new BufferedReader(
+ new InputStreamReader(Connection.this.socket
+ .getInputStream(), "ascii"));
+ out = new BufferedWriter(
+ new OutputStreamWriter(Connection.this.socket
+ .getOutputStream(), "ascii"));
+ out.write(WELCOME_MSG);
+ out.write("# use h for help\n");
+ while (true) {
+ out.write(PROMPT);
+ out.flush();
+ String input = in.readLine();
+ if (input == null) {
+ break;
+ }
+ String res = executeCommand(Connection.this, input);
+ if( res.length()==0){
+ continue;
+ }
+ out.write(res + "\n");
+ out.flush();
+ }
+ close();
+ } catch (IOException e) {
+ logger.error(e.getMessage());
+ }
+ }
+ });
+
+ }
+
+ public void close() throws IOException {
+ logger.debug("Closing {}", remoteName);
+ socket.close();
+ }
+ }
+
+ public Console(Matcher matcher, int port) throws IOException {
+ this.matcher = matcher;
+ this.port = port;
+ this.serverSocket = new ServerSocket(this.port);
+ setupCommands();
+ }
+ private void setupCommands(){
+ // == SETUP COMMANDS ==
+ // --------------------------------------------------------------------
+ // CONSOLE: clear (depends on the terminal used)
+ // --------------------------------------------------------------------
+ cmdMap.put("c", new CmdHandler() {
+ @Override
+ public String execute(Connection conn, String [] args) throws IOException {
+ conn.out.write("\033[H\033[2J");
+ return "";
+ }
+ });
+ // --------------------------------------------------------------------
+ // FILE EXPORTER: show stats, turn on/off
+ // --------------------------------------------------------------------
+ cmdMap.put ("f", new CmdHandler(){
+ @Override
+ public String execute(Connection conn, String[] args)
+ throws IOException {
+ if(args.length > 1 ){
+ if("1".contentEquals(args[1])&& matcher.getFileExporter().isStopped() ){
+ matcher.getFileExporter().setEnableCsv(true);
+ matcher.getFileExporter().setEnableObj(true);
+ matcher.getFileExporter().start();
+ }
+ if("0".contentEquals(args[1])&& !matcher.getFileExporter().isStopped() ){
+ matcher.getFileExporter().stop();
+ }
+ }
+ conn.out.write(matcher.getFileExporter().toString());
+ conn.out.write("\n");
+
+ return "";
+ }
+ });
+ // --------------------------------------------------------------------
+ // MATCHER: show statistics
+ // --------------------------------------------------------------------
+ cmdMap.put ("m", new CmdHandler(){
+ @Override
+ public String execute(Connection conn, String[] args)
+ throws IOException {
+ String matcherStr = matcher.toString();
+ conn.out.write(matcher.toString());
+ conn.out.write("\n");
+ logger.debug(matcherStr.replaceAll("\\s+|\n", " "));
+ return "";
+ }
+ });
+ // --------------------------------------------------------------------
+ // PROBES: list connected
+ // --------------------------------------------------------------------
+ CmdHandler listProbes = new CmdHandler() {
+ @Override
+ public String execute(Connection conn, String [] args) throws IOException {
+ if(probeList.size()==0){
+ return ("no probe connected");
+ }
+ int i=0;
+ StringBuffer sbuf = new StringBuffer();
+ for(Probe probe: probeList ){
+ sbuf.append(++i+". ");
+ sbuf.append(probe.toString());
+ sbuf.append("\n");
+ }
+ logger.debug("PROBE_LIST: {} ",sbuf.toString().trim());
+ conn.out.write(sbuf.toString());
+ return "";
+ }
+ };
+ cmdMap.put("p",listProbes);
+ cmdMap.put("l",listProbes);
+ // --------------------------------------------------------------------
+ // ALL PROBES: send command
+ // --------------------------------------------------------------------
+ cmdMap.put( "p*", new CmdHandler(){
+ @Override
+ public String execute(Connection conn, String[] args)
+ throws IOException {
+ if(probeList.size()==0){
+ return ("no probe connected");
+ }
+ int i=0;
+ if( args.length==1){
+ StringBuffer sbuf = new StringBuffer();
+ for(Probe probe: probeList ){
+ sbuf.append(++i+". ");
+ sbuf.append(probe.toString());
+ sbuf.append("\n");
+ }
+ logger.debug("PROBE_LIST: {}",sbuf.toString().trim());
+ conn.out.write(sbuf.toString());
+ return "";
+ }
+ for(Probe probe: probeList ){
+ String cmd = prepareCmdToSend(conn, args);
+ conn.out.write(String.format("send( %s , \"%s\" )\n",probe.getConsoleId(), cmd));
+ probe.sendCmd(cmd);
+ }
+ return "";
+ }
+ });
+ // --------------------------------------------------------------------
+ // HELP: show
+ // --------------------------------------------------------------------
+ CmdHandler help = new CmdHandler() {
+ @Override
+ public String execute(Connection conn, String [] args) throws IOException {
+ conn.out.write(WELCOME_MSG);
+ conn.out.write(HELP);
+ return "";
+ }
+ };
+ cmdMap.put("h",help);
+ cmdMap.put("?",help);
+
+ // --------------------------------------------------------------------
+ // CONSOLE: exit
+ // --------------------------------------------------------------------
+ cmdMap.put("x", new CmdHandler() {
+ @Override
+ public String execute(Connection conn, String [] args) {
+ try {
+ conn.out.write(BYE_MSG+"\n");
+ conn.out.flush();
+ conn.close();
+ } catch (IOException e) {
+ // ignoring
+ }
+ return CMD_OK;
+ }
+ });
+ }
+
+ public void start() {
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ logger.debug("starting probe sync: {}", serverSocket);
+ while (!exit) {
+ try {
+ connList.add(new Connection(serverSocket.accept()));
+ } catch (IOException e) {
+ logger.error(e.getMessage());
+
+ }
+ }
+ }
+ });
+ }
+ public void receive( Probe probe, PtSync syncResp ){
+ if(syncResp==null){
+ logger.error("strange, sync response is null.");
+ return;
+ }
+ logger.debug("PROBE_RESPONSE: probe: {}, response: {}",probe.getConsoleId(), syncResp);
+ Connection conn = requestMap.remove(syncResp.getMessageId());
+ if(conn!=null && conn.socket.isConnected() && probe!=null ){
+ try {
+ conn.out.write("\n# sync response: ");
+ conn.out.write(probe.getConsoleId()+" ");
+ conn.out.write(syncResp+"");
+ conn.out.flush();
+ } catch (IOException e) {
+ logger.error(e.getMessage());
+ }
+ } else {
+ logger.error("error while receiving probe response");
+ }
+ }
+ public void addProbe( final Probe probe ){
+ // adding custom command for probe
+ cmdMap.put(probe.getConsoleId(),
+ new CmdHandler() {
+ @Override
+ public String execute(Connection conn, String[] args) throws IOException {
+ if(args.length==0){
+ logger.warn("Strange, this should never happen. Probably a bug.");
+ return CMD_FAILED;
+ }
+ if(args.length==1){
+ conn.out.write(probe.getStats());
+ conn.out.write("\n");
+ logger.debug(probe.getStats().replaceAll("\\s+|\n", " "));
+ return "";
+ }
+ if(args[1].contentEquals("x")){
+ logger.debug("console requested closing {}",conn.socket.getRemoteSocketAddress());
+ conn.out.write("dropping "+probe.toString()+"\n");
+ removeProbe(probe);
+ probe.getIpfixConnectionHandler().getSocket().close();
+ return "";
+ } else {
+ // send command directly to probe
+ if( probe.sendCmd(prepareCmdToSend(conn, args))){
+ return CMD_SENT;
+ }
+ }
+ return CMD_FAILED;
+ }
+ });
+ probeList.add(probe);
+
+ }
+ public void removeProbe( Probe probe ){
+ cmdMap.remove(probe.getConsoleId());
+ probeList.remove(probe);
+ }
+ /**
+ * Prepare command to send to probe
+ * @param args
+ * @return
+ */
+ public String prepareCmdToSend( Connection conn, String []args ){
+ long messageId = messageIdCounter.getAndIncrement();
+ requestMap.put(messageId, conn); // storing request so we can forward response to the right connection
+ StringBuilder sb = new StringBuilder();
+ sb.append("mid: ");
+ sb.append(messageId);
+ sb.append(" ");
+ for( int i=1;i<args.length;i++){
+ sb.append(args[i]);
+ sb.append(" ");
+ }
+ return sb.toString();
+ }
+ public void shutdown() {
+ logger.info("shutting down console sync");
+ exit = true;
+ try {
+ for (Connection conn : connList) {
+ conn.close();
+ }
+ } catch (Exception e) {
+ logger.debug(e.getMessage());
+ }
+ executor.shutdown();
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Probe.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Probe.java
new file mode 100644
index 0000000..81d2281
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ctrl/Probe.java
@@ -0,0 +1,345 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ctrl;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ipfix.api.IpfixConnectionHandler;
+import de.fhg.fokus.net.ptapi.PtInterfaceStats;
+import de.fhg.fokus.net.ptapi.PtProbeStats;
+
+/**
+ * Models a probe
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class Probe {
+ // -- constants --
+ /**
+ * Probe connection will be dropped in case of too many unknown sets.
+ * In this case template records have not been send or could not be decoded.
+ */
+ private static final short MAX_NUMBER_OF_UNKNOWN_SETS = 20;
+ private final static String NOT_AVAILABLE = "\"not available\"";
+
+ // -- sys --
+ private final static AtomicInteger atomicConsoleId = new AtomicInteger(1);
+ private final static Logger logger = LoggerFactory.getLogger(Probe.class);
+ // -- model --
+ private final IpfixConnectionHandler ipfixConnectionHandler;
+ private final BufferedWriter cmdOut;
+ // -- model.stats --
+ private final int sessionId;
+ private long probeStatsRecords =0;
+ private long samplingStatsRecords = 0;
+ private long pktIdRecords = 0;
+ private long templateRecords = 0;
+ private long syncResponseRecords = 0;
+ private long numberOfUnknownSets = 0;
+ private String latitude = "";
+ private String longitude = "";
+ private long maxNumberOfUnknownSets = MAX_NUMBER_OF_UNKNOWN_SETS;
+ private final long connectedTs;
+ private PtProbeStats lastProbeStatsRecord;
+ private Map<String, PtInterfaceStats> interfaceStatsMaps = new ConcurrentHashMap<String, PtInterfaceStats>();
+ public IpfixConnectionHandler getIpfixConnectionHandler() {
+ return ipfixConnectionHandler;
+ }
+
+ public PtProbeStats getLastProbeStatsRecord() {
+ return lastProbeStatsRecord;
+ }
+ public void setLocation(String latitude, String longitude){
+ this.latitude = latitude;
+ this.longitude = longitude;
+ }
+ public void setLastProbeStatsRecord(PtProbeStats lastProbeStatsRecord) {
+ this.lastProbeStatsRecord = lastProbeStatsRecord;
+ }
+ public void setLastInterfaceStatsRecord(PtInterfaceStats lastSamplingStatsRecord) {
+ if( lastSamplingStatsRecord!=null){
+ interfaceStatsMaps.put(lastSamplingStatsRecord.getInterfaceName(), lastSamplingStatsRecord);
+ }
+ }
+ public void incUnknownSets( short unknownsets ){
+ this.numberOfUnknownSets+= unknownsets;
+ if(numberOfUnknownSets>maxNumberOfUnknownSets){
+ try {
+ logger.warn("Too many unknown sets from probe received ({}), dropping {}",
+ numberOfUnknownSets,
+ ipfixConnectionHandler.getSocket().getRemoteSocketAddress());
+ ipfixConnectionHandler.getSocket().close();
+ } catch (IOException e) {
+ logger.debug(e.getMessage());
+ }
+ }
+ }
+ /**
+ * Attained Selection Fraction
+ */
+ public Probe(IpfixConnectionHandler handler) throws IOException {
+ this.ipfixConnectionHandler = handler;
+ this.connectedTs = System.currentTimeMillis();
+ this.sessionId = atomicConsoleId.getAndAdd(1);
+ this.cmdOut = new BufferedWriter(new OutputStreamWriter(ipfixConnectionHandler.getSocket().getOutputStream(),"ascii"));
+ }
+ public String formatLatitude(String latitude){
+ try{
+ double lat = Double.parseDouble(latitude);
+ char direction = 'N';
+ int degree = (int) lat;
+ double decimal;
+ int minutes;
+ int seconds;
+ if (degree < 0){
+ degree = degree*-1;
+ direction = 'S';
+ decimal = (lat + degree)*-1;
+ minutes = (int)(decimal*60);
+ seconds = (int)((decimal*60-minutes)*60);
+ }
+ else{
+ decimal = lat - degree;
+ minutes = (int)(decimal*60);
+ seconds = (int)((decimal*60+minutes)*60);
+ }
+ return degree + "d " + minutes + "m " + seconds + "s " + direction;
+ }
+ catch(NumberFormatException e){
+ return "No Location received!";
+ }
+ }
+
+ public String formatLongitude(String longitude){
+ try{
+ double lon = Double.parseDouble(longitude);
+ char direction = 'E';
+ int degree = (int) lon;
+ double decimal;
+ int minutes;
+ int seconds;
+ if (degree < 0){
+ degree = degree*-1;
+ direction = 'W';
+ decimal = (lon + degree)*-1;
+ minutes = (int)(decimal*60);
+ seconds = (int)((decimal*60-minutes)*60);
+ }
+ else{
+ decimal = lon - degree;
+ minutes = (int)(decimal*60);
+ seconds = (int)((decimal*60+minutes)*60);
+ }
+
+ return degree + "d " + minutes + "m " + seconds + "s " + direction;
+ }
+ catch(NumberFormatException e){
+ return "No Location received!";
+ }
+ }
+
+ @Override
+ public String toString() {
+ long secs = (System.currentTimeMillis() - connectedTs)/1000;
+ String lat = formatLatitude(latitude);
+ String lon = formatLongitude(longitude);
+ return String.format(Locale.ENGLISH,"p%d:{ from:\"%s\", pktids:%d, conn: \"%d s\", msgs: %d, lat: %s, long: %s } ",
+ sessionId,ipfixConnectionHandler.getSocket().getRemoteSocketAddress(),
+ pktIdRecords, secs,ipfixConnectionHandler.totalReceivedMessages(), lat, lon);
+ }
+
+ private String getProbeStats(){
+ if(lastProbeStatsRecord==null){
+ return NOT_AVAILABLE;
+ }
+ return String.format(Locale.ENGLISH,
+ "{ oid: %d, observationTimeMilliseconds: %d, \n" +
+ " systemCpuIdle: %f, systemMemFree: %d, \n" +
+ " processCpuUser: %f, processCpuSys: %f,\n" +
+ " processMemVzs: %d, processMemRss: %d \n"+"" +
+ "}",
+ lastProbeStatsRecord.oid, lastProbeStatsRecord.observationTimeMilliseconds,
+ lastProbeStatsRecord.systemCpuIdle, lastProbeStatsRecord.systemMemFree, lastProbeStatsRecord.processCpuUser,
+ lastProbeStatsRecord.processCpuSys, lastProbeStatsRecord.processMemVzs, lastProbeStatsRecord.processMemRss );
+
+ }
+
+ private String getInterfaceStats(PtInterfaceStats ifstats){
+ if(ifstats==null){
+ return NOT_AVAILABLE;
+ }
+ double asf = -1.0;
+ double delta = ifstats.getPacketDeltaCount().doubleValue();
+ if( delta > 0){
+ asf = ifstats.getSamplingSize() / delta;
+ }
+ return String.format(Locale.ENGLISH,
+ "{oid: %d, observationTimeMilliseconds: %d,\n" +
+ " samplingSize: %d, packetDeltaCount: %s\n " +
+ " pcapStatDrop: %d, pcapStatRecv: %d,\n" +
+ " interfaceName: \"%s\", iterfaceDescription: \"%s\", \n" +
+ " asf: %.2f \n" +
+ "},",
+ ifstats.oid,
+ ifstats.observationTimeMilliseconds,
+ ifstats.samplingSize,
+ ifstats.packetDeltaCount.toString(),
+ ifstats.pcapStatDrop,
+ ifstats.pcapStatRecv,
+ ifstats.interfaceName,
+ ifstats.interfaceDescription,
+ asf);
+ }
+ public String getStats(){
+ long secs = (System.currentTimeMillis() - connectedTs)/1000;
+ StringBuffer sbuf = new StringBuffer();
+ for (Entry<String, PtInterfaceStats> e : interfaceStatsMaps.entrySet()) {
+ sbuf.append(e.getKey());
+ sbuf.append(":");
+ sbuf.append(getInterfaceStats(e.getValue()));
+ sbuf.append("\n");
+ }
+
+ return String.format(Locale.ENGLISH,
+ "p%d:{ \n" +
+ " remote: \"%s\", connTimeSecs: %d,\n" +
+ " recs: { tmpl:%d, pktid:%d, probeStat:%d, samplingStat:%d } \n"+
+ " unknownSets: %d, \n"+
+ " probeStats: %s \n" +
+ " interfaceStats: \n" +
+ "%s\n" +
+ "}",
+ sessionId,
+ ipfixConnectionHandler.getSocket().getRemoteSocketAddress(),
+ secs,
+ templateRecords,
+ pktIdRecords,probeStatsRecords,samplingStatsRecords,
+ numberOfUnknownSets,
+ getProbeStats(), sbuf.toString()
+ );
+ }
+ public String getConsoleId() {
+ return "p"+sessionId;
+ }
+ public void incSamplingStatsRecords() {
+ samplingStatsRecords++;
+
+ }
+ public void incProbeStatsRecords(){
+ probeStatsRecords++;
+ }
+ public void incSyncResponseRecords(){
+ syncResponseRecords++;
+ }
+ public void incPktIdRecords() {
+ pktIdRecords++;
+ }
+ public void incTemplateRecords() {
+ templateRecords++;
+ }
+ public void setSamplingRate( double rate ){
+ sendCmd(String.format(Locale.ENGLISH,"-r %f\n", rate));
+ }
+ /**
+ * Send command to a probe
+ * @param cmd
+ * @return true in case of success
+ */
+ public boolean sendCmd( String cmd ){
+ try {
+ cmdOut.write(cmd);
+ cmdOut.write("\n");
+ cmdOut.flush();
+ return true;
+ } catch (IOException e) {
+ logger.error("could not send cmd:\"{}\" due to:",cmd,e.getMessage());
+ return false;
+ }
+
+ }
+
+ public long getProbeStatsRecords() {
+ return probeStatsRecords;
+ }
+
+ public void setProbeStatsRecords(long probeStatsRecords) {
+ this.probeStatsRecords = probeStatsRecords;
+ }
+
+ public long getSamplingStatsRecords() {
+ return samplingStatsRecords;
+ }
+
+ public void setSamplingStatsRecords(long samplingStatsRecords) {
+ this.samplingStatsRecords = samplingStatsRecords;
+ }
+
+ public long getPktIdRecords() {
+ return pktIdRecords;
+ }
+
+ public void setPktIdRecords(long pktIdRecords) {
+ this.pktIdRecords = pktIdRecords;
+ }
+
+ public long getTemplateRecords() {
+ return templateRecords;
+ }
+
+ public void setTemplateRecords(long templateRecords) {
+ this.templateRecords = templateRecords;
+ }
+
+ public long getSyncResponseRecords() {
+ return syncResponseRecords;
+ }
+
+ public void setSyncResponseRecords(long syncResponseRecords) {
+ this.syncResponseRecords = syncResponseRecords;
+ }
+
+ public long getNumberOfUnknownSets() {
+ return numberOfUnknownSets;
+ }
+
+ public void setNumberOfUnknownSets(long numberOfUnknownSets) {
+ this.numberOfUnknownSets = numberOfUnknownSets;
+ }
+
+ public int getSessionId() {
+ return sessionId;
+ }
+
+ public long getConnectedTs() {
+ return connectedTs;
+ }
+
+
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtInterfaceStats.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtInterfaceStats.java
new file mode 100644
index 0000000..ac68860
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtInterfaceStats.java
@@ -0,0 +1,96 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.io.UnsupportedEncodingException;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMilliseconds;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIePacketDeltaCount;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeSamplingSize;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtInterfaceDescription;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtInterfaceName;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtPcapStatDrop;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtPcapStatRecv;
+import de.fhg.fokus.net.ptapi.PtInterfaceStats;
+
+/**
+ * Minimal IPFIX record for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtInterfaceStats implements IpfixDataRecordReader {
+ private static final Logger logger = LoggerFactory.getLogger(IpfixReaderPtInterfaceStats.class);
+ private static final String DECODE_ERROR_STRING = "";
+
+ private final IpfixIeObservationTimeMilliseconds ie1 = new IpfixIeObservationTimeMilliseconds(8);
+ private final IpfixIeSamplingSize ie2 = new IpfixIeSamplingSize(4);
+ private final IpfixIePacketDeltaCount ie3 = new IpfixIePacketDeltaCount(8);
+ private final IpfixIePtPcapStatRecv ie4 = new IpfixIePtPcapStatRecv(4);
+ private final IpfixIePtPcapStatDrop ie5 = new IpfixIePtPcapStatDrop(4);
+ private final IpfixIePtInterfaceName ie6 = new IpfixIePtInterfaceName(IpfixIe.VARIABLE_LENGTH);
+ private final IpfixIePtInterfaceDescription ie7 = new IpfixIePtInterfaceDescription(IpfixIe.VARIABLE_LENGTH);
+
+
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3, ie4, ie5, ie6, ie7);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ long ie1_d = ie1.getBigInteger(setBuffer).longValue();
+ long ie2_d = ie2.getLong(setBuffer);
+ BigInteger ie3_d = ie3.getBigInteger(setBuffer);
+ long ie4_d = ie4.getLong(setBuffer);
+ long ie5_d = ie5.getLong(setBuffer);
+
+ String ie6_d = DECODE_ERROR_STRING;
+ String ie7_d = DECODE_ERROR_STRING;
+ try {
+ ie6_d=ie6.getString(setBuffer);
+ ie7_d=ie7.getString(setBuffer);
+ } catch (UnsupportedEncodingException e) {
+ logger.debug(e.getMessage());
+ }
+ return new PtInterfaceStats(
+ msg.getObservationDomainID(),
+ ie1_d, ie2_d, ie3_d, ie4_d, ie5_d, ie6_d, ie7_d
+ );
+ }
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+ public String toString() {
+ return "PtSampling";
+ };
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtMin.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtMin.java
new file mode 100644
index 0000000..a596c6e
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtMin.java
@@ -0,0 +1,63 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.nio.ByteBuffer;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeDigestHashValue;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeIpTTL;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMicroseconds;
+
+/**
+ * Minimal IPFIX record reader for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtMin implements IpfixDataRecordReader {
+ private final IpfixIeObservationTimeMicroseconds ie1 = new IpfixIeObservationTimeMicroseconds(
+ 8);
+ private final IpfixIeDigestHashValue ie2 = new IpfixIeDigestHashValue(4);
+ private final IpfixIeIpTTL ie3 = new IpfixIeIpTTL(1);
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ return new PtMin(msg.getObservationDomainID(),
+ ie1.getBigInteger(setBuffer), ie2.getLong(setBuffer),
+ ie3.getShort(setBuffer));
+ }
+
+ public String toString() {
+ return "PtMinimal";
+
+ };
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeLocation.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeLocation.java
new file mode 100644
index 0000000..e514666
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeLocation.java
@@ -0,0 +1,119 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+
+import java.math.BigInteger;
+
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeLatitude;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeLongitude;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMilliseconds;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeProbeLocationName;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeProbeName;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeSourceIPv4Address;
+import de.fhg.fokus.net.ptapi.PtProbeLocation;
+import java.net.Inet4Address;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+
+/**
+ * @author FhG-FOKUS NETwork Research
+ */
+public final class IpfixReaderPtProbeLocation implements IpfixDataRecordReader{
+
+ private final IpfixIeObservationTimeMilliseconds ie1 = new IpfixIeObservationTimeMilliseconds(
+ 8);
+ private final IpfixIeSourceIPv4Address ie2 = new IpfixIeSourceIPv4Address(4);
+ private final IpfixIeLatitude ie3 = new IpfixIeLatitude(IpfixIe.VARIABLE_LENGTH);
+ private final IpfixIeLongitude ie4 = new IpfixIeLongitude(IpfixIe.VARIABLE_LENGTH);
+ private final IpfixIeProbeName ie5 = new IpfixIeProbeName(IpfixIe.VARIABLE_LENGTH);
+ private final IpfixIeProbeLocationName ie6 = new IpfixIeProbeLocationName(IpfixIe.VARIABLE_LENGTH);
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1,ie2,ie3, ie4,ie5, ie6);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+
+ // Observation Time Milliseconds
+ long observationTimeMilliseconds = ie1.getBigInteger(setBuffer).longValue();
+
+ // Source Ipv4 Address
+ Inet4Address ipv4SourceAddess = ie2.getAddress(setBuffer);
+
+ // Latitude
+ String latitude = "undefined";
+ try {
+ latitude = ie3.getString(setBuffer);
+ } catch (UnsupportedEncodingException ex) {
+ Logger.getLogger(IpfixReaderPtProbeLocation.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ // Longitude
+ String longitude = "undefined";
+ try {
+ longitude = ie4.getString(setBuffer);
+ } catch (UnsupportedEncodingException ex) {
+ Logger.getLogger(IpfixReaderPtProbeLocation.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ // Probe Name
+ String probeName = "undefined";
+ try {
+ probeName = ie5.getString(setBuffer);
+ } catch (UnsupportedEncodingException ex) {
+ Logger.getLogger(IpfixReaderPtProbeLocation.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ // Probe Location Name
+ String probeLocationName = "undefined";
+ try {
+ probeLocationName = ie6.getString(setBuffer);
+ } catch (UnsupportedEncodingException ex) {
+ Logger.getLogger(IpfixReaderPtProbeLocation.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return new PtProbeLocation(msg.getObservationDomainID(),
+ observationTimeMilliseconds,
+ ipv4SourceAddess,
+ latitude,
+ longitude,
+ probeName,
+ probeLocationName
+ );
+ }
+
+ @Override
+ public String toString() {
+ return "PtLocation";
+
+ };
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeStats.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeStats.java
new file mode 100644
index 0000000..9c13bed
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtProbeStats.java
@@ -0,0 +1,78 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.nio.ByteBuffer;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMilliseconds;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtProcessCpuSys;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtProcessCpuUser;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtProcessMemRss;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtProcessMemVzs;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtSystemCpuIdle;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtSystemMemFree;
+import de.fhg.fokus.net.ptapi.PtProbeStats;
+
+/**
+ * IPFIX record reader for packet tracking minimal templates .
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtProbeStats implements IpfixDataRecordReader {
+ private final IpfixIeObservationTimeMilliseconds ie1 = new IpfixIeObservationTimeMilliseconds(8);
+ private final IpfixIePtSystemCpuIdle ie2 = new IpfixIePtSystemCpuIdle(4);
+ private final IpfixIePtSystemMemFree ie3 = new IpfixIePtSystemMemFree(8);
+ private final IpfixIePtProcessCpuUser ie4 = new IpfixIePtProcessCpuUser(4);
+ private final IpfixIePtProcessCpuSys ie5 = new IpfixIePtProcessCpuSys(4);
+ private final IpfixIePtProcessMemVzs ie6 = new IpfixIePtProcessMemVzs(8);
+ private final IpfixIePtProcessMemRss ie7 = new IpfixIePtProcessMemRss(8);
+
+
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3, ie4, ie5, ie6, ie7);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ return new PtProbeStats(msg.getObservationDomainID(),
+ ie1.getBigInteger(setBuffer).longValue(),
+ ie2.getFloat(setBuffer),
+ ie3.getBigInteger(setBuffer),
+ ie4.getFloat(setBuffer),
+ ie5.getFloat(setBuffer),
+ ie6.getBigInteger(setBuffer),
+ ie7.getBigInteger(setBuffer)
+ );
+ }
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName();
+ };
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtSync.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtSync.java
new file mode 100644
index 0000000..06e1f9f
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtSync.java
@@ -0,0 +1,80 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMilliseconds;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtMessage;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtMessageId;
+import de.fhg.fokus.net.packetmatcher.ipfix.ie.IpfixIePtMessageValue;
+
+/**
+ * Minimal IPFIX record reader for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtSync implements IpfixDataRecordReader {
+ private final static Logger logger = LoggerFactory
+ .getLogger(IpfixReaderPtSync.class);
+ private final IpfixIeObservationTimeMilliseconds ie1 = new IpfixIeObservationTimeMilliseconds(
+ 8);
+ private final IpfixIePtMessageId ie2 = new IpfixIePtMessageId(4);
+ private final IpfixIePtMessageValue ie3 = new IpfixIePtMessageValue(4);
+ private final IpfixIePtMessage ie4 = new IpfixIePtMessage();
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3, ie4);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ long ie1_d = ie1.getBigInteger(setBuffer).longValue();
+ long ie2_d = ie2.getLong(setBuffer);
+ long ie3_d = ie3.getLong(setBuffer);
+
+ String ie4_d = "";
+ try {
+ ie4_d = ie4.getString(setBuffer, "ascii");
+ } catch (UnsupportedEncodingException e) {
+ logger.error(e.getMessage());
+ }
+ return new PtSync(msg.getObservationDomainID(), ie1_d, ie2_d, ie3_d,
+ ie4_d);
+ }
+
+ public String toString() {
+ return "PtSync";
+
+ };
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtl.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtl.java
new file mode 100644
index 0000000..f9ceb49
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtl.java
@@ -0,0 +1,71 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.nio.ByteBuffer;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeDigestHashValue;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeIpTTL;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeIpVersion;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMicroseconds;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeProtocolIdentifier;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeTotalLengthIPv4;
+
+/**
+ * Minimal IPFIX record for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtTsTtl implements IpfixDataRecordReader {
+ private final IpfixIeObservationTimeMicroseconds ie1 = new IpfixIeObservationTimeMicroseconds(
+ 8);
+ private final IpfixIeDigestHashValue ie2 = new IpfixIeDigestHashValue(4);
+ private final IpfixIeIpTTL ie3 = new IpfixIeIpTTL(1);
+ private final IpfixIeTotalLengthIPv4 ie4 = new IpfixIeTotalLengthIPv4(2);
+ private final IpfixIeProtocolIdentifier ie5 = new IpfixIeProtocolIdentifier(
+ 1);
+ private final IpfixIeIpVersion ie6 = new IpfixIeIpVersion(1);
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3, ie4, ie5, ie6);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ return new PtTsTtl(ie1.getBigInteger(setBuffer),
+ ie2.getLong(setBuffer), ie3.getShort(setBuffer),
+ ie4.getInt(setBuffer), ie5.getShort(setBuffer),
+ ie6.getShort(setBuffer));
+ }
+
+ public String toString() {
+ return "PtTsTtl";
+
+ };
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtlIP.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtlIP.java
new file mode 100644
index 0000000..7a0937d
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/IpfixReaderPtTsTtlIP.java
@@ -0,0 +1,88 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.nio.ByteBuffer;
+
+import de.fhg.fokus.net.ipfix.api.IpfixDataRecordReader;
+import de.fhg.fokus.net.ipfix.api.IpfixMessage;
+import de.fhg.fokus.net.ipfix.api.IpfixTemplateForDataReader;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeDigestHashValue;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeIpTTL;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeIpVersion;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeObservationTimeMicroseconds;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeProtocolIdentifier;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeTotalLengthIPv4;
+
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeSourceIPv4Address;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeSourceTransportPort;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeDestinationIPv4Address;
+import de.fhg.fokus.net.ipfix.model.ie.IpfixIeDestinationTransportPort;
+
+import java.net.Inet4Address;
+
+/**
+ * Minimal IPFIX record for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class IpfixReaderPtTsTtlIP implements IpfixDataRecordReader {
+ private final IpfixIeObservationTimeMicroseconds ie1 = new IpfixIeObservationTimeMicroseconds(
+ 8);
+ private final IpfixIeDigestHashValue ie2 = new IpfixIeDigestHashValue(4);
+ private final IpfixIeIpTTL ie3 = new IpfixIeIpTTL(1);
+ private final IpfixIeTotalLengthIPv4 ie4 = new IpfixIeTotalLengthIPv4(2);
+ private final IpfixIeProtocolIdentifier ie5 = new IpfixIeProtocolIdentifier(
+ 1);
+ private final IpfixIeIpVersion ie6 = new IpfixIeIpVersion(1);
+ private final IpfixIeSourceIPv4Address ie7 = new IpfixIeSourceIPv4Address(4);
+ private final IpfixIeSourceTransportPort ie8 = new IpfixIeSourceTransportPort(2);
+ private final IpfixIeDestinationIPv4Address ie9 = new IpfixIeDestinationIPv4Address(4);
+ private final IpfixIeDestinationTransportPort ie10 = new IpfixIeDestinationTransportPort(2);
+
+ private final IpfixTemplateForDataReader template = new IpfixTemplateForDataReader(
+ ie1, ie2, ie3, ie4, ie5, ie6, ie7, ie8, ie9, ie10);
+
+ @Override
+ public Object getRecord(IpfixMessage msg, ByteBuffer setBuffer) {
+ if (!setBuffer.hasRemaining()) {
+ return null;
+ }
+ return new PtTsTtlIP(ie1.getBigInteger(setBuffer),
+ ie2.getLong(setBuffer), ie3.getShort(setBuffer),
+ ie4.getInt(setBuffer), ie5.getShort(setBuffer),
+ ie6.getShort(setBuffer),
+ ie7.getAddress(setBuffer),
+ ie8.getInt(setBuffer),
+ ie9.getAddress(setBuffer),
+ ie10.getInt(setBuffer)
+ );
+ }
+
+ public String toString() {
+ return "PtTsTtl";
+
+ };
+
+ @Override
+ public IpfixTemplateForDataReader getTemplate() {
+ return template;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtMin.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtMin.java
new file mode 100644
index 0000000..0c62576
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtMin.java
@@ -0,0 +1,99 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.math.BigInteger;
+
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+
+/**
+ * Minimal record for packet tracking.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class PtMin implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id
+ */
+ public long oid;
+ public long exportTime;
+ private BigInteger observationTimeMicroseconds;
+ private final long digestHashValue;
+ private final short ipTTL;
+
+ public PtMin(long oid, BigInteger observationTimeMicroseconds,
+ long digestHashValue, short ipTTL) {
+ this.oid = oid;
+ this.observationTimeMicroseconds = observationTimeMicroseconds;
+ this.digestHashValue = digestHashValue;
+ this.ipTTL = ipTTL;
+ }
+ public BigInteger getObservationTimeMicroseconds() {
+ return observationTimeMicroseconds;
+ }
+ public long getDigestHashValue() {
+ return digestHashValue;
+ }
+ public short getIpTTL() {
+ return ipTTL;
+ }
+ @Override
+ public String toString() {
+ return String.format("{oid: %d, observationTimeMicroseconds:%s, digestHashValue:%d, ipTTL:%d }",
+ oid, observationTimeMicroseconds.toString(), digestHashValue, ipTTL);
+ }
+ @Override
+ public String csvData() {
+ return String.format("%d, %s, %d, %d",
+ oid, observationTimeMicroseconds.toString(), digestHashValue, ipTTL);
+ }
+ private static final String CSV_FIELDS="oid, observationTimeMicroseconds, digestHashValue, ipTTL ";
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+ @Override
+ public long getOid() {
+ return oid;
+ }
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+ private static BigInteger N1000 = BigInteger.valueOf(1000);
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMicroseconds.divide(N1000).longValue();
+ }
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime=exportTime;
+ }
+ @Override
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMicroseconds= BigInteger.valueOf(observationTimeMilliseconds).multiply(N1000);
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtSync.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtSync.java
new file mode 100644
index 0000000..fec988f
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtSync.java
@@ -0,0 +1,131 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.util.Locale;
+
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+
+/**
+ * Synchronization responses
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+
+public class PtSync implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id. Note that if you are using ipfix4java as transport
+ * you'll currently need to get this value from the ipfix message;
+ */
+ private long oid;
+ private long exportTime;
+
+ /**
+ * The time the record was created. Its encoded according to
+ * dateTimeMilliseconds(RFC5101). The data type dateTimeMilliseconds
+ * represents a time value in units of milliseconds normalized to the GMT
+ * timezone. It contains the number of milliseconds since 0000 UTC Jan 1,
+ * 1970.
+ */
+ private long observationTimeMilliseconds;
+ /**
+ * Message id
+ */
+ private final long messageId;
+
+ private final long messageValue;
+ private final String message;
+
+ public PtSync(long oid, long observationTimeMilliseconds, long messageId,
+ long messageValue, String message) {
+ super();
+ this.oid = oid;
+ this.messageId = messageId;
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ this.messageValue = messageValue;
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return String.format(Locale.ENGLISH,
+ "{ oid: %d, observationTimeMilliseconds: %d, "
+ + "messageId: %d, messageValue: %d, message: \"%s\" }",
+ oid, observationTimeMilliseconds, messageId, messageValue,
+ message);
+ }
+
+ public long getOid() {
+ return oid;
+ }
+
+ public long getMessageId() {
+ return messageId;
+ }
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMilliseconds;
+ }
+
+ public long getValue() {
+ return messageValue;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String csvData() {
+ String msg = message == null ? "" : message.replaceAll(",", "_");
+ return String.format(Locale.ENGLISH, "%d, %d, %d, %d, %s", oid,
+ observationTimeMilliseconds, messageId, messageValue, msg);
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMilliseconds, messageId, "
+ + "messageValue, message";
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ @Override
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtl.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtl.java
new file mode 100644
index 0000000..c512e7e
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtl.java
@@ -0,0 +1,139 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.math.BigInteger;
+
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+
+/**
+ * Ts TTL record for packet tracking. Used by packet matcher.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class PtTsTtl implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id
+ */
+ public long oid;
+ private long exportTime;
+ private BigInteger observationTimeMicroseconds;
+ private final long digestHashValue;
+ private final short ipTTL;
+ private final int totalLengthIPv4;
+ private final short protocolIdentifier;
+ private final short ipVersion;
+
+ public PtTsTtl(BigInteger observationTimeMicroseconds,
+ long digestHashValue, short ipTTL, int totalLengthIPv4,
+ short protocolIdentifier, short ipVersion) {
+ this.observationTimeMicroseconds = observationTimeMicroseconds;
+ this.digestHashValue = digestHashValue;
+ this.ipTTL = ipTTL;
+ this.totalLengthIPv4 = totalLengthIPv4;
+ this.protocolIdentifier = protocolIdentifier;
+ this.ipVersion = ipVersion;
+ }
+
+ public int getTotalLengthIPv4() {
+ return totalLengthIPv4;
+ }
+
+ public short getProtocolIdentifier() {
+ return protocolIdentifier;
+ }
+
+ public short getIpVersion() {
+ return ipVersion;
+ }
+
+ public BigInteger getObservationTimeMicroseconds() {
+ return observationTimeMicroseconds;
+ }
+
+ public long getDigestHashValue() {
+ return digestHashValue;
+ }
+
+ public short getIpTTL() {
+ return ipTTL;
+ }
+
+ @Override
+ public String toString() {
+ return String
+ .format("{oid: %d, exportTime: %d, observationTimeMicroseconds:%s, digestHashValue:%d, ipTTL:%d, "
+ + "totalLengthIPv4: %d, protocolIdentifier: %d, IpVersion %d }",
+ oid, exportTime,
+ observationTimeMicroseconds.toString(),
+ digestHashValue, ipTTL, totalLengthIPv4,
+ protocolIdentifier, ipVersion);
+ }
+
+ @Override
+ public String csvData() {
+ return String.format("%d, %d, %s, %d, %d, %d, %d, %d", oid, exportTime,
+ observationTimeMicroseconds.toString(), digestHashValue, ipTTL,
+ totalLengthIPv4, protocolIdentifier, ipVersion);
+
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMicroseconds, "
+ + "digestHashValue, ipTTL, totalLengthIPv4, protocolIdentifier, IpVersion";
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+ @Override
+ public long getOid() {
+ return oid;
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+
+ private static final BigInteger N1000 = BigInteger.valueOf(1000);
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMicroseconds.divide(N1000).longValue();
+ }
+
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ @Override
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMicroseconds = BigInteger.valueOf(
+ observationTimeMilliseconds).multiply(N1000);
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtlIP.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtlIP.java
new file mode 100644
index 0000000..7281b24
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/PtTsTtlIP.java
@@ -0,0 +1,174 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix;
+
+import java.math.BigInteger;
+
+import de.fhg.fokus.net.ptapi.ProbeRecord;
+
+import java.net.Inet4Address;
+
+/**
+ * Ts TTL record for packet tracking. Used by packet matcher.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public final class PtTsTtlIP implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id
+ */
+ public long oid;
+ private long exportTime;
+ private BigInteger observationTimeMicroseconds;
+ private final long digestHashValue;
+ private final short ipTTL;
+ private final int totalLengthIPv4;
+ private final short protocolIdentifier;
+ private final short ipVersion;
+ public final Inet4Address sourceAddress;
+ public final int sourcePort;
+ public final Inet4Address destinationAddress;
+ public final int destinationPort;
+
+ public PtTsTtlIP(BigInteger observationTimeMicroseconds,
+ long digestHashValue, short ipTTL, int totalLengthIPv4,
+ short protocolIdentifier, short ipVersion,
+ Inet4Address sourceAddress,
+ int sourcePort,
+ Inet4Address destinationAddress,
+ int destinationPort) {
+
+ this.observationTimeMicroseconds = observationTimeMicroseconds;
+ this.digestHashValue = digestHashValue;
+ this.ipTTL = ipTTL;
+ this.totalLengthIPv4 = totalLengthIPv4;
+ this.protocolIdentifier = protocolIdentifier;
+ this.ipVersion = ipVersion;
+
+ this.sourceAddress = sourceAddress;
+ this.sourcePort = sourcePort;
+ this.destinationAddress = destinationAddress;
+ this.destinationPort = destinationPort;
+ }
+
+ public int getTotalLengthIPv4() {
+ return totalLengthIPv4;
+ }
+
+ public short getProtocolIdentifier() {
+ return protocolIdentifier;
+ }
+
+ public short getIpVersion() {
+ return ipVersion;
+ }
+
+ public BigInteger getObservationTimeMicroseconds() {
+ return observationTimeMicroseconds;
+ }
+
+ public long getDigestHashValue() {
+ return digestHashValue;
+ }
+
+ public short getIpTTL() {
+ return ipTTL;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("{oid: %d, exportTime: %d, observationTimeMicroseconds: %d, digestHashValue:%d, ipTTL:%d, "
+ + "totalLengthIPv4: %d, protocolIdentifier: %d, IpVersion %d " +
+ " sourceAddress: %d, sourcePort: %d, destinationAddress: %d, destinationPort: %d}",
+ oid, exportTime,
+ observationTimeMicroseconds,
+ digestHashValue, ipTTL, totalLengthIPv4,
+ protocolIdentifier, ipVersion,
+ sourceAddress, sourcePort, destinationAddress, destinationPort);
+ }
+
+ @Override
+ public String csvData() {
+ return String.format("%d, %d, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d", oid, exportTime,
+ observationTimeMicroseconds, digestHashValue, ipTTL,
+ totalLengthIPv4, protocolIdentifier, ipVersion, sourceAddress, sourcePort,
+ destinationAddress, destinationPort);
+
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMicroseconds, "
+ + "digestHashValue, ipTTL, totalLengthIPv4, protocolIdentifier, IpVersion" +
+ " ,sourceAddress, sourcePort, destinationAddress, destinationPort";
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+ @Override
+ public long getOid() {
+ return oid;
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+
+ private static final BigInteger N1000 = BigInteger.valueOf(1000);
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMicroseconds.divide(N1000).longValue();
+ }
+
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ @Override
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMicroseconds = BigInteger.valueOf(
+ observationTimeMilliseconds).multiply(N1000);
+ }
+
+ public Inet4Address getDestinationAddress() {
+ return this.destinationAddress;
+ }
+
+ public int getDestinationPort() {
+ return this.destinationPort;
+ }
+
+ public Inet4Address getSourceAddress() {
+ return this.sourceAddress;
+ }
+
+ public int getSourcePort() {
+ return this.sourcePort;
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceDescription.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceDescription.java
new file mode 100644
index 0000000..e629c42
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceDescription.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecString;
+
+
+
+/**
+ * <pre>
+PtInterfaceDescription:{
+ elementId:352,
+ dataType:string,
+ dataTypeSemantis:default,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtInterfaceDescription extends IpfixIeCodecString implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtInterfaceDescription() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(352)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtInterfaceDescription( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(352)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtInterfaceDescription( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(352)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.DEFAULT;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtInterfaceDescription";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceName.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceName.java
new file mode 100644
index 0000000..f36a364
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtInterfaceName.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecString;
+
+
+
+/**
+ * <pre>
+PtInterfaceName:{
+ elementId:351,
+ dataType:string,
+ dataTypeSemantis:default,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtInterfaceName extends IpfixIeCodecString implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtInterfaceName() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(351)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtInterfaceName( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(351)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtInterfaceName( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(351)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.DEFAULT;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtInterfaceName";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessage.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessage.java
new file mode 100644
index 0000000..2552591
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessage.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecOctetArray;
+
+
+
+/**
+ * <pre>
+PtMessage:{
+ elementId:350,
+ dataType:octetArray,
+ dataTypeSemantis:default,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtMessage extends IpfixIeCodecOctetArray implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtMessage() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(350)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessage( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(350)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessage( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(350)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.DEFAULT;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtMessage";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageId.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageId.java
new file mode 100644
index 0000000..e6a2387
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageId.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned32;
+
+
+
+/**
+ * <pre>
+PtMessageId:{
+ elementId:348,
+ dataType:unsigned32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtMessageId extends IpfixIeCodecUnsigned32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtMessageId() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(348)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessageId( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(348)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessageId( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(348)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtMessageId";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageValue.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageValue.java
new file mode 100644
index 0000000..dd000a8
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtMessageValue.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned32;
+
+
+
+/**
+ * <pre>
+PtMessageValue:{
+ elementId:349,
+ dataType:unsigned32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtMessageValue extends IpfixIeCodecUnsigned32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtMessageValue() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(349)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessageValue( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(349)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtMessageValue( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(349)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtMessageValue";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatDrop.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatDrop.java
new file mode 100644
index 0000000..5800e16
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatDrop.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned32;
+
+
+
+/**
+ * <pre>
+PtPcapStatDrop:{
+ elementId:347,
+ dataType:unsigned32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtPcapStatDrop extends IpfixIeCodecUnsigned32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtPcapStatDrop() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(347)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtPcapStatDrop( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(347)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtPcapStatDrop( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(347)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtPcapStatDrop";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatRecv.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatRecv.java
new file mode 100644
index 0000000..01442d9
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtPcapStatRecv.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned32;
+
+
+
+/**
+ * <pre>
+PtPcapStatRecv:{
+ elementId:346,
+ dataType:unsigned32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtPcapStatRecv extends IpfixIeCodecUnsigned32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtPcapStatRecv() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(346)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtPcapStatRecv( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(346)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtPcapStatRecv( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(346)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtPcapStatRecv";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuSys.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuSys.java
new file mode 100644
index 0000000..93457dc
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuSys.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecFloat32;
+
+
+
+/**
+ * <pre>
+PtProcessCpuSys:{
+ elementId:343,
+ dataType:float32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtProcessCpuSys extends IpfixIeCodecFloat32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtProcessCpuSys() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(343)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessCpuSys( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(343)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessCpuSys( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(343)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtProcessCpuSys";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuUser.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuUser.java
new file mode 100644
index 0000000..d02acaa
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessCpuUser.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecFloat32;
+
+
+
+/**
+ * <pre>
+PtProcessCpuUser:{
+ elementId:342,
+ dataType:float32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtProcessCpuUser extends IpfixIeCodecFloat32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtProcessCpuUser() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(342)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessCpuUser( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(342)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessCpuUser( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(342)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtProcessCpuUser";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemRss.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemRss.java
new file mode 100644
index 0000000..9a57872
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemRss.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned64;
+
+
+
+/**
+ * <pre>
+PtProcessMemRss:{
+ elementId:345,
+ dataType:unsigned64,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtProcessMemRss extends IpfixIeCodecUnsigned64 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtProcessMemRss() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(345)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessMemRss( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(345)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessMemRss( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(345)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtProcessMemRss";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemVzs.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemVzs.java
new file mode 100644
index 0000000..244f698
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtProcessMemVzs.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned64;
+
+
+
+/**
+ * <pre>
+PtProcessMemVzs:{
+ elementId:344,
+ dataType:unsigned64,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtProcessMemVzs extends IpfixIeCodecUnsigned64 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtProcessMemVzs() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(344)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessMemVzs( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(344)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtProcessMemVzs( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(344)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtProcessMemVzs";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemCpuIdle.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemCpuIdle.java
new file mode 100644
index 0000000..709bf0b
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemCpuIdle.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecFloat32;
+
+
+
+/**
+ * <pre>
+PtSystemCpuIdle:{
+ elementId:340,
+ dataType:float32,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtSystemCpuIdle extends IpfixIeCodecFloat32 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtSystemCpuIdle() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(340)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtSystemCpuIdle( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(340)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtSystemCpuIdle( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(340)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtSystemCpuIdle";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemMemFree.java b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemMemFree.java
new file mode 100644
index 0000000..c75d841
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/java/de/fhg/fokus/net/packetmatcher/ipfix/ie/IpfixIePtSystemMemFree.java
@@ -0,0 +1,91 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.packetmatcher.ipfix.ie;
+// === ipfix-model-generator: auto-generated file - do not edit! ===
+import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
+import de.fhg.fokus.net.ipfix.api.IpfixIe;
+import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
+import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
+import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
+import de.fhg.fokus.net.ipfix.api.codec.IpfixIeCodecUnsigned64;
+
+
+
+/**
+ * <pre>
+PtSystemMemFree:{
+ elementId:341,
+ dataType:unsigned64,
+ dataTypeSemantis:quantity,
+ units:null
+ status:current
+ en: 12325
+}
+</pre>
+ *
+ */
+public final class IpfixIePtSystemMemFree extends IpfixIeCodecUnsigned64 implements IpfixIe {
+ // -- model --
+ private final IpfixFieldSpecifier fieldSpecifier;
+
+ @Override
+ public IpfixFieldSpecifier getFieldSpecifier() {
+ return fieldSpecifier;
+ }
+
+ public IpfixIePtSystemMemFree() {
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(341)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtSystemMemFree( int length ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(12325).setId(341)
+ .setFieldLength(this.fieldLength);
+ }
+ public IpfixIePtSystemMemFree( int length, long enterpriseNumber, boolean isScope ) {
+ this.fieldLength = length;
+ this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(341)
+ .setFieldLength(this.fieldLength).setScope(isScope);
+ }
+
+
+ @Override
+ public IpfixIeSemantics getSemantics() {
+ return IpfixIeSemantics.QUANTITY;
+ }
+
+ @Override
+ public IpfixIeStatus getStatus() {
+ return IpfixIeStatus.CURRENT;
+ }
+
+ @Override
+ public String getName() {
+ return "PtSystemMemFree";
+ }
+
+ @Override
+ public int getLength() {
+ return fieldSpecifier.getIeLength();
+ }
+
+ @Override
+ public IpfixIeUnits getUnits() {
+ return IpfixIeUnits.NONE;
+ }
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/resources/log4j.properties b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/resources/log4j.properties
new file mode 100644
index 0000000..0dd8e90
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/packetmatcher/src/main/resources/log4j.properties
@@ -0,0 +1,28 @@
+# log4j settings
+#
+# The root logger is assigned priority level DEBUG and an appender
+# named rootAppender
+log4j.rootLogger=debug, rootAppender
+
+# Appenders: {FileAppender, ConsoleAppender, .. }
+log4j.appender.rootAppender=org.apache.log4j.ConsoleAppender
+#log4j.appender.rootAppender=org.apache.log4j.FileAppender
+#log4j.appender.rootAppender.File=matcher_debug.log
+
+
+
+# Layouts: {SimpleLayout, PatternLayout, ..}
+log4j.appender.rootAppender.layout=org.apache.log4j.PatternLayout
+
+# Ex: 16:49:30,231 DEBUG [main] Test1 (App.java:27)
+log4j.appender.rootAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p [%t] %m (%F:%L) %n
+
+
+#log4j.logger.de.fhg=DEBUG,DebugFileAppender
+
+
+#log4j.logger.org.mortbay = INFO
+#log4j.logger.org.apache.cxf = OFF
+#log4j.logger.org.springframework = OFF
+
+