Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get arp table #18

Closed
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
14 changes: 13 additions & 1 deletion napalm_vyos/vyos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down Expand Up @@ -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]),
Expand Down