Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

added filtering arguments to get_arp_table and get_mac_address_table #244

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions napalm_base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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::

[
Expand Down Expand Up @@ -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
Expand All @@ -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.

Expand Down