Merge branch 'upstreammaster'
[sfa.git] / sfa / rspecs / elements / link.py
index 682232e..d916d22 100644 (file)
@@ -1,14 +1,23 @@
-from sfa.rspec.elements.interface import Interface
+from sfa.rspecs.elements.interface import Interface
+
+class Link(dict):
+    element = None 
+    fields = {
+        'client_id': None, 
+        'component_id': None,
+        'component_name': None,
+        'component_manager': None,
+        'type': None,
+        'interface1': None,
+        'interface2': None,
+        'capacity': None,
+        'latency': None,
+        'packet_loss': None,
+        'description': None,
+    }
+    
+    def __init__(self, fields={}, element=None):
+        self.element = element
+        dict.__init__(self, Link.fields)
+        self.update(fields)
 
-class Link:
-    def __init__(self):
-        self.component_id = None
-        self.component_name = None
-        self.component_manager_id = None
-        self.type = None
-        self.endpoint1 = Interface()
-        self.endpoint2 = Interface()
-        self.capacity = None
-        self.latency = None
-        self.packet_loss = None
-        self.description = None