+
+ protected void addV6PrivateSubnetToExtNetwork(@NonNull Uuid routerId, @NonNull Uuid internetVpnId,
+ @NonNull Subnetmap subnetMap) {
+ updateVpnInternetForSubnet(subnetMap, internetVpnId, true);
+ neutronvpnUtils.updateVpnInstanceWithFallback(routerId, internetVpnId, true);
+ if (neutronvpnUtils.shouldVpnHandleIpVersionChoiceChange(IpVersionChoice.IPV6, routerId, true)) {
+ neutronvpnUtils.updateVpnInstanceWithIpFamily(internetVpnId.getValue(), IpVersionChoice.IPV6, true);
+ LOG.info("addV6PrivateSubnetToExtNetwork: Advertise IPv6 Private Subnet {} to Internet VPN {}",
+ subnetMap.getId().getValue(), internetVpnId.getValue());
+ }
+ }
+
+ protected void removeV6PrivateSubnetToExtNetwork(@NonNull Uuid routerId, @NonNull Uuid internetVpnId,
+ @NonNull Subnetmap subnetMap) {
+ updateVpnInternetForSubnet(subnetMap, internetVpnId, false);
+ neutronvpnUtils.updateVpnInstanceWithFallback(routerId, internetVpnId, false);
+ }
+
+ protected void programV6InternetFallbackFlow(Uuid routerId, Uuid internetVpnId, int addOrRemove) {
+ if (neutronvpnUtils.isV6SubnetPartOfRouter(routerId)) {
+ LOG.debug("processV6InternetFlowsForRtr: Successfully {} V6 internet vpn {} default fallback rule "
+ + "for the router {}", addOrRemove == NwConstants.ADD_FLOW ? "added" : "removed",
+ internetVpnId.getValue(), routerId.getValue());
+ neutronvpnUtils.updateVpnInstanceWithFallback(routerId, internetVpnId, addOrRemove == NwConstants.ADD_FLOW
+ ? true : false);
+ }
+ }
+
+ @CheckReturnValue
+ private AcquireResult tryInterfaceLock(final String infName) {
+ return interfaceLock.tryAcquire(infName, LOCK_WAIT_TIME, TimeUnit.SECONDS);
+ }
+
+ @CheckReturnValue
+ private AcquireResult tryVpnLock(final Uuid vpnId) {
+ return vpnLock.tryAcquire(vpnId, LOCK_WAIT_TIME, TimeUnit.SECONDS);
+ }
+
+ private static ReentrantLock lockForUuid(Uuid uuid) {
+ // FIXME: prove that this locks only on Uuids and not some other entity or create a separate lock domain
+ return JvmGlobalLocks.getLockForString(uuid.getValue());
+ }
+
+ private static void logTryLockFailure(Object objectId) {
+ LOG.warn("Lock for {} was not acquired, continuing anyway", objectId, new Throwable());
+ }