def is_ipv6(self): ''' Returns True if this static overlay link uses an IPv6 point-to-point subnet. ''' return util.ip_address_is_v6(self.outer_address)
def is_ipv6(self): ''' Returns True if this static vlan has an IPv6 address assigned to it. ''' return util.ip_address_is_v6(self.address)
def read(logger, name, config): ''' Create a static tunnel from the given configuration object. ''' mode = util.enum_get(config["mode"], ["gre", "gretap"]) local = util.ip_address_get(config["local"]) remote = util.ip_address_get(config["remote"]) address = util.ip_address_get(config["address"]) netmask = util.netmask_get(config["netmask"], util.ip_address_is_v6(address)) key = util.integer_get(config["key"], minval=0) if "key" in config else None ikey = util.integer_get(config["ikey"], minval=0) if "ikey" in config else None okey = util.integer_get(config["okey"], minval=0) if "okey" in config else None if key is None and ikey is not None and okey is None: raise ReadError("ikey defined but okey undefined in overlay '%s'" % name) if key is None and ikey is None and okey is not None: raise ReadError("okey defined but ikey undefined in overlay '%s'" % name) return Tunnel( logger, name, mode, local, remote, address, netmask, key, ikey, okey, )
def is_ipv6(self): ''' Returns True if this static bgp has an IPv6 address assigned to its neighbor address. ''' return util.ip_address_is_v6(self.neighbor)
def read(logger, name, config): ''' Create a static dummy from the given configuration object. ''' address = util.ip_address_get(config["address"]) netmask = util.netmask_get(config["netmask"], util.ip_address_is_v6(address)) return Dummy(logger, name, address, netmask)
def read(logger, name, config): ''' Create a static vlan from the given configuration object. ''' id = util.integer_get(config["id"], minval=0, maxval=4096) physical_interface = util.name_get(config["physical-interface"]) address = util.ip_address_get(config["address"]) netmask = util.netmask_get(config["netmask"], util.ip_address_is_v6(address)) return VLAN(logger, name, id, physical_interface, address, netmask)
def read(logger, name, config): ''' Create a static tuntap from the given configuration object. ''' mode = util.enum_get(config["mode"], ["tun", "tap"]) address = util.ip_address_get(config["address"]) netmask = util.netmask_get(config["netmask"], util.ip_address_is_v6(address)) uid = util.integer_get(config["uid"], minval=0) if "uid" in config else None gid = util.integer_get(config["gid"], minval=0) if "gid" in config else None return Tuntap(logger, name, mode, address, netmask, uid, gid)
def read(logger, name, config): ''' Create a static overlay link from the given configuration object. ''' outer_address = util.ip_address_get(config["outer-address"]) inner_address = util.ip_address_get(config["inner-address"]) inner_overlay_name = util.name_get(config["inner-overlay-name"]) netmask = util.netmask_get(config["netmask"], util.ip_address_is_v6(inner_address)) if (type(inner_address) != type(outer_address)): raise ReadError("inner address '%s' (%s) and outer address '%s' (%s) must be the same type of IP address" % (inner_address, str(type(nner_address)), outer_address, str(type(outer_address)))) return OverlayLink(logger, name, outer_address, inner_address, inner_overlay_name, netmask)
def __init__(self, logger, name, node_local, node_remote, physical_local, physical_remote, virtual_local, virtual_remote): ''' Set up mesh tunnel internal fields. ''' super().__init__(logger, name) self.node_local = node_local self.node_remote = node_remote self.physical_local = physical_local self.physical_remote = physical_remote self.virtual_local = virtual_local self.virtual_remote = virtual_remote self.virtual_netmask = 127 if util.ip_address_is_v6(self.virtual_local) else 31