From 358bfd81488971e5e3055f461f1a0198a1c56f3e Mon Sep 17 00:00:00 2001 From: Pieprzycki Piotr Date: Tue, 21 Mar 2017 14:12:29 +0100 Subject: [PATCH] get_arp_table params --- napalm_vyos/vyos.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/napalm_vyos/vyos.py b/napalm_vyos/vyos.py index dd98e86..4813a94 100644 --- a/napalm_vyos/vyos.py +++ b/napalm_vyos/vyos.py @@ -332,7 +332,7 @@ def _get_value(key, target_dict): else: return None - def get_arp_table(self): + def get_arp_table(self, ip=None, mac=None, interface=None): # 'age' is not implemented yet """ @@ -362,6 +362,18 @@ def get_arp_table(self): else: macaddr = py23_compat.text_type(line[2]) + if ip is not None: + if ip != py23_compat.text_type(line[0]): + continue + + if mac is not None: + if mac != macaddr: + continue + + if interface is not None: + if interface != py23_compat.text_type(line[-1]): + continue + arp_table.append( { 'interface': py23_compat.text_type(line[-1]),