+
+ public void handleFlowRemoved(NAPTEntryEvent naptEntryEvent, Uint32 routerId, String sourceIPPortKey,
+ Uint64 dpnId) {
+ String internalIpv4HostAddress = naptEntryEvent.getIpAddress();
+ Integer internalPortNumber = naptEntryEvent.getPortNumber();
+ NAPTEntryEvent.Protocol protocol = naptEntryEvent.getProtocol();
+ //Get the external IP address and the port from the model
+ LOG.trace("handleFlowRemoved: Failed to remove snat flow internalIP {} with "
+ + "Port {} protocol {} for routerId {} in OUTBOUNDTABLE of naptSwitch {}",
+ internalIpv4HostAddress, internalPortNumber, protocol, routerId, dpnId);
+ removeNatFlows(dpnId, NwConstants.OUTBOUND_NAPT_TABLE, routerId, internalIpv4HostAddress,
+ internalPortNumber, protocol.name());
+
+ LOG.trace("handleFlowRemoved: Failed to remove snat flow internalIP {} with "
+ + "Port {} protocol {} for routerId {} in INBOUNDTABLE of naptSwitch {}",
+ internalIpv4HostAddress, internalPortNumber, protocol, routerId, dpnId);
+ removeNatFlows(dpnId, NwConstants.INBOUND_NAPT_TABLE, routerId, internalIpv4HostAddress,
+ internalPortNumber, protocol.name());
+
+ //Remove the SourceIP:Port key from the Napt packet handler map.
+ NaptPacketInHandler.removeIncomingPacketMap(sourceIPPortKey);
+
+ //Remove the mapping of internal fixed ip/port to external ip/port from the datastore.
+ SessionAddress internalSessionAddress = new SessionAddress(internalIpv4HostAddress, internalPortNumber);
+ naptManager.releaseIpExtPortMapping(routerId, internalSessionAddress, protocol);
+ }