From 665b54fbd89d39765dff5662492052de6febe2ae Mon Sep 17 00:00:00 2001 From: Kyle Birkeland Date: Tue, 23 May 2017 19:09:52 -0400 Subject: [PATCH] added filtering arguments to get_arp_table and get_mac_address_table --- napalm_base/base.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/napalm_base/base.py b/napalm_base/base.py index 25b5a77c..594d85e9 100644 --- a/napalm_base/base.py +++ b/napalm_base/base.py @@ -692,7 +692,7 @@ def get_bgp_neighbors_detail(self, neighbor_address=''): """ raise NotImplementedError - def get_arp_table(self): + def get_arp_table(self, ip=None, mac=None, interface=None): """ Returns a list of dictionaries having the following set of keys: @@ -701,6 +701,10 @@ def get_arp_table(self): * ip (string) * age (float) + :param ip: Retuns the entries for a specific ip address. + :param mac: Retuns the entries for a specific mac address. + :param interface: Retuns the entries for a specific interface. + Example:: [ @@ -851,7 +855,7 @@ def get_interfaces_ip(self): """ raise NotImplementedError - def get_mac_address_table(self): + def get_mac_address_table(self, mac=None, interface=None, vlan=None): """ Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address @@ -864,6 +868,10 @@ def get_mac_address_table(self): * moves (int) * last_move (float) + :param mac: Retuns the entries for a specific mac address. + :param interface: Retuns the entries for a specific interface. + :param vlan: Retuns the entries for a specific vlan. + However, please note that not all vendors provide all these details. E.g.: field last_move is not available on JUNOS devices etc.