Пример #1
0
 def get_dot1x_enabled_interfaces(self):
     _logger.error("Querying for dot1x enabled interfaces on Cisco")
     names = self._get_interface_names()
     return {
         names.get(OID(oid)[-1]):
         six.byte2int(state) & self.DOT1X_AUTHENTICATOR
         for oid, state in self._bulkwalk(self.dot1xPortAuth)
     }
Пример #2
0
    def get_dot1x_enabled_interfaces(self):
        """Fetches a dict mapping ifindex to enabled state

        :returns: dict[ifindex, is_enabled]
        :rtype: dict[int, bool]
        """
        _logger.error("Querying for dot1x enabled interfaces on Cisco")
        return {self._get_last_number(oid):
                six.byte2int(state) & self.DOT1X_AUTHENTICATOR
                for oid, state in self._bulkwalk(self.dot1xPortAuth)}
Пример #3
0
 def is_dot1x_enabled(self, interface):
     """Returns True or False based on state of dot1x"""
     return six.byte2int(
         self._query_netbox(self.dot1xPortAuth,
                            interface.ifindex)) & self.DOT1X_AUTHENTICATOR