summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes')
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Node.py34
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py53
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtHopStats.py67
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtPathStats.py64
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtVolumeStats.py60
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Status.py25
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/__init__.py15
7 files changed, 318 insertions, 0 deletions
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Node.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Node.py
new file mode 100644
index 0000000..98f9017
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Node.py
@@ -0,0 +1,34 @@
+"""
+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
+"""
+
+from IPy import IP
+
+class Node(object):
+ def __init__(self, oid = 0, ip = "0.0.0.0",
+ latitude = 0.0, longitude = 0.0):
+ self.oid = oid
+ self.ip = ip
+ self.latitude = latitude
+ self.longitude = longitude
+
+ def set_ip(self, ip):
+ try:
+ IP(ip)
+ self.ip = ip
+ except ValueError:
+ self.ip = "0.0.0.0"
+
+ def __str__(self):
+ return (str(self.oid) + " (" + str(self.ip) + ")")
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
new file mode 100644
index 0000000..766761a
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
@@ -0,0 +1,53 @@
+"""
+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
+"""
+
+from time import mktime, time, strftime, localtime
+
+from Task.Passive.Monitoring.DataTypes import Node
+
+class PtActivity(object):
+ def __init__(self, startTime = time(), stopTime = time(),
+ node = Node.Node(), activity = 0):
+ self.startTime = mktime(startTime)
+ self.stopTime = mktime(stopTime)
+ self.node = node
+ self.activity = activity
+
+ def __str__(self):
+ startTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.startTime))
+ stopTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.stopTime))
+ return ("PtActivity:\n"
+ " Node (Oid): " + str(self.node) + "\n"
+ " StartTime: " + startTime + "\n"
+ " StopTime: " + stopTime + "\n"
+ " Activity: " + str(self.activity) + " %")
+
+ def set_StartTime(self, StartTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the start of the observation
+ """
+ self.StartTime = mktime(StartTime)
+
+ def set_StopTime(self, StopTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the end of the observation
+ """
+ self.StopTime = mktime(StopTime) \ No newline at end of file
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtHopStats.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtHopStats.py
new file mode 100644
index 0000000..4e887fa
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtHopStats.py
@@ -0,0 +1,67 @@
+"""
+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
+"""
+
+from time import mktime, time, strftime, localtime
+
+from Task.Passive.Monitoring.DataTypes import Node
+
+class PtHopStats(object):
+ """
+ Packet tracking Hop statistics, i.e. delay/volume statistics between two
+ neighbor Pt probes
+ """
+ def __init__(self, startTime = time(), stopTime = time(),
+ src = Node.Node(), dst = Node.Node(), number = 0,
+ avgPktSize = 0, avgDelay = 0):
+ self.startTime = mktime(startTime)
+ self.stopTime = mktime(stopTime)
+ self.src = src
+ self.dst = dst
+ self.number = number
+ self.avgPktSize = avgPktSize
+ self.avgDelay = avgDelay
+
+ def __str__(self):
+ startTime = strftime("%a, %d %b %Y %H:%M:%S",
+ localtime(self.startTime))
+ stopTime = strftime("%a, %d %b %Y %H:%M:%S",
+ localtime(self.stopTime))
+ return ("PtHopStats:\n"
+ " Src. Node: " + str(self.src) + "\n" +
+ " Dst. Node: " + str(self.dst) + "\n" +
+ " StartTime: " + startTime + "\n" +
+ " StopTime: " + stopTime + "\n" +
+ " Packets: " + str(self.number) + " Pkts\n"
+ " Avg. Pktsize: " + str(self.avgPktSize) + " Bytes\n" +
+ " Avg. Delay: " + str(self.avgDelay) + " ms")
+
+ def set_startTime(self, startTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the start of the
+ observation
+ """
+ self.startTime = mktime(startTime)
+
+ def set_stopTime(self, stopTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the end of the observation
+ """
+ self.stopTime = mktime(stopTime) \ No newline at end of file
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtPathStats.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtPathStats.py
new file mode 100644
index 0000000..332087c
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtPathStats.py
@@ -0,0 +1,64 @@
+"""
+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
+"""
+
+from time import mktime, time, strftime, localtime
+
+from Task.Passive.Monitoring.DataTypes import Node
+
+class PtPathStats(object):
+ def __init__(self, startTime = time(), stopTime = time(), src = Node.Node(),
+ dst = Node.Node(), number = 0, avgPktSize = 0,
+ avgDelay = 0, path = ""):
+ self.startTime = mktime(startTime)
+ self.stopTime = mktime(stopTime)
+ self.src = src
+ self.dst = dst
+ self.number = number
+ self.avgPktSize = avgPktSize
+ self.avgDelay = avgDelay
+ self.path = path
+
+ def __str__(self):
+ startTime = strftime("%a, %d %b %Y %H:%M:%S",
+ localtime(self.startTime))
+ stopTime = strftime("%a, %d %b %Y %H:%M:%S",
+ localtime(self.stopTime))
+ return ("PtPathStats:\n"
+ " Src. Node: " + str(self.src) + "\n" +
+ " Dst. Node: " + str(self.dst) + "\n" +
+ " Path: " + self.path + "\n" +
+ " StartTime: " + startTime + "\n" +
+ " StopTime: " + stopTime + "\n" +
+ " Packets: " + str(self.number) + " Pkts\n"
+ " Avg. Pktsize: " + str(self.avgPktSize) + " Bytes\n" +
+ " Avg. Delay: " + str(self.avgDelay) + " ms")
+
+ def set_startTime(self, startTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the start of the observation
+ """
+ self.startTime = mktime(startTime)
+
+ def set_stopTime(self, stopTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the end of the observation
+ """
+ self.stopTime = mktime(stopTime) \ No newline at end of file
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtVolumeStats.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtVolumeStats.py
new file mode 100644
index 0000000..78bce1e
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtVolumeStats.py
@@ -0,0 +1,60 @@
+"""
+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
+"""
+
+from time import mktime, time, strftime, localtime
+
+from Task.Passive.Monitoring.DataTypes import Node
+
+class PtVolumeStats(object):
+ """
+ (at least) number of packets and bytes observed by a Node
+ """
+ def __init__(self, startTime = time(), stopTime = time(),
+ node = Node.Node(), number = 0, avgPktSize = 0):
+ self.startTime = mktime(startTime)
+ self.stopTime = mktime(stopTime)
+ self.node = node
+ self.number = number
+ self.avgPktSize = avgPktSize
+
+ def __str__(self):
+ startTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.startTime))
+ stopTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.stopTime))
+ Str = ("PtVolumeStats:\n"
+ " Node: " + str(self.node) + "\n" +
+ " StartTime: " + startTime + "\n" +
+ " StopTime: " + stopTime + "\n" +
+ " Packets: " + str(self.number) + "\n" +
+ " Avg. Pktsize: " + str(self.avgPktSize) + " Bytes")
+ return Str
+
+
+ def set_StartTime(self, StartTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the start of the observation
+ """
+ self.StartTime = mktime(StartTime)
+
+ def set_StopTime(self, StopTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the end of the observation
+ """
+ self.StopTime = mktime(StopTime) \ No newline at end of file
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Status.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Status.py
new file mode 100644
index 0000000..6206c57
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/Status.py
@@ -0,0 +1,25 @@
+"""
+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
+"""
+
+
+class Status(object):
+ """
+ Class to handle different errors, and also throw exceptions
+ """
+ def __init__(self, status = 0):
+ self.status = status
+
+ def __str__(self):
+ return ("Status:" + str(self.status)) \ No newline at end of file
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/__init__.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/__init__.py
new file mode 100644
index 0000000..92936f3
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/__init__.py
@@ -0,0 +1,15 @@
+"""
+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
+"""
+