Commit e74f7f2d authored by Pedro Oliveira's avatar Pedro Oliveira

kernel integration

parent ee35f93e
...@@ -37,7 +37,7 @@ class Hello: ...@@ -37,7 +37,7 @@ class Hello:
def force_send(self, interface: Interface): def force_send(self, interface: Interface):
# When PIM is enabled on an interface or when a router first starts, the Hello Timer (HT) # When PIM is enabled on an interface or when a router first starts, the Hello Timer (HT)
# MUST be set to random value between 0 and Triggered_Hello_DelayHello Timer(HT) # MUST be set to random value between 0 and Triggered_Hello_Delay
hello_timer = random.uniform(0, Hello.TRIGGERED_HELLO_DELAY) hello_timer = random.uniform(0, Hello.TRIGGERED_HELLO_DELAY)
Timer(hello_timer, self.packet_send_handle, args=[interface]).start() Timer(hello_timer, self.packet_send_handle, args=[interface]).start()
......
...@@ -3,12 +3,13 @@ import time ...@@ -3,12 +3,13 @@ import time
from prettytable import PrettyTable from prettytable import PrettyTable
from Interface import Interface from Interface import Interface
from Kernel import Kernel
from Neighbor import Neighbor from Neighbor import Neighbor
interfaces = {} # interfaces with multicast routing enabled interfaces = {} # interfaces with multicast routing enabled
neighbors = {} # multicast router neighbors neighbors = {} # multicast router neighbors
protocols = {} protocols = {}
kernel = None
def add_interface(interface_name): def add_interface(interface_name):
global interfaces global interfaces
...@@ -108,5 +109,7 @@ def main(interfaces_to_add=[]): ...@@ -108,5 +109,7 @@ def main(interfaces_to_add=[]):
from Hello import Hello from Hello import Hello
Hello() Hello()
global kernel
kernel = Kernel()
for interface in interfaces_to_add: for interface in interfaces_to_add:
add_interface(interface) add_interface(interface)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment