Skip to content

Commit

Permalink
use vlan members (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
trzhang-msft authored and yxieca committed May 29, 2019
1 parent 128462a commit 9493883
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/neighbor_advertiser
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@ def get_vlan_interfaces():


def get_vlan_interface_members(vlan_intf_name):
vlan_info = config_db.get_table('VLAN')
vlan_interface_members = vlan_info[vlan_intf_name]['members']
vlan_info = config_db.get_table('VLAN_MEMBER')
vlan_interface_members = []

for vlan_member in vlan_info.keys():
if vlan_member[0] == vlan_intf_name:
vlan_interface_members.append(vlan_member[1])

return vlan_interface_members


Expand Down Expand Up @@ -289,10 +294,14 @@ def add_mirror_session(dst_ipv4_addr):


def add_mirror_acl():
all_vlan_ports = []
for vlan_intf in get_vlan_interfaces():
all_vlan_ports.extend(get_vlan_interface_members(vlan_intf))

acl_info = {
'policy_desc': 'neighbor advertiser',
'type': 'mirror',
'ports': get_vlan_interfaces()
'ports': all_vlan_ports
}

config_db.set_entry('ACL_TABLE', MIRROR_ACL_NAME, acl_info)
Expand Down

0 comments on commit 9493883

Please sign in to comment.