From 928aa3ef114ebf9246c90f9eae80da9a20172530 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 15 May 2016 13:05:33 +0200 Subject: Add ip link support to mac local_macs, improove test result readability --- haircontrol/inspectors.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 haircontrol/inspectors.py (limited to 'haircontrol/inspectors.py') diff --git a/haircontrol/inspectors.py b/haircontrol/inspectors.py new file mode 100644 index 0000000..9b797fe --- /dev/null +++ b/haircontrol/inspectors.py @@ -0,0 +1,21 @@ +import re + +class Inspector(): + cmds = {} + fd = None + + def parse(self): + return None #XXX Implement + +class LinuxInspector(Inspector): + cmds = { + 'ip-neigh': { + 'cmd': 'ip neigh', + # fe80::8300 dev eth1 lladdr 10:fe:ed:f1:e1:f3 router STALE + # 172.16.20.210 dev eth1 lladdr c0:4a:00:fe:1f:87 REACHABLE + 'kind': 'text', + 'fields': ['ip','ifname','mac'], + 're': re.compile("(?P[a-f0-9:.]+) dev (?P.*) lladdr (?P[a-f0-9:]*)") + } + } + -- cgit v1.1