ffmap-backend/node.py
Nils Martin Klünder 71c2417b9d How about a less confusing repr?
„WTF, why is this a string?”
2015-02-21 19:17:49 +01:00

33 lines
610 B
Python

class Node():
def __init__(self):
self.name = ""
self.id = ""
self.macs = set()
self.interfaces = dict()
self.flags = dict({
"online": False,
"gateway": False,
})
self.gps = None
self.firmware = None
self.clientcount = 0
self.lastseen = 0
self.firstseen = 0
def add_mac(self, mac):
mac = mac.lower()
if len(self.macs) == 0:
self.id = mac
self.macs.add(mac)
self.interfaces[mac] = Interface()
def __repr__(self):
return '<Node %s>' % self.macs.__repr__()
class Interface():
def __init__(self):
self.vpn = False