-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
39 lines (28 loc) · 1.03 KB
/
setup.py
File metadata and controls
39 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from src import *
def main():
# Initialize interface
interface1 = Interface()
interface1.ip = socket.inet_aton(myconfigs.interfaces_ip[0])
interface1.event_interface_up()
myconfigs.ip2interface[myconfigs.interfaces_ip[0]] = interface1
myconfigs.interfaces.append(interface1)
interface2 = Interface()
interface2.ip = socket.inet_aton(myconfigs.interfaces_ip[1])
interface2.event_interface_up()
myconfigs.ip2interface[myconfigs.interfaces_ip[1]] = interface2
myconfigs.interfaces.append(interface2)
receiver_thread1 = threading.Thread(target=thread_recv_packets, args=(interface1,))
receiver_thread1.start()
receiver_thread2 = threading.Thread(target=thread_recv_packets, args=(interface2,))
receiver_thread2.start()
# Main loop
while True:
operation = input()
print(operation)
if operation == "exit":
print("killing ospf...")
myconfigs.to_exit = True
break
print("ospf close")
if __name__ == "__main__":
main()