Ejemplo n.º 1
0
def readNetworks(file):

    nets = []

    for line in open(file):
        line = line.strip()
        if not line or line.startswith("#"):
            continue

        fields = line.split()

        for (i, e) in enumerate(fields):
            fields[i] = util.formatBroPrefix(e)

        nets += [(fields[0], " ".join(fields[1:]))]

    return nets
Ejemplo n.º 2
0
def readNetworks(file):

    nets = []

    for line in open(file):
        line = line.strip()
        if not line or line.startswith("#"):
            continue

        fields = line.split()

        for (i, e) in enumerate(fields):
            fields[i] = util.formatBroPrefix(e)

        nets += [(fields[0], " ".join(fields[1:]))]

    return nets
Ejemplo n.º 3
0
def readNetworks(file):

    nets = []

    for line in open(file):
        line = line.strip()
        if not line or line.startswith("#"):
            continue

        fields = line.split(None, 1)

        cidr = util.formatBroPrefix(fields[0])
        tag = ""
        if len(fields) == 2:
            tag = fields[1]

        nets += [(cidr, tag)]

    return nets