ArpTable in contrail_snmp_collector does't support ipNetToPhysicalPhysAddress

Bug #1774360 reported by Kevin Chai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
New
Medium
Unassigned
Trunk
New
Medium
Unassigned

Bug Description

Underlay Overlay Mapping depends on arpTable. But not all switch vendors support MIB ipNetToMediaTable. Instead, they use MIB ipNetToPhysicalTable.

But the contrail is hard code that just only supports ipNetToMediaTable.The code should be friendly to support both tables. Here is the detailed code.

class ArpTable(SnmpTable):
    def __init__(self, session):
        super(ArpTable, self).__init__(session)
        self.arpTable = []

    def py_obj(self):
        return self.arpTable

    def table_names(self):
        return 'ipNetToMediaPhysAddress'

    def ifid(self, x):
        ns = x.split('.')
        ifindex = int(ns[0])
        return ifindex, '.'.join(ns[1:])

    def ipNetToMediaPhysAddress_translator(self, snmp_dict):
        for x in snmp_dict['vars']:
            ifidx, ip = self.ifid(x.iid)
            self.arpTable.append({'localIfIndex': ifidx,
                    'ip': ip, 'mac':self._to_mac(x.val)})

Tags: analytics
Kevin Chai (chaimh1)
information type: Proprietary → Public
Jeba Paulaiyan (jebap)
tags: added: analytics
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.