def __init__(self, table, line): fields = line.split() address = parse_ipv4_route_target(fields[0], fields[2]) target = parse_ipv4_route_target(fields[1]) flags = fields[4] interface = fields[7] Route.__init__(self, table, address, target, flags=flags, interface=interface)
def __init__(self, table, line): fields = line.split() address = parse_ipv6_route_target(fields[0]) target = parse_ipv6_route_target(fields[1]) flags = fields[2] refs = fields[4] use = fields[5] interface = fields[6] Route.__init__(self, table, address, target, flags=flags, interface=interface, refs=refs, use=use)
def __init__(self, table, line): fields = line.split() address = parse_ipv6_route_target(fields[0]) target = parse_ipv6_route_target(fields[1]) flags = fields[2] interface = fields[3] if len(fields) == 5: expires = fields[4] else: expires = None Route.__init__(self, table, address, target, flags=flags, interface=interface, expires=expires)
def __init__(self, table, line): fields = line.split() address = parse_ipv4_route_target(fields[0]) target = parse_ipv4_route_target(fields[1]) flags = fields[2] refs = int(fields[3]) use = int(fields[3]) interface = fields[4] if len(fields) == 6: expires = fields[5] else: expires = None Route.__init__(self, table, address, target, flags=flags, refs=refs, use=use, interface=interface, expires=expires)