Skip to content
This repository was archived by the owner on Feb 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #203 from mirceaulinic/mac-l2ng-switches
Browse files Browse the repository at this point in the history
Support get_mac_address_table() on L2NG switches
  • Loading branch information
mirceaulinic authored Sep 18, 2017
2 parents dc4e667 + 40da0b4 commit 50d432d
Show file tree
Hide file tree
Showing 5 changed files with 2,789 additions and 1 deletion.
5 changes: 4 additions & 1 deletion napalm_junos/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,10 @@ def get_mac_address_table(self):
mac_address_table = []

if self.device.facts.get('personality', '') in ['SWITCH']: # for EX & QFX devices
mac_table = junos_views.junos_mac_address_table_switch(self.device)
if self.device.facts.get('switch_style', '') in ['VLAN_L2NG']: # for L2NG devices
mac_table = junos_views.junos_mac_address_table_switch_l2ng(self.device)
else:
mac_table = junos_views.junos_mac_address_table_switch(self.device)
else:
mac_table = junos_views.junos_mac_address_table(self.device)

Expand Down
19 changes: 19 additions & 0 deletions napalm_junos/utils/junos_views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,25 @@ junos_mac_address_view_switch:
vlan: {mac-vlan-tag: int}
static: {mac-type: True=Static}

# Yet another table struct & view for L2NG devices

junos_mac_address_table_switch_l2ng:
rpc: get-ethernet-switching-table-information
item: l2ng-l2ald-mac-entry-vlan
args:
extensive: True
args_key:
- interface_name
- vlan
key: l2ng-l2-vlan-id
view: junos_mac_address_view_switch_l2ng

junos_mac_address_view_switch_l2ng:
fields:
interface: {l2ng-l2-mac-logical-interface: unicode}
mac: {l2ng-l2-mac-address: unicode}
vlan: {l2ng-l2-vlan-id: int}

###
### Route Information
###
Expand Down
Loading

0 comments on commit 50d432d

Please sign in to comment.