X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3wrapper.py;h=d06371f35fc7e4a756bdea9f1d14342cea188ce0;hb=e0447bc7e91d169d6d88498981421572d939b6fb;hp=b7ed1926d99f9a30dbfb8a7514e1646cf842d03a;hpb=73a0a1e3fb2d042740263ccaf1a5e6e56043a909;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3wrapper.py b/src/nepi/resources/ns3/ns3wrapper.py index b7ed1926..d06371f3 100644 --- a/src/nepi/resources/ns3/ns3wrapper.py +++ b/src/nepi/resources/ns3/ns3wrapper.py @@ -30,11 +30,10 @@ CONFIG_UUID = "singleton::Config" GLOBAL_VALUE_UUID = "singleton::GlobalValue" IPV4_GLOBAL_ROUTING_HELPER_UUID = "singleton::Ipv4GlobalRoutingHelper" -def load_ns3_module(): +def load_ns3_libraries(): import ctypes import re - bindings = os.environ.get("NS3BINDINGS") libdir = os.environ.get("NS3LIBRARIES") # Load the ns-3 modules shared libraries @@ -62,9 +61,13 @@ def load_ns3_module(): # to prevent infinit loop if initial_size == len(libs): raise RuntimeError("Imposible to load shared libraries %s" % str(libs)) - initial_size = list(libs) + initial_size = len(libs) + +def load_ns3_module(): + load_ns3_libraries() # import the python bindings for the ns-3 modules + bindings = os.environ.get("NS3BINDINGS") if bindings: sys.path.append(bindings)