Beispiel #1
0
def get_arp_table():
    proc = Popen(["/usr/sbin/arp"], stdout=PIPE)
    if proc.wait() != 0:
        raise Exception(
            "'/usr/sbin/arp' exited with non zero status: {}".format(
                proc.returncode))
    return list(fixedreader(proc.stdout))
def get_arp_table():
    proc = Popen(["/usr/sbin/arp"], stdout=PIPE)
    if proc.wait() != 0:
        raise Exception(
            "'/usr/sbin/arp' exited with non zero status: {}"
            .format(proc.returncode))
    return list(fixedreader(proc.stdout))
Beispiel #3
0
def get_routing_table():
    proc = Popen(["/sbin/route"], stdout=PIPE)
    if proc.wait() != 0:
        raise Exception("'/sbin/route' exited with non zero status: {}".format(
            proc.returncode))
    proc.stdout.readline()  # skip the 1st line: Kernel IP...
    return list(fixedreader(proc.stdout))
def get_routing_table():
    proc = Popen(["/sbin/route"], stdout=PIPE)
    if proc.wait() != 0:
        raise Exception(
            "'/sbin/route' exited with non zero status: {}"
            .format(proc.returncode))
    proc.stdout.readline()  # skip the 1st line: Kernel IP...
    return list(fixedreader(proc.stdout))