Example #1
0
 def get_string(self):
     '''
     Get a string representing the endpoint
     '''
     vIP_string = ''
     for vIP in self.vIP_set.values():
         vIP_string += vIP.show_ip()
         break
     endpoint_string = 'VNID %s, MAC %s, vIP %s'%(self.vnid, mac_show(self.vMac), vIP_string)
     return endpoint_string
Example #2
0
 def show(self):
     '''
     Display Contents of a Endpoint
     '''
     #############################################################
     #To be finished
     #############################################################
     vIP_string = ''
     for vIP in self.vIP_set_show.values():
         vIP_string += vIP.show_ip() + ', '
     vIP_string = vIP_string.rstrip()
     vIP_string = vIP_string.rstrip(',')
     string = 'VNID %s, MAC %s, version %s, vIPs [%s], pIPs[%s]'%(self.vnid,
                                                                  mac_show(self.vMac),
                                                                  self.version,
                                                                  vIP_string,
                                                                  self.tunnel_endpoint.ip_list_get())
     print '%s\r'%string
     return
Example #3
0
 def show(self):
     '''
     '''
     message = '----------------------------------------------'
     dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
     if self.global_scope:
         message = 'GLOBAL SCOPE, VNID %s'%self.dvg.unique_id
     else:
         message = 'MULTICAST MAC %s, VNID %s'%(mac_show(self.mac), self.dvg.unique_id)
     dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
     if len(self.receiver_all) > 0:
         message = 'MULTICAST Receivers (NO IP Address)'
         dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
         count = 1
         for tunnel in self.receiver_all.keys():
             message = '    [%d] Tunnel %s'%(count, tunnel.primary_ip().show())
             dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
             count += 1
     if len(self.receiver_iphash) > 0:
         for iphash_key in self.receiver_iphash.keys():
             try:
                 if type(iphash_key) == type(1):
                     ip_address = IPAddressLocation(socket.AF_INET, iphash_key, 0)
                 else:
                     ip_address = IPAddressLocation(socket.AF_INET6, iphash_key, 0)
             except Exception:
                 continue
             message = 'MULTICAST Receivers IP Address %s'%ip_address.show()
             dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
             iphash = self.receiver_iphash[iphash_key]
             count = 1;
             for tunnel in iphash.keys():
                 message = '    [%d] Tunnel %s'%(count, tunnel.primary_ip().show())
                 dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
                 count += 1
     if len(self.sender_all) > 0:
         message = 'MULTICAST Senders (NO IP Address)'
         dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
         count = 1
         for tunnel in self.sender_all.keys():
             message = '    [%d] Tunnel %s'%(count, tunnel.primary_ip().show())
             dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
             count += 1
     if len(self.sender_iphash) > 0:
         for iphash_key in self.sender_iphash.keys():
             try:
                 if type(iphash_key) == type(1):
                     ip_address = IPAddressLocation(socket.AF_INET, iphash_key, 0)
                 else:
                     ip_address = IPAddressLocation(socket.AF_INET6, iphash_key, 0)
             except Exception:
                 continue
             message = 'MULTICAST Senders IP Address %s'%ip_address.show()
             dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
             iphash = self.sender_iphash[iphash_key]
             count = 1
             for tunnel in iphash.keys():
                 message = '    [%d] Tunnel %s'%(count, tunnel.primary_ip().show())
                 dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
                 count += 1
     message = '----------------------------------------------'
     dcslib.dps_data_write_log(DpsLogLevels.NOTICE, message)
     return