summaryrefslogtreecommitdiff
path: root/haircontrol/inspectors.py
diff options
context:
space:
mode:
Diffstat (limited to 'haircontrol/inspectors.py')
-rw-r--r--haircontrol/inspectors.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/haircontrol/inspectors.py b/haircontrol/inspectors.py
index 04b05c1..c5c6940 100644
--- a/haircontrol/inspectors.py
+++ b/haircontrol/inspectors.py
@@ -180,6 +180,13 @@ class ToughSwitchInspector(Inspector):
'cmd':'/usr/www/mactable_data.cgi',
'func': parse_mactable_data_cgi
},
+ 'ip-link': {
+ 'cmd': 'ip -o link',
+ 'kind': 'text',
+ 're': re.compile("\d+:\s+(?P<ifname>[^:]*):.+\s+(?:link/ether\s+(?P<mac>[a-f0-9:]*)\s+brd|link/none)")
+ # 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default \ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
+ # 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000\ link/ether 8c:89:a5:c7:be:88 brd ff:ff:ff:ff:ff:ff
+ },
}
class EdgeMaxInspector(Inspector):
@@ -192,6 +199,11 @@ class EdgeMaxInspector(Inspector):
# 1 00:15:6D:8E:22:46 0/15 15 Learned
# 1 00:27:22:0E:67:F9 0/17 17 Learned
},
+ 'show-version': {
+ 'cmd':'show version', #XXX needs "enable" mode
+ 're': re.compile("(?P<key>[^\.]+)\.+ (?P<value>.*)")
+ # Burned In MAC Address.......................... 44:D9:E7:51:BF:A7
+ },
}
#TODO Implement them