Add missing IPv6 connectors
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 10 May 2011 08:55:39 +0000 (10:55 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 10 May 2011 08:55:39 +0000 (10:55 +0200)
Fix cross connections by properly handling linux abstract socket names

src/nepi/testbeds/ns3/factories_metadata_v3_9_RC3.py
src/nepi/testbeds/ns3/metadata_v3_9_RC3.py

index 5b8a79f..6521678 100644 (file)
@@ -678,7 +678,7 @@ factories_info = dict({
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
-        "connector_types": [],
+        "connector_types": ["node"],
         "box_attributes": ["DAD",
             "ProtocolNumber"],
     }),
@@ -1702,7 +1702,7 @@ factories_info = dict({
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
-        "connector_types": [],
+        "connector_types": ["node"],
         "box_attributes": ["DefaultTtl",
             "IpForward"],
     }),
index 472b6a3..70c0732 100644 (file)
@@ -98,9 +98,12 @@ def connect_fd(testbed_instance, fdnd_guid, cross_data):
     address = endpoint.replace(":", "").decode('hex')[2:]
     testbed_instance.set(fdnd_guid, "LinuxSocketAddress", address)
     
+    # If it's a non-abstract socket, add the path
+    if not address.startswith('\x00'):
+        address = os.path.join( testbed_instance.root_directory, address )
+    
     # Set tun standard contract attributes
-    testbed_instance.set(fdnd_guid, "tun_addr", 
-        os.path.join( testbed_instance.root_directory, address ) )
+    testbed_instance.set(fdnd_guid, "tun_addr", address )
     testbed_instance.set(fdnd_guid, "tun_proto", "fd")
     testbed_instance.set(fdnd_guid, "tun_port", 0)
     testbed_instance.set(fdnd_guid, "tun_key", "\xfa"*32) # unimportant, fds aren't encrypted
@@ -435,12 +438,24 @@ connections = [
         "init_code": connect_node_other,
         "can_cross": False
     }),
+    dict({
+        "from": ( "ns3", "ns3::Node", "protos" ),
+        "to":   ( "ns3", "ns3::Icmpv6L4Protocol", "node" ),
+        "init_code": connect_node_other,
+        "can_cross": False
+    }),
     dict({
         "from": ( "ns3", "ns3::Node", "protos" ),
         "to":   ( "ns3", "ns3::Ipv4L3Protocol", "node" ),
         "init_code": connect_node_other,
         "can_cross": False
     }),
+    dict({
+        "from": ( "ns3", "ns3::Node", "protos" ),
+        "to":   ( "ns3", "ns3::Ipv6L3Protocol", "node" ),
+        "init_code": connect_node_other,
+        "can_cross": False
+    }),
     dict({
         "from": ( "ns3", "ns3::Node", "protos" ),
         "to":   ( "ns3", "ns3::UdpL4Protocol", "node" ),