summaryrefslogtreecommitdiff
path: root/esds.py
diff options
context:
space:
mode:
Diffstat (limited to 'esds.py')
-rw-r--r--esds.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/esds.py b/esds.py
index c28aa28..20763b6 100644
--- a/esds.py
+++ b/esds.py
@@ -5,7 +5,7 @@ import threading,importlib,queue,sys,time
class Node:
available_node_id=0
- def __init__(self,src):
+ def __init__(self,src,interfaces):
"""
"""
@@ -16,7 +16,10 @@ class Node:
self.rargs=None # Store the requests arguments
self.plugins=list() # Contains all registered node plugins
self.rqueue=queue.Queue() # Receive simulator acknowledgments
- self.chest={"state":"running", "turned_on":True, "request": None, "interfaces":{"wlan0":queue.Queue(), "eth0":queue.Queue()}, "interfaces_queue_size":{"wlan0":0,"eth0":0}}
+ self.chest={"state":"running", "turned_on":True, "request": None, "interfaces":dict(), "interfaces_queue_size":dict()}
+ for interface in interfaces:
+ self.chest["interfaces"][interface]=queue.Queue()
+ self.chest["interfaces_queue_size"][interface]=0
self.chest_lock=threading.Lock() # To access/modify self.chest
def plugin_register(self,plugin):
@@ -266,7 +269,7 @@ class Simulator:
"""
Create a node thread and run it
"""
- node=Node(src)
+ node=Node(src, self.netmat.keys())
self.nodes.append(node)
thread=threading.Thread(target=node.run, daemon=False,args=[args])
thread.start()