private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
private ProviderContext providerContext;
- private ServiceTracker INeutronNetworkCRUDTracker;
- private ServiceTracker INeutronPortCRUDTracker;
- private ServiceTracker INeutronLoadBalancerCRUDTracker;
- private ServiceTracker INeutronLoadBalancerPoolCRUDTracker;
- private ServiceTracker INeutronSubnetCRUDTracker;
- private ServiceTracker LoadBalancerProviderTracker;
- private ServiceTracker ArpProviderTracker;
- private ServiceTracker InboundNatProviderTracker;
- private ServiceTracker OutboundNatProviderTracker;
- private ServiceTracker RoutingProviderTracker;
- private ServiceTracker L3ForwardingProviderTracker;
+ private ServiceTracker iNeutronNetworkCRUDTracker;
+ private ServiceTracker iNeutronPortCRUDTracker;
+ private ServiceTracker iNeutronLoadBalancerCRUDTracker;
+ private ServiceTracker iNeutronLoadBalancerPoolCRUDTracker;
+ private ServiceTracker iNeutronSubnetCRUDTracker;
+ private ServiceTracker loadBalancerProviderTracker;
+ private ServiceTracker arpProviderTracker;
+ private ServiceTracker inboundNatProviderTracker;
+ private ServiceTracker outboundNatProviderTracker;
+ private ServiceTracker routingProviderTracker;
+ private ServiceTracker l3ForwardingProviderTracker;
public ConfigActivator(ProviderContext providerContext) {
this.providerContext = providerContext;
// addingService may not be called if the service is already available when the ServiceTracker
// is started
@SuppressWarnings("unchecked")
- ServiceTracker INeutronNetworkCRUDTracker = new ServiceTracker(context, INeutronNetworkCRUD.class, null) {
+ ServiceTracker iNeutronNetworkCRUDTracker = new ServiceTracker(context, INeutronNetworkCRUD.class, null) {
@Override
public Object addingService(ServiceReference reference) {
LOG.info("addingService INeutronNetworkCRUD");
}
return service;
}
-
- /*@Override
- public void modifiedService(ServiceReference reference, Object service) {
- LOG.info("modifiedService INeutronNetworkCRUD");
- if (service != null) {
- tenantNetworkManager.setDependencies(service);
- networkHandler.setDependencies(service);
- lBaaSHandler.setDependencies(service);
- lBaaSPoolHandler.setDependencies(service);
- lBaaSPoolMemberHandler.setDependencies(service);
- neutronL3Adapter.setDependencies(service);
- }
- }*/
-
};
- INeutronNetworkCRUDTracker.open();
- this.INeutronNetworkCRUDTracker = INeutronNetworkCRUDTracker;
+ iNeutronNetworkCRUDTracker.open();
+ this.iNeutronNetworkCRUDTracker = iNeutronNetworkCRUDTracker;
@SuppressWarnings("unchecked")
- ServiceTracker INeutronSubnetCRUDTracker = new ServiceTracker(context, INeutronSubnetCRUD.class, null) {
+ ServiceTracker iNeutronSubnetCRUDTracker = new ServiceTracker(context, INeutronSubnetCRUD.class, null) {
@Override
public Object addingService(ServiceReference reference) {
LOG.info("addingService INeutronSubnetCRUD");
return service;
}
};
- INeutronSubnetCRUDTracker.open();
- this.INeutronSubnetCRUDTracker = INeutronSubnetCRUDTracker;
+ iNeutronSubnetCRUDTracker.open();
+ this.iNeutronSubnetCRUDTracker = iNeutronSubnetCRUDTracker;
@SuppressWarnings("unchecked")
- ServiceTracker INeutronPortCRUDTracker = new ServiceTracker(context, INeutronPortCRUD.class, null) {
+ ServiceTracker iNeutronPortCRUDTracker = new ServiceTracker(context, INeutronPortCRUD.class, null) {
@Override
public Object addingService(ServiceReference reference) {
LOG.info("addingService INeutronPortCRUD");
return service;
}
};
- INeutronPortCRUDTracker.open();
- this.INeutronPortCRUDTracker = INeutronPortCRUDTracker;
+ iNeutronPortCRUDTracker.open();
+ this.iNeutronPortCRUDTracker = iNeutronPortCRUDTracker;
@SuppressWarnings("unchecked")
- ServiceTracker INeutronLoadBalancerCRUDTracker = new ServiceTracker(context,
+ ServiceTracker iNeutronLoadBalancerCRUDTracker = new ServiceTracker(context,
INeutronLoadBalancerCRUD.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- INeutronLoadBalancerCRUDTracker.open();
- this.INeutronLoadBalancerCRUDTracker = INeutronLoadBalancerCRUDTracker;
+ iNeutronLoadBalancerCRUDTracker.open();
+ this.iNeutronLoadBalancerCRUDTracker = iNeutronLoadBalancerCRUDTracker;
@SuppressWarnings("unchecked")
- ServiceTracker INeutronLoadBalancerPoolCRUDTracker = new ServiceTracker(context,
+ ServiceTracker iNeutronLoadBalancerPoolCRUDTracker = new ServiceTracker(context,
INeutronLoadBalancerPoolCRUD.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- INeutronLoadBalancerPoolCRUDTracker.open();
- this.INeutronLoadBalancerPoolCRUDTracker = INeutronLoadBalancerPoolCRUDTracker;
+ iNeutronLoadBalancerPoolCRUDTracker.open();
+ this.iNeutronLoadBalancerPoolCRUDTracker = iNeutronLoadBalancerPoolCRUDTracker;
@SuppressWarnings("unchecked")
- ServiceTracker LoadBalancerProviderTracker = new ServiceTracker(context,
+ ServiceTracker ioadBalancerProviderTracker = new ServiceTracker(context,
LoadBalancerProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- LoadBalancerProviderTracker.open();
- this.LoadBalancerProviderTracker = LoadBalancerProviderTracker;
+ ioadBalancerProviderTracker.open();
+ this.loadBalancerProviderTracker = ioadBalancerProviderTracker;
@SuppressWarnings("unchecked")
- ServiceTracker ArpProviderTracker = new ServiceTracker(context,
+ ServiceTracker arpProviderTracker = new ServiceTracker(context,
ArpProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- ArpProviderTracker.open();
- this.ArpProviderTracker = ArpProviderTracker;
+ arpProviderTracker.open();
+ this.arpProviderTracker = arpProviderTracker;
@SuppressWarnings("unchecked")
- ServiceTracker InboundNatProviderTracker = new ServiceTracker(context,
+ ServiceTracker inboundNatProviderTracker = new ServiceTracker(context,
InboundNatProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- InboundNatProviderTracker.open();
- this.InboundNatProviderTracker = InboundNatProviderTracker;
+ inboundNatProviderTracker.open();
+ this.inboundNatProviderTracker = inboundNatProviderTracker;
@SuppressWarnings("unchecked")
- ServiceTracker OutboundNatProviderTracker = new ServiceTracker(context,
+ ServiceTracker outboundNatProviderTracker = new ServiceTracker(context,
OutboundNatProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- OutboundNatProviderTracker.open();
- this.OutboundNatProviderTracker = OutboundNatProviderTracker;
+ outboundNatProviderTracker.open();
+ this.outboundNatProviderTracker = outboundNatProviderTracker;
@SuppressWarnings("unchecked")
- ServiceTracker RoutingProviderTracker = new ServiceTracker(context,
+ ServiceTracker routingProviderTracker = new ServiceTracker(context,
RoutingProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- RoutingProviderTracker.open();
- this.RoutingProviderTracker = RoutingProviderTracker;
+ routingProviderTracker.open();
+ this.routingProviderTracker = routingProviderTracker;
@SuppressWarnings("unchecked")
- ServiceTracker L3ForwardingProviderTracker = new ServiceTracker(context,
+ ServiceTracker l3ForwardingProviderTracker = new ServiceTracker(context,
L3ForwardingProvider.class, null) {
@Override
public Object addingService(ServiceReference reference) {
return service;
}
};
- L3ForwardingProviderTracker.open();
- this.L3ForwardingProviderTracker = L3ForwardingProviderTracker;
+ l3ForwardingProviderTracker.open();
+ this.l3ForwardingProviderTracker = l3ForwardingProviderTracker;
}
@Override
public void stop(BundleContext context) throws Exception {
LOG.info("ConfigActivator stop");
/* ServiceTrackers and services are already released when bundle stops
- INeutronNetworkCRUDTracker.close();
- INeutronPortCRUDTracker.close();
- INeutronSubnetCRUDTracker.close();
- INeutronLoadBalancerCRUDTracker.close();
- INeutronLoadBalancerPoolCRUDTracker.close();
- LoadBalancerProviderTracker.close();
+ iNeutronNetworkCRUDTracker.close();
+ iNeutronPortCRUDTracker.close();
+ iNeutronSubnetCRUDTracker.close();
+ iNeutronLoadBalancerCRUDTracker.close();
+ iNeutronLoadBalancerPoolCRUDTracker.close();
+ loadBalancerProviderTracker.close();
for (ServiceRegistration registration : registrations) {
if (registration != null) {
*/
public class SouthboundHandler extends AbstractHandler
implements ConfigInterface, NodeCacheListener, OvsdbInventoryListener {
- static final Logger logger = LoggerFactory.getLogger(SouthboundHandler.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(SouthboundHandler.class);
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile ConfigurationService configurationService;
type = SouthboundEvent.Type.OPENVSWITCH;
break;
default:
- logger.warn("Invalid OvsdbType: {}", ovsdbType);
+ LOGGER.warn("Invalid OvsdbType: {}", ovsdbType);
break;
}
return type;
@Override
public void ovsdbUpdate(Node node, DataObject resourceAugmentationData, OvsdbType ovsdbType, Action action) {
- logger.info("ovsdbUpdate: {} - {} - <<{}>> <<{}>>", ovsdbType, action, node, resourceAugmentationData);
+ LOGGER.info("ovsdbUpdate: {} - {} - <<{}>> <<{}>>", ovsdbType, action, node, resourceAugmentationData);
enqueueEvent(new SouthboundEvent(node, resourceAugmentationData,
ovsdbTypeToSouthboundEventType(ovsdbType), action));
}
private void handleInterfaceUpdate (Node node, OvsdbTerminationPointAugmentation tp) {
- logger.debug("handleInterfaceUpdate <{}> <{}>", node, tp);
+ LOGGER.debug("handleInterfaceUpdate <{}> <{}>", node, tp);
NeutronNetwork network = tenantNetworkManager.getTenantNetwork(tp);
if (network != null && !network.getRouterExternal()) {
- logger.trace("handleInterfaceUpdate <{}> <{}> network: {}", node, tp, network.getNetworkUUID());
+ LOGGER.trace("handleInterfaceUpdate <{}> <{}> network: {}", node, tp, network.getNetworkUUID());
if (bridgeConfigurationManager.createLocalNetwork(node, network)) {
networkingProviderManager.getProvider(node).handleInterfaceUpdate(network, node, tp);
}
} else {
- logger.debug("No tenant network found on node: <{}> for interface: <{}>", node, tp);
+ LOGGER.debug("No tenant network found on node: <{}> for interface: <{}>", node, tp);
}
neutronL3Adapter.handleInterfaceEvent(node, tp, network, Action.UPDATE);
}
private void handleInterfaceDelete (Node node, OvsdbTerminationPointAugmentation intf,
boolean isLastInstanceOnNode, NeutronNetwork network) {
- logger.debug("handleInterfaceDelete: node: <{}>, isLastInstanceOnNode: {}, interface: <{}>",
+ LOGGER.debug("handleInterfaceDelete: node: <{}>, isLastInstanceOnNode: {}, interface: <{}>",
node, isLastInstanceOnNode, intf);
neutronL3Adapter.handleInterfaceEvent(node, intf, network, Action.DELETE);
network, node, intf, isLastInstanceOnNode);
} else if (network != null) {
// vlan doesn't need a tunnel endpoint
- if (!network.getProviderNetworkType().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VLAN)) {
- if (configurationService.getTunnelEndPoint(node) == null) {
- logger.error("Tunnel end-point configuration missing. Please configure it in OpenVSwitch Table");
- return;
- }
+ if (!network.getProviderNetworkType().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VLAN) &&
+ configurationService.getTunnelEndPoint(node) == null) {
+ LOGGER.error("Tunnel end-point configuration missing. Please configure it in OpenVSwitch Table");
+ return;
}
networkingProviderManager.getProvider(node).handleInterfaceDelete(network.getProviderNetworkType(),
network, node, intf, isLastInstanceOnNode);
@Override
public void triggerUpdates() {
- logger.info("triggerUpdates");
+ LOGGER.info("triggerUpdates");
List<Node> ovsdbNodes = southbound.readOvsdbTopologyNodes();
for (Node node : ovsdbNodes) {
ovsdbUpdate(node, node.getAugmentation(OvsdbNodeAugmentation.class),
private void processPortDelete(Node node, OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation,
Object context) {
- logger.debug("processPortDelete <{}> <{}>", node, ovsdbTerminationPointAugmentation);
+ LOGGER.debug("processPortDelete <{}> <{}>", node, ovsdbTerminationPointAugmentation);
NeutronNetwork network = null;
if (context == null) {
network = tenantNetworkManager.getTenantNetwork(ovsdbTerminationPointAugmentation);
if (network != null) {
this.handleInterfaceDelete(node, ovsdbTerminationPointAugmentation, false, network);
} else {
- logger.warn("processPortDelete: network was null, ignoring update");
+ LOGGER.warn("processPortDelete: network was null, ignoring update");
}
} else if (network != null && !network.getRouterExternal()) {
- logger.debug("Network {}: Delete interface {} attached to bridge {}", network.getNetworkUUID(),
+ LOGGER.debug("Network {}: Delete interface {} attached to bridge {}", network.getNetworkUUID(),
ovsdbTerminationPointAugmentation.getInterfaceUuid(), node.getNodeId());
try {
OvsdbBridgeAugmentation ovsdbBridgeAugmentation = southbound.getBridge(node);
}
}
} catch (Exception e) {
- logger.error("Error fetching Interface Rows for node " + node, e);
+ LOGGER.error("Error fetching Interface Rows for node " + node, e);
}
}
}
private boolean isInterfaceOfInterest(OvsdbTerminationPointAugmentation terminationPoint, List<String> phyIfName) {
- logger.trace("SouthboundHandler#isInterfaceOfInterest: Interface : {}", terminationPoint);
+ LOGGER.trace("SouthboundHandler#isInterfaceOfInterest: Interface : {}", terminationPoint);
if(terminationPoint.getInterfaceType() == null){
// This is OK since eth ports don't have an interface type
- logger.info("No type found for the interface : {}", terminationPoint);
+ LOGGER.info("No type found for the interface : {}", terminationPoint);
return false;
}
- return (MdsalHelper.createOvsdbInterfaceType(
+ return MdsalHelper.createOvsdbInterfaceType(
terminationPoint.getInterfaceType()).equals(NetworkHandler.NETWORK_TYPE_VXLAN)
- ||
- MdsalHelper.createOvsdbInterfaceType(
- terminationPoint.getInterfaceType()).equals(NetworkHandler.NETWORK_TYPE_GRE)
- ||
- phyIfName.contains(terminationPoint.getName()));
+ ||
+ MdsalHelper.createOvsdbInterfaceType(
+ terminationPoint.getInterfaceType()).equals(NetworkHandler.NETWORK_TYPE_GRE)
+ ||
+ phyIfName.contains(terminationPoint.getName());
}
/**
*/
@Override
public void notifyNode (Node node, Action action) {
- logger.info("notifyNode: action: {}, Node <{}>", action, node);
+ LOGGER.info("notifyNode: action: {}, Node <{}>", action, node);
- if (action.equals(Action.ADD)) {
- if (southbound.getBridge(node) != null) {
- networkingProviderManager.getProvider(node).initializeOFFlowRules(node);
- }
+ if ((action.equals(Action.ADD)) && (southbound.getBridge(node) != null)) {
+ networkingProviderManager.getProvider(node).initializeOFFlowRules(node);
}
}
@Override
public void processEvent(AbstractEvent abstractEvent) {
if (!(abstractEvent instanceof SouthboundEvent)) {
- logger.error("processEvent: Unable to process abstract event {}", abstractEvent);
+ LOGGER.error("processEvent: Unable to process abstract event {}", abstractEvent);
return;
}
SouthboundEvent ev = (SouthboundEvent) abstractEvent;
- logger.trace("processEvent: {}", ev);
+ LOGGER.trace("processEvent: {}", ev);
switch (ev.getType()) {
case NODE:
processOvsdbNodeEvent(ev);
break;
default:
- logger.warn("Unable to process type " + ev.getType() +
+ LOGGER.warn("Unable to process type " + ev.getType() +
" action " + ev.getAction() + " for node " + ev.getNode());
break;
}
}
private void processOvsdbNodeCreate(Node node, OvsdbNodeAugmentation ovsdbNode) {
- logger.info("processOvsdbNodeCreate <{}> <{}>", node, ovsdbNode);
+ LOGGER.info("processOvsdbNodeCreate <{}> <{}>", node, ovsdbNode);
nodeCacheManager.nodeAdded(node);
bridgeConfigurationManager.prepareNode(node);
}
private void processOvsdbNodeUpdate(Node node, OvsdbNodeAugmentation ovsdbNode) {
- logger.info("processOvsdbNodeUpdate <{}> <{}>", node, ovsdbNode);
+ LOGGER.info("processOvsdbNodeUpdate <{}> <{}>", node, ovsdbNode);
nodeCacheManager.nodeAdded(node);
}
private void processOvsdbNodeDelete(Node node, OvsdbNodeAugmentation ovsdbNode) {
- logger.info("processOvsdbNodeDelete <{}> <{}>", node, ovsdbNode);
+ LOGGER.info("processOvsdbNodeDelete <{}> <{}>", node, ovsdbNode);
nodeCacheManager.nodeRemoved(node);
/* TODO SB_MIGRATION
* I don't think we want to do this yet
}
private void processPortUpdate(Node node, OvsdbTerminationPointAugmentation port) {
- logger.debug("processPortUpdate <{}> <{}>", node, port);
+ LOGGER.debug("processPortUpdate <{}> <{}>", node, port);
NeutronNetwork network = tenantNetworkManager.getTenantNetwork(port);
if (network != null && !network.getRouterExternal()) {
this.handleInterfaceUpdate(node, port);
}
private void processOpenVSwitchUpdate(Node node) {
- logger.debug("processOpenVSwitchUpdate {}", node);
+ LOGGER.debug("processOpenVSwitchUpdate {}", node);
// TODO this node might be the OvsdbNode and not have termination points
// Would need to change listener or grab tp nodes in here.
List<TerminationPoint> terminationPoints = southbound.extractTerminationPoints(node);
String bridgeName = nodeIdStr.substring(nodeIdStr.lastIndexOf('/') + 1);
List<TerminationPoint> terminationPoints = southbound.extractTerminationPoints(node);
if (terminationPoints != null && terminationPoints.size() == 1) {
+ // TODO: Either do something or remove this if statement.
+ // If there's only one termination point, is it a 1-port bridge?
}
OvsdbTerminationPointAugmentation port = southbound.extractTerminationPointAugmentation(node, bridgeName);
if (port != null) {
if (datapathId != null) {
rv = true;
} else {
- logger.info("datapathId not found");
+ LOGGER.info("datapathId not found");
}
}
return rv;
}
private void processBridgeCreate(Node node, OvsdbBridgeAugmentation bridge) {
- logger.debug("processBridgeCreate <{}> <{}>", node, bridge);
+ LOGGER.debug("processBridgeCreate <{}> <{}>", node, bridge);
String datapathId = southbound.getDatapathId(bridge);
// Having a datapathId means the ovsdb node has connected to ODL
if (datapathId != null) {
nodeCacheManager.nodeAdded(node);
} else {
- logger.info("processBridgeCreate datapathId not found");
+ LOGGER.info("processBridgeCreate datapathId not found");
}
}
private void processBridgeUpdate(Node node, OvsdbBridgeAugmentation bridge) {
- logger.debug("processBridgeUpdate <{}> <{}>", node, bridge);
+ LOGGER.debug("processBridgeUpdate <{}> <{}>", node, bridge);
String datapathId = southbound.getDatapathId(bridge);
// Having a datapathId means the ovsdb node has connected to ODL
if (datapathId != null) {
nodeCacheManager.nodeAdded(node);
} else {
- logger.info("processBridgeUpdate datapathId not found");
+ LOGGER.info("processBridgeUpdate datapathId not found");
}
}
private void processBridgeDelete(Node node, OvsdbBridgeAugmentation bridge) {
- logger.debug("processBridgeDelete: Delete bridge from config data store: <{}> <{}>",
+ LOGGER.debug("processBridgeDelete: Delete bridge from config data store: <{}> <{}>",
node, bridge);
nodeCacheManager.nodeRemoved(node);
// TODO SB_MIGRATION
}
@Override
- public void setDependencies(Object impl) {}
+ public void setDependencies(Object impl) {
+ }
}
* as well as the multi-tenant router forwarding provider.
*/
public class NeutronL3Adapter implements ConfigInterface {
- static final Logger logger = LoggerFactory.getLogger(NeutronL3Adapter.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(NeutronL3Adapter.class);
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile ConfigurationService configurationService;
private volatile RoutingProvider routingProvider;
private class FloatIpData {
+ private final Long dpid; // br-int of node where floating ip is associated with tenant port
+ private final Long ofPort; // patch port in br-int used to reach br-ex
+ private final String segId; // segmentation id of the net where fixed ip is instantiated
+ private final String macAddress; // mac address assigned to neutron port of floating ip
+ private final String floatingIpAddress;
+ private final String fixedIpAddress; // ip address given to tenant vm
+ private final String neutronRouterMac;
+
FloatIpData(final Long dpid, final Long ofPort, final String segId, final String macAddress,
final String floatingIpAddress, final String fixedIpAddress, final String neutronRouterMac) {
this.dpid = dpid;
this.fixedIpAddress = fixedIpAddress;
this.neutronRouterMac = neutronRouterMac;
}
-
- public final Long dpid; // br-int of node where floating ip is associated with tenant port
- public final Long ofPort; // patch port in br-int used to reach br-ex
- public final String segId; // segmentation id of the net where fixed ip is instantiated
- public final String macAddress; // mac address assigned to neutron port of floating ip
- public final String floatingIpAddress;
- public final String fixedIpAddress; // ip address given to tenant vm
- public final String neutronRouterMac;
}
private Set<String> inboundIpRewriteCache;
private Boolean flgDistributedARPEnabled = true;
private Southbound southbound;
- final static String OWNER_ROUTER_INTERFACE = "network:router_interface";
- final static String OWNER_ROUTER_INTERFACE_DISTRIBUTED = "network:router_interface_distributed";
- final static String OWNER_ROUTER_GATEWAY = "network:router_gateway";
- final static String OWNER_FLOATING_IP = "network:floatingip";
- final static String DEFAULT_EXT_RTR_MAC = "00:00:5E:00:01:01";
+ private static final String OWNER_ROUTER_INTERFACE = "network:router_interface";
+ private static final String OWNER_ROUTER_INTERFACE_DISTRIBUTED = "network:router_interface_distributed";
+ private static final String OWNER_ROUTER_GATEWAY = "network:router_gateway";
+ private static final String OWNER_FLOATING_IP = "network:floatingip";
+ private static final String DEFAULT_EXT_RTR_MAC = "00:00:5E:00:01:01";
public NeutronL3Adapter() {
- logger.info(">>>>>> NeutronL3Adapter constructor {}", this.getClass());
+ LOGGER.info(">>>>>> NeutronL3Adapter constructor {}", this.getClass());
}
private void initL3AdapterMembers() {
}
this.enabled = true;
- logger.info("OVSDB L3 forwarding is enabled");
+ LOGGER.info("OVSDB L3 forwarding is enabled");
if (configurationService.isDistributedArpDisabled()) {
this.flgDistributedARPEnabled = false;
- logger.info("Distributed ARP responder is disabled");
+ LOGGER.info("Distributed ARP responder is disabled");
} else {
- logger.debug("Distributed ARP responder is enabled");
+ LOGGER.debug("Distributed ARP responder is enabled");
}
} else {
- logger.debug("OVSDB L3 forwarding is disabled");
+ LOGGER.debug("OVSDB L3 forwarding is disabled");
}
}
}
public void handleNeutronSubnetEvent(final NeutronSubnet subnet, Action action) {
- logger.debug("Neutron subnet {} event : {}", action, subnet.toString());
- if (!this.enabled)
+ LOGGER.debug("Neutron subnet {} event : {}", action, subnet.toString());
+ if (!this.enabled) {
return;
+ }
}
public void handleNeutronPortEvent(final NeutronPort neutronPort, Action action) {
- logger.debug("Neutron port {} event : {}", action, neutronPort.toString());
- if (!this.enabled)
+ LOGGER.debug("Neutron port {} event : {}", action, neutronPort.toString());
+ if (!this.enabled) {
return;
+ }
final boolean isDelete = action == Action.DELETE;
}
public void handleNeutronRouterEvent(final NeutronRouter neutronRouter, Action action) {
- logger.debug("Neutron router {} event : {}", action, neutronRouter.toString());
- if (!this.enabled)
+ LOGGER.debug("Neutron router {} event : {}", action, neutronRouter.toString());
+ if (!this.enabled) {
return;
+ }
}
public void handleNeutronRouterInterfaceEvent(final NeutronRouter neutronRouter,
final NeutronRouter_Interface neutronRouterInterface,
Action action) {
- logger.debug("Router interface {} got event {}. Subnet {}",
+ LOGGER.debug("Router interface {} got event {}. Subnet {}",
neutronRouterInterface.getPortUUID(),
action,
neutronRouterInterface.getSubnetUUID());
- if (!this.enabled)
+ if (!this.enabled) {
return;
+ }
final boolean isDelete = action == Action.DELETE;
}
public void handleNeutronFloatingIPEvent(final NeutronFloatingIP neutronFloatingIP,
- Action action) {
+ Action actionIn) {
Preconditions.checkNotNull(neutronFloatingIP);
- logger.debug(" Floating IP {} {}<->{}, network uuid {}", action,
+ LOGGER.debug(" Floating IP {} {}<->{}, network uuid {}", actionIn,
neutronFloatingIP.getFixedIPAddress(),
neutronFloatingIP.getFloatingIPAddress(),
neutronFloatingIP.getFloatingNetworkUUID());
- if (!this.enabled)
+ if (!this.enabled) {
return;
+ }
+
+ Action action;
// Consider action to be delete if getFixedIPAddress is null
//
if (neutronFloatingIP.getFixedIPAddress() == null) {
action = Action.DELETE;
+ } else {
+ action = actionIn;
}
// this.programFlowsForFloatingIP(neutronFloatingIP, action == Action.DELETE);
final FloatIpData fid = floatIpDataMapCache.get(neutronFloatingIP.getID());
if (fid == null) {
- logger.trace("programFlowsForFloatingIPInboundAdd {} for {} uuid {} not in local cache",
+ LOGGER.trace("programFlowsForFloatingIPInboundAdd {} for {} uuid {} not in local cache",
action, neutronFloatingIP.getFloatingIPAddress(), neutronFloatingIP.getID());
return;
}
final FloatIpData fid = floatIpDataMapCache.get(neutronFloatingIP.getID());
if (fid == null) {
- logger.trace("programFlowsForFloatingIPOutbound {} for {} uuid {} not in local cache",
+ LOGGER.trace("programFlowsForFloatingIPOutbound {} for {} uuid {} not in local cache",
action, neutronFloatingIP.getFloatingIPAddress(), neutronFloatingIP.getID());
return;
}
Preconditions.checkNotNull(neutronFloatingIP.getFloatingIPAddress());
if (floatIpDataMapCache.get(neutronFloatingIP.getID()) != null) {
- logger.trace("programFlowsForFloatingIPArpAdd for neutronFloatingIP {} uuid {} is already done",
+ LOGGER.trace("programFlowsForFloatingIPArpAdd for neutronFloatingIP {} uuid {} is already done",
neutronFloatingIP.getFloatingIPAddress(), neutronFloatingIP.getID());
return;
}
providerSegmentationId == null || providerSegmentationId.isEmpty() ||
floatingIpMac == null || floatingIpMac.isEmpty() ||
neutronRouterMac == null || neutronRouterMac.isEmpty()) {
- logger.trace("Floating IP {}<->{}, incomplete floatPort {} tenantPortUuid {} seg {} mac {} rtrMac {}",
+ LOGGER.trace("Floating IP {}<->{}, incomplete floatPort {} tenantPortUuid {} seg {} mac {} rtrMac {}",
fixedIpAddress,
floatingIpAddress,
neutronPortForFloatIp,
final Long dpId = nodeIfPair.getLeft();
final Long ofPort = findOFPortForExtPatch(dpId);
if (ofPort == null) {
- logger.warn("Unable to locate OF port of patch port to connect floating ip to external bridge. dpid {}",
+ LOGGER.warn("Unable to locate OF port of patch port to connect floating ip to external bridge. dpid {}",
dpId);
return;
}
final FloatIpData floatIpData = new FloatIpData(dpId, ofPort, providerSegmentationId, floatingIpMac,
floatingIpAddress, fixedIpAddress, neutronRouterMac);
floatIpDataMapCache.put(neutronFloatingIP.getID(), floatIpData);
- logger.info("Floating IP {}<->{} programmed ARP mac {} on OFport {} seg {} dpid {}",
+ LOGGER.info("Floating IP {}<->{} programmed ARP mac {} on OFport {} seg {} dpid {}",
neutronFloatingIP.getFixedIPAddress(), neutronFloatingIP.getFloatingIPAddress(),
floatingIpMac, ofPort, providerSegmentationId, dpId);
}
private void programFlowsForFloatingIPArpDelete(final String neutronFloatingIPUuid) {
final FloatIpData floatIpData = floatIpDataMapCache.get(neutronFloatingIPUuid);
if (floatIpData == null) {
- logger.trace("programFlowsForFloatingIPArpDelete for uuid {} is not needed", neutronFloatingIPUuid);
+ LOGGER.trace("programFlowsForFloatingIPArpDelete for uuid {} is not needed", neutronFloatingIPUuid);
return;
}
if (programStaticArpStage1(floatIpData.dpid, encodeExcplicitOFPort(floatIpData.ofPort), floatIpData.macAddress,
floatIpData.floatingIpAddress, Action.DELETE)) {
floatIpDataMapCache.remove(neutronFloatingIPUuid);
- logger.info("Floating IP {} un-programmed ARP mac {} on {} dpid {}",
+ LOGGER.info("Floating IP {} un-programmed ARP mac {} on {} dpid {}",
floatIpData.floatingIpAddress, floatIpData.macAddress, floatIpData.ofPort, floatIpData.dpid);
}
}
}
public void handleNeutronNetworkEvent(final NeutronNetwork neutronNetwork, Action action) {
- logger.debug("neutronNetwork {}: network: {}", action, neutronNetwork);
- if (!this.enabled)
+ LOGGER.debug("neutronNetwork {}: network: {}", action, neutronNetwork);
+ if (!this.enabled) {
return;
+ }
}
//
//
public void handleInterfaceEvent(final Node bridgeNode, final OvsdbTerminationPointAugmentation intf,
final NeutronNetwork neutronNetwork, Action action) {
- logger.debug("southbound interface {} node:{} interface:{}, neutronNetwork:{}",
+ LOGGER.debug("southbound interface {} node:{} interface:{}, neutronNetwork:{}",
action, bridgeNode.getNodeId().getValue(), intf.getName(), neutronNetwork);
if (!this.enabled) {
return;
final Long dpId = getDpidForIntegrationBridge(bridgeNode);
final Uuid interfaceUuid = intf.getInterfaceUuid();
- logger.trace("southbound interface {} node:{} interface:{}, neutronNetwork:{} port:{} dpid:{} intfUuid:{}",
+ LOGGER.trace("southbound interface {} node:{} interface:{}, neutronNetwork:{} port:{} dpid:{} intfUuid:{}",
action, bridgeNode.getNodeId().getValue(), intf.getName(), neutronNetwork, neutronPort, dpId, interfaceUuid);
if (neutronPort != null) {
private void handleInterfaceEventAdd(final String neutronPortUuid, Long dpId, final Uuid interfaceUuid) {
neutronPortToDpIdCache.put(neutronPortUuid, new ImmutablePair<>(dpId, interfaceUuid));
- logger.debug("handleInterfaceEvent add cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
+ LOGGER.debug("handleInterfaceEvent add cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
neutronPortUuid, dpId, interfaceUuid.getValue());
}
for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) {
final String currPortUuid = entry.getKey();
if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) {
- logger.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
+ LOGGER.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
currPortUuid, dpId, intf.getInterfaceUuid().getValue());
neutronPortToDpIdCache.remove(currPortUuid);
break;
if (providerSegmentationId == null || providerSegmentationId.isEmpty() ||
tenantMac == null || tenantMac.isEmpty()) {
- return; // done: go no further w/out all the info needed...
+ // done: go no further w/out all the info needed...
+ return;
}
final Action action = isDelete ? Action.DELETE : Action.ADD;
List<Node> nodes = nodeCacheManager.getBridgeNodes();
if (nodes.isEmpty()) {
- logger.trace("updateL3ForNeutronPort has no nodes to work with");
+ LOGGER.trace("updateL3ForNeutronPort has no nodes to work with");
}
for (Node node : nodes) {
final Long dpid = getDpidForIntegrationBridge(node);
final Boolean isProgrammed = l3ForwardingCache.contains(cacheKey);
if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
+ LOGGER.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
return;
}
if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
+ LOGGER.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
return;
}
}
if (status.isSuccess()) {
- logger.debug("ProgramL3Forwarding {} for mac:{} addr:{} node:{} action:{}",
+ LOGGER.debug("ProgramL3Forwarding {} for mac:{} addr:{} node:{} action:{}",
l3ForwardingProvider == null ? "skipped" : "programmed",
macAddress, address, node.getNodeId().getValue(), actionForNode);
} else {
- logger.error("ProgramL3Forwarding failed for mac:{} addr:{} node:{} action:{} status:{}",
+ LOGGER.error("ProgramL3Forwarding failed for mac:{} addr:{} node:{} action:{} status:{}",
macAddress, address, node.getNodeId().getValue(), actionForNode, status);
}
return status;
final String cidr = subnet != null ? subnet.getCidr() : null;
final int mask = getMaskLenFromCidr(cidr);
- logger.trace("programFlowsForNeutronRouterInterface called for interface {} isDelete {}",
+ LOGGER.trace("programFlowsForNeutronRouterInterface called for interface {} isDelete {}",
destNeutronRouterInterface, isDelete);
// in delete path, mac address as well as ip address are not provided. Being so, let's find them from
cidr == null || cidr.isEmpty() ||
macAddress == null || macAddress.isEmpty() ||
ipList == null || ipList.isEmpty()) {
- logger.debug("programFlowsForNeutronRouterInterface is bailing seg:{} cidr:{} mac:{} ip:{}",
+ LOGGER.debug("programFlowsForNeutronRouterInterface is bailing seg:{} cidr:{} mac:{} ip:{}",
destinationSegmentationId, cidr, macAddress, ipList);
- return; // done: go no further w/out all the info needed...
+ // done: go no further w/out all the info needed...
+ return;
}
final Action actionForNode = isDelete ? Action.DELETE : Action.ADD;
List<Node> nodes = nodeCacheManager.getBridgeNodes();
if (nodes.isEmpty()) {
- logger.trace("programFlowsForNeutronRouterInterface has no nodes to work with");
+ LOGGER.trace("programFlowsForNeutronRouterInterface has no nodes to work with");
}
for (Node node : nodes) {
final Long dpid = getDpidForIntegrationBridge(node);
for (Neutron_IPs neutronIP : ipList) {
final String ipStr = neutronIP.getIpAddress();
if (ipStr.isEmpty()) {
- logger.debug("programFlowsForNeutronRouterInterface is skipping node {} ip {}",
+ LOGGER.debug("programFlowsForNeutronRouterInterface is skipping node {} ip {}",
node.getNodeId().getValue(), ipStr);
continue;
}
final String sourceSubnetId = srcNeutronRouterInterface.getSubnetUUID();
if (sourceSubnetId == null) {
- logger.error("Could not get provider Subnet ID from router interface {}",
+ LOGGER.error("Could not get provider Subnet ID from router interface {}",
srcNeutronRouterInterface.getID());
return;
}
final NeutronSubnet sourceSubnet = neutronSubnetCache.getSubnet(sourceSubnetId);
final String sourceNetworkId = sourceSubnet == null ? null : sourceSubnet.getNetworkUUID();
if (sourceNetworkId == null) {
- logger.error("Could not get provider Network ID from subnet {}", sourceSubnetId);
+ LOGGER.error("Could not get provider Network ID from subnet {}", sourceSubnetId);
return;
}
final NeutronNetwork sourceNetwork = neutronNetworkCache.getNetwork(sourceNetworkId);
if (sourceNetwork == null) {
- logger.error("Could not get provider Network for Network ID {}", sourceNetworkId);
+ LOGGER.error("Could not get provider Network for Network ID {}", sourceNetworkId);
return;
}
}
final String sourceSegmentationId = sourceNetwork.getProviderSegmentationID();
if (sourceSegmentationId == null) {
- logger.error("Could not get provider Segmentation ID for Subnet {}", sourceSubnetId);
+ LOGGER.error("Could not get provider Segmentation ID for Subnet {}", sourceSubnetId);
return;
}
if (sourceSegmentationId.equals(destinationSegmentationId)) {
if (cidr2 == null || cidr2.isEmpty() ||
macAddress2 == null || macAddress2.isEmpty() ||
ipList2 == null || ipList2.isEmpty()) {
- logger.trace("programFlowsForNeutronRouterInterfacePair reflexive is bailing seg:{} cidr:{} mac:{} ip:{}",
+ LOGGER.trace("programFlowsForNeutronRouterInterfacePair reflexive is bailing seg:{} cidr:{} mac:{} ip:{}",
sourceSegmentationId, cidr2, macAddress2, ipList2);
- return; // done: go no further w/out all the info needed...
+ // done: go no further w/out all the info needed...
+ return;
}
for (Neutron_IPs neutronIP2 : ipList2) {
final Boolean isProgrammed = routerInterfacesCache.contains(cacheKey);
if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
+ LOGGER.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
" action {} is already done",
node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
macAddress, ipStr, mask, actionForNode);
return;
}
if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
+ LOGGER.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
" action {} is already done",
node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
macAddress, ipStr, mask, actionForNode);
}
if (status.isSuccess()) {
- logger.debug("ProgramRouterInterface {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
+ LOGGER.debug("ProgramRouterInterface {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
routingProvider == null ? "skipped" : "programmed",
macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
actionForNode);
} else {
- logger.error("ProgramRouterInterface failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
+ LOGGER.error("ProgramRouterInterface failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
actionForNode, status);
}
final Boolean isProgrammed = staticArpEntryCache.contains(cacheKey);
if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
+ LOGGER.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
dpid, segOrOfPort, macAddress, ipStr, action);
return true;
}
if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
+ LOGGER.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
dpid, segOrOfPort, macAddress, ipStr, action);
return true;
}
}
if (status.isSuccess()) {
- logger.debug("ProgramStaticArp {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
+ LOGGER.debug("ProgramStaticArp {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
arpProvider == null ? "skipped" : "programmed",
macAddress, address, dpid, segOrOfPort, action);
} else {
- logger.error("ProgramStaticArp failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
+ LOGGER.error("ProgramStaticArp failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
macAddress, address, dpid, segOrOfPort, action, status);
}
return status;
final Boolean isProgrammed = inboundIpRewriteCache.contains(cacheKey);
if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
+ LOGGER.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
" action {} is already done",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
return true;
}
if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
+ LOGGER.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
" action is already done",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
return true;
if (status.isSuccess()) {
final boolean isSkipped = inboundNatProvider == null;
- logger.debug("programInboundIpRewriteStage2 {} for dpid:{} ofPort:{} seg:{} match:{} rewrite:{} action:{}",
- (isSkipped ? "skipped" : "programmed"),
+ LOGGER.debug("programInboundIpRewriteStage2 {} for dpid:{} ofPort:{} seg:{} match:{} rewrite:{} action:{}",
+ isSkipped ? "skipped" : "programmed",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
} else {
- logger.error("programInboundIpRewriteStage2 failed for dpid:{} ofPort:{} seg:{} match:{} rewrite:{} action:{}" +
+ LOGGER.error("programInboundIpRewriteStage2 failed for dpid:{} ofPort:{} seg:{} match:{} rewrite:{} action:{}" +
" status:{}",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action,
status);
final Boolean isProgrammed = outboundIpRewriteExclusionCache.contains(cacheKey);
if (actionForRewriteExclusion == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
+ LOGGER.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
return;
}
if (actionForRewriteExclusion == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
+ LOGGER.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
return;
}
if (status.isSuccess()) {
final boolean isSkipped = outboundNatProvider == null;
- logger.debug("IpRewriteExclusion {} for cidr:{} node:{} action:{}",
- (isSkipped ? "skipped" : "programmed"),
+ LOGGER.debug("IpRewriteExclusion {} for cidr:{} node:{} action:{}",
+ isSkipped ? "skipped" : "programmed",
cidr, node.getNodeId().getValue(), actionForNode);
} else {
- logger.error("IpRewriteExclusion failed for cidr:{} node:{} action:{} status:{}",
+ LOGGER.error("IpRewriteExclusion failed for cidr:{} node:{} action:{} status:{}",
cidr, node.getNodeId().getValue(), actionForNode, status);
}
return status;
final Boolean isProgrammed = outboundIpRewriteCache.contains(cacheKey);
if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
- logger.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
+ LOGGER.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
"is already done",
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
return;
}
if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
- logger.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
+ LOGGER.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
"is already done",
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
return;
if (status.isSuccess()) {
final boolean isSkipped = outboundNatProvider == null;
- logger.debug("programOutboundIpRewriteStage2 {} for dpid {} seg {} fixedIpAddress {} floatIp {}" +
- " action {}",
- (isSkipped ? "skipped" : "programmed"),
+ LOGGER.debug("programOutboundIpRewriteStage2 {} for dpid {} seg {} fixedIpAddress {} floatIp {}" +
+ " action {}",
+ isSkipped ? "skipped" : "programmed",
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
} else {
- logger.error("programOutboundIpRewriteStage2 failed for dpid {} seg {} fixedIpAddress {} floatIp {}" +
+ LOGGER.error("programOutboundIpRewriteStage2 failed for dpid {} seg {} fixedIpAddress {} floatIp {}" +
" action {} status:{}",
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action, status);
}
}
private int getMaskLenFromCidr(String cidr) {
- if (cidr == null) return 0;
+ if (cidr == null) {
+ return 0;
+ }
String[] splits = cidr.split("/");
- if (splits.length != 2) return 0;
+ if (splits.length != 2) {
+ return 0;
+ }
int result;
try {
result = Integer.parseInt(splits[1].trim());
- }
- catch (NumberFormatException nfe)
- {
+ } catch (NumberFormatException nfe) {
result = 0;
}
return result;