import org.opendaylight.ovsdb.neutron.TenantNetworkManager;
import org.opendaylight.ovsdb.plugin.IConnectionServiceInternal;
import org.opendaylight.ovsdb.plugin.OVSDBConfigService;
+import org.opendaylight.ovsdb.plugin.StatusWithUuid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class OF10ProviderManager extends ProviderNetworkManager {
private static final Logger logger = LoggerFactory.getLogger(OF10ProviderManager.class);
Map<NodeVlan, FlowConfig> floodEntries = new HashMap<NodeVlan, FlowConfig>();
+ private static final int INGRESS_TUNNEL_FLOW_PRIORITY = 100;
+ private static final int EGRESS_TUNNEL_FLOW_PRIORITY = 100;
+ private static final int FLOOD_TUNNEL_FLOW_PRIORITY = 1;
@Override
public boolean hasPerTenantTunneling() {
FlowConfig flow = new FlowConfig();
flow.setName(flowName);
flow.setNode(ofNode);
- flow.setPriority("100");
+ flow.setPriority(INGRESS_TUNNEL_FLOW_PRIORITY+"");
flow.setIngressPort(tunnelOFPort+"");
List<String> actions = new ArrayList<String>();
actions.add(ActionType.SET_VLAN_ID+"="+internalVlan);
IForwardingRulesManager frm = (IForwardingRulesManager) ServiceHelper.getInstance(
IForwardingRulesManager.class, "default", this);
if (frm.getStaticFlow(flowName, ofNode) != null) {
- logger.debug("Remove Egress Flow exists : {} for Flow {} on {} / {}", flowName, ofNode, node);
+ logger.debug("Remote Egress Flow exists : {} for Flow {} on {} / {}", flowName, ofNode, node);
return;
}
FlowConfig flow = new FlowConfig();
flow.setName(flowName);
flow.setNode(ofNode);
- flow.setPriority("100");
+ flow.setPriority(EGRESS_TUNNEL_FLOW_PRIORITY+"");
flow.setDstMac(attachedMac);
flow.setIngressPort(patchPort+"");
flow.setVlanId(internalVlan+"");
flow = new FlowConfig();
flow.setName("TepFlood"+internalVlan);
flow.setNode(ofNode);
- flow.setPriority("1");
+ flow.setPriority(FLOOD_TUNNEL_FLOW_PRIORITY+"");
flow.setIngressPort(patchPort+"");
flow.setVlanId(internalVlan+"");
List<String> actions = new ArrayList<String>();
if (patchIntf.getName().equalsIgnoreCase(patchInt)) {
Set<BigInteger> of_ports = patchIntf.getOfport();
if (of_ports == null || of_ports.size() <= 0) {
- logger.error("Could NOT Identified Patch port {} -> OF ({}) on {}", patchInt, node);
+ logger.error("Could NOT Identified Patch port {} on {}", patchInt, node);
continue;
}
patchOFPort = Long.valueOf(((BigInteger)of_ports.toArray()[0]).longValue()).intValue();
Port tunnelPort = new Port();
tunnelPort.setName(portName);
- Status status = ovsdbTable.insertRow(node, Port.NAME.getName(), bridgeUUID, tunnelPort);
- if (!status.isSuccess()) {
+ StatusWithUuid statusWithUuid = ovsdbTable.insertRow(node, Port.NAME.getName(), bridgeUUID, tunnelPort);
+ if (!statusWithUuid.isSuccess()) {
logger.error("Failed to insert Tunnel port {} in {}", portName, bridgeUUID);
- return status;
+ return statusWithUuid;
}
- String tunnelPortUUID = status.getDescription();
-
+ String tunnelPortUUID = statusWithUuid.getUuid().toString();
String interfaceUUID = null;
int timeout = 6;
while ((interfaceUUID == null) && (timeout > 0)) {
options.put("local_ip", src.getHostAddress());
options.put("remote_ip", dst.getHostAddress());
tunInterface.setOptions(options);
- status = ovsdbTable.updateRow(node, Interface.NAME.getName(), tunnelPortUUID, interfaceUUID, tunInterface);
+ Status status = ovsdbTable.updateRow(node, Interface.NAME.getName(), tunnelPortUUID, interfaceUUID, tunInterface);
logger.debug("Tunnel {} add status : {}", tunInterface, status);
return status;
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("Exception in addTunnelPort", e);
return new Status(StatusCode.INTERNALERROR);
}
}