def hp_flow_set_dst_ip(self, dst_ip):
     from utils import ip_check
     if ip_check(dst_ip) != None:
         m_dst_ip = {"ipv4_dst":dst_ip}
         self.list_match_field.append(dst_ip)
     else:
         print "invalid dst ip!"
     return 
 def hp_flow_set_src_ip(self, src_ip):
     from utils import ip_check
     if ip_check(src_ip) != None:
         m_src_ip = {"ipv4_src":src_ip}
         self.list_match_field.append(src_ip)
     else: 
         print "invalid src ip!"
     return 
Example #3
0
def connect_nsx():
    from utils import port_check, ip_check
    global nsx_ip

    ip = raw_input("nsx_ip > ")
    while True:
        if ip_check(ip) == True:
            break
        else : 
            print "invalid IP"
            ip = raw_input("nsx_ip > ")
    nsx_ip = ip