Ejemplo n.º 1
0
 def _remove_l2_responders(self, lport):
     if not self.is_install_l2_responder:
         return
     ips = lport.ips
     network_id = lport.lswitch.unique_key
     for ip in ips:
         ip_version = ip.version
         if ip_version == common_const.IP_VERSION_4:
             arp_responder.ArpResponder(self, network_id, ip).remove()
         elif ip_version == common_const.IP_VERSION_6:
             nd_advertisers.NeighborAdvertiser(self, network_id,
                                               ip).remove()
Ejemplo n.º 2
0
 def _add_l2_responders(self, lport):
     if not self.is_install_l2_responder:
         return
     ips = lport.ips
     network_id = lport.local_network_id
     mac = lport.mac
     for ip in ips:
         ip_version = ip.version
         if ip_version == common_const.IP_VERSION_4:
             arp_responder.ArpResponder(self,
                                        network_id, ip, mac).add()
         elif ip_version == common_const.IP_VERSION_6:
             nd_advertisers.NeighborAdvertiser(self,
                                               network_id, ip, mac).add()