2012-05-11 14:12:41 +02:00
|
|
|
class Node():
|
|
|
|
def __init__(self):
|
|
|
|
self.name = ""
|
2012-06-04 17:33:23 +02:00
|
|
|
self.id = ""
|
2012-05-11 14:12:41 +02:00
|
|
|
self.macs = set()
|
2012-06-11 23:53:45 +02:00
|
|
|
self.interfaces = dict()
|
2012-06-07 22:21:50 +02:00
|
|
|
self.flags = dict({
|
|
|
|
"online": False,
|
|
|
|
"gateway": False,
|
|
|
|
"client": False
|
|
|
|
})
|
2012-05-12 14:57:57 +02:00
|
|
|
self.gps = None
|
2014-02-02 23:28:09 +01:00
|
|
|
self.firmware = None
|
2014-04-10 17:17:11 +02:00
|
|
|
self.clientcount = 0
|
2012-05-11 14:12:41 +02:00
|
|
|
|
|
|
|
def add_mac(self, mac):
|
2012-06-06 03:34:52 +02:00
|
|
|
mac = mac.lower()
|
|
|
|
if len(self.macs) == 0:
|
|
|
|
self.id = mac
|
|
|
|
|
|
|
|
self.macs.add(mac)
|
2012-05-11 14:12:41 +02:00
|
|
|
|
2012-06-11 23:53:45 +02:00
|
|
|
self.interfaces[mac] = Interface()
|
|
|
|
|
2012-05-11 14:12:41 +02:00
|
|
|
def __repr__(self):
|
|
|
|
return self.macs.__repr__()
|
|
|
|
|
2012-06-11 23:53:45 +02:00
|
|
|
class Interface():
|
|
|
|
def __init__(self):
|
|
|
|
self.vpn = False
|
2012-05-11 14:12:41 +02:00
|
|
|
|