def __init__(self, subscriberdb_rpc_stub, ip_allocator: IPAllocator): """ Initializes a static IP allocator This is wrapper around other configured Ip allocator. If subscriber does have static IP, it uses underlying IP allocator to allocate IP for the subscriber. """ self._subscriber_client = SubscriberDbClient(subscriberdb_rpc_stub) self._ip_allocator = ip_allocator
def __init__(self, subscriberdb_rpc_stub, ip_allocator: IPAllocator): """ Initializes a Multi APN IP allocator This is wrapper around other configured Ip allocator. If subscriber has vlan configured in APN config, it would be used for allocating IP address by underlying IP allocator. For DHCP it means using vlan tag for DHCP request, for IP pool allocator it does not change behaviour. """ self._subscriber_client = SubscriberDbClient(subscriberdb_rpc_stub) self._ip_allocator = ip_allocator
def __init__(self, subscriberdb_rpc_stub, ip_allocator: IPAllocator, gw_info: UplinkGatewayInfo, assigned_ip_blocks: Set[ip_network], ip_state_map: IpDescriptorMap): """ Initializes a static IP allocator This is wrapper around other configured Ip allocator. If subscriber does have static IP, it uses underlying IP allocator to allocate IP for the subscriber. """ self._subscriber_client = SubscriberDbClient(subscriberdb_rpc_stub) self._ip_allocator = ip_allocator self._gw_info = gw_info self._ip_state_map = ip_state_map # {state=>{ip=>ip_desc}} self._assigned_ip_blocks = assigned_ip_blocks
def __init__( self, store: MobilityStore, subscriberdb_rpc_stub: SubscriberDBStub, ip_allocator: IPAllocator, ipv6: bool = False, ): """ Initializes a static IP allocator This is wrapper around other configured Ip allocator. If subscriber does have static IP, it uses underlying IP allocator to allocate IP for the subscriber. """ self._store = store self._subscriber_client = SubscriberDbClient(subscriberdb_rpc_stub) self._ip_allocator = ip_allocator if ipv6: self._ip_version = 6 else: self._ip_version = 4