Beispiel #1
0
def recv_video_port(ip, port, user, password):
    tn = telnetlib_son.Telnet_print(ip, port)
    tn.set_debuglevel(1)
    tn.read_until("Username:"******"\r\n")
    tn.read_until("Password:"******"\r\n")
    tn.write("\r\n")
    tn.write("\r\n")
    tn.write('mncl 1 1 1\r\n')
    port_print = tn._read_extra('mncl 1 1 1\r\n')
    recv_port = re.findall(r"Recv\[(.+?)\] start=1 type=106", port_print)
    return recv_port
Beispiel #2
0
def medianet_version(ip, port, user, password):
    tn = telnetlib_son.Telnet_print(ip, port)
    tn.set_debuglevel(1)
    tn.read_until("Username:"******"\r\n")
    tn.read_until("Password:"******"\r\n")
    tn.write("\r\n")
    tn.write("\r\n")
    tn.write('mnhelp\r\n')
    port_print = tn._read_extra('mnhelp\r\n')
    version = re.findall(r"time(.*)", port_print)
    return version
Beispiel #3
0
def do_telnet_info(ip, port, user, password, commands):
    tn = telnetlib_son.Telnet_print(ip, port)
    tn.set_debuglevel(1)
    tn.read_until("Username:"******"\r\n")
    tn.read_until("Password:"******"\r\n")
    for command in commands:
        tn.write("\r\n")
        tn.write("\r\n")
        tn.write(command + "\r\n")
        tn.wirte_info(command + "\r\n")
    tn.close()
Beispiel #4
0
def send_video_port(ip, port, user, password, dstIp):
    tn = telnetlib_son.Telnet_print(ip, port)
    tn.set_debuglevel(1)
    tn.read_until("Username:"******"\r\n")
    tn.read_until("Password:"******"\r\n")
    tn.write("\r\n")
    tn.write("\r\n")
    tn.write('mncl 1 1 1\r\n')
    port_print = tn._read_extra('mncl 1 1 1\r\n')
    send_port = re.findall(r"Send\[(.+?)\] start=1 type=106", port_print)
    video_port = re.findall(
        r"send rtp remote addr:    ip=" + dstIp + ", port=(.*)", port_print)
    return send_port, video_port
Beispiel #5
0
def video_fps_judge(ip, port, user, password, recv_port):
    tn = telnetlib_son.Telnet_print(ip, port)
    tn.set_debuglevel(1)
    tn.read_until("Username:"******"\r\n")
    tn.read_until("Password:"******"\r\n")
    tn.write("\r\n")
    tn.write("\r\n")
    tn.write('mnhp ' + str(recv_port[0]) + ' 4 3')
    tn.write("\r\n")
    tn.write("\r\n")
    fps_print = tn._read_extra('mnhp ' + str(recv_port[0]) + ' 4 3')
    misses = re.findall(r"miss=1", fps_print)
    print fps_print
    print len(misses)
    return len(misses)