use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project netvirt by opendaylight.
the class NatOverVxlanUtil method releaseVNI.
public static void releaseVNI(String vniKey, IdManagerService idManager) {
ReleaseIdInput releaseIdInput = new ReleaseIdInputBuilder().setPoolName(NatConstants.ODL_VNI_POOL_NAME).setIdKey(vniKey).build();
try {
Future<RpcResult<Void>> result = idManager.releaseId(releaseIdInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("releaseVNI : Unable to release ID {} from OpenDaylight VXLAN VNI range pool. Error {}", vniKey, rpcResult.getErrors());
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("releaseVNI : Exception in release VNI for Key {}", vniKey, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project netvirt by opendaylight.
the class NexthopManager method getEgressActionsForInterface.
protected List<ActionInfo> getEgressActionsForInterface(final String ifName, int actionKey) {
List<ActionInfo> listActionInfo = new ArrayList<>();
try {
Future<RpcResult<GetEgressActionsForInterfaceOutput>> result = interfaceManager.getEgressActionsForInterface(new GetEgressActionsForInterfaceInputBuilder().setIntfName(ifName).build());
RpcResult<GetEgressActionsForInterfaceOutput> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.error("RPC Call to Get egress actions for interface {} returned with Errors {}", ifName, rpcResult.getErrors());
} else {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions = rpcResult.getResult().getAction();
for (Action action : actions) {
actionKey = action.getKey().getOrder() + actionKey;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionClass = action.getAction();
if (actionClass instanceof OutputActionCase) {
listActionInfo.add(new ActionOutput(actionKey, ((OutputActionCase) actionClass).getOutputAction().getOutputNodeConnector()));
} else if (actionClass instanceof PushVlanActionCase) {
listActionInfo.add(new ActionPushVlan(actionKey));
} else if (actionClass instanceof SetFieldCase) {
if (((SetFieldCase) actionClass).getSetField().getVlanMatch() != null) {
int vlanVid = ((SetFieldCase) actionClass).getSetField().getVlanMatch().getVlanId().getVlanId().getValue();
listActionInfo.add(new ActionSetFieldVlanVid(actionKey, vlanVid));
}
} else if (actionClass instanceof NxActionResubmitRpcAddGroupCase) {
Short tableId = ((NxActionResubmitRpcAddGroupCase) actionClass).getNxResubmit().getTable();
listActionInfo.add(new ActionNxResubmit(actionKey, tableId));
} else if (actionClass instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase) {
NxRegLoad nxRegLoad = ((NxActionRegLoadNodesNodeTableFlowApplyActionsCase) actionClass).getNxRegLoad();
listActionInfo.add(new ActionRegLoad(actionKey, NxmNxReg6.class, nxRegLoad.getDst().getStart(), nxRegLoad.getDst().getEnd(), nxRegLoad.getValue().longValue()));
}
}
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when egress actions for interface {}", ifName, e);
}
return listActionInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project netvirt by opendaylight.
the class ElanDmacUtils method installDmacFlowsToExternalRemoteMacInBatch.
public List<ListenableFuture<Void>> installDmacFlowsToExternalRemoteMacInBatch(BigInteger dpnId, String extDeviceNodeId, Long elanTag, Long vni, String macAddress, String displayName, String interfaceName) throws ElanException {
Flow flow = buildDmacFlowForExternalRemoteMac(dpnId, extDeviceNodeId, elanTag, vni, macAddress, displayName);
Flow dropFlow = buildDmacFlowDropIfPacketComingFromTunnel(dpnId, extDeviceNodeId, elanTag, macAddress);
List<ListenableFuture<Void>> result = Lists.newArrayList(ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flow, dpnId), flow), ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(dropFlow, dpnId), dropFlow));
result.addAll(installEtreeDmacFlowsToExternalRemoteMacInBatch(dpnId, extDeviceNodeId, elanTag, vni, macAddress, displayName, interfaceName));
return result;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project netvirt by opendaylight.
the class ElanItmUtils method getExternalTunnelItmEgressAction.
/**
* Builds the list of actions to be taken when sending the packet over an
* external VxLan tunnel interface, such as stamping the VNI on the VxLAN
* header, setting the vlanId if it proceeds and output the packet over the
* right port.
*
* @param srcDpnId
* Dpn where the tunnelInterface is located
* @param torNode
* NodeId of the ExternalDevice where the packet must be sent to.
* @param vni
* Vni to be stamped on the VxLAN Header.
* @return the external itm egress action
*/
public List<Action> getExternalTunnelItmEgressAction(BigInteger srcDpnId, NodeId torNode, long vni) {
List<Action> result = Collections.emptyList();
GetExternalTunnelInterfaceNameInput input = new GetExternalTunnelInterfaceNameInputBuilder().setDestinationNode(torNode.getValue()).setSourceNode(srcDpnId.toString()).setTunnelType(TunnelTypeVxlan.class).build();
Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> output = itmRpcService.getExternalTunnelInterfaceName(input);
try {
if (output.get().isSuccessful()) {
GetExternalTunnelInterfaceNameOutput tunnelInterfaceNameOutput = output.get().getResult();
String tunnelIfaceName = tunnelInterfaceNameOutput.getInterfaceName();
LOG.debug("Received tunnelInterfaceName from getTunnelInterfaceName RPC {}", tunnelIfaceName);
result = buildTunnelItmEgressActions(tunnelIfaceName, vni);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error in RPC call getTunnelInterfaceName {}", e);
}
return result;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project netvirt by opendaylight.
the class ElanItmUtils method getExternalTunnelItmEgressAction.
public List<Action> getExternalTunnelItmEgressAction(BigInteger srcDpnId, String nexthopIP, long vni) {
List<Action> result = Collections.emptyList();
GetExternalTunnelInterfaceNameInput input = new GetExternalTunnelInterfaceNameInputBuilder().setDestinationNode(nexthopIP).setSourceNode(srcDpnId.toString()).setTunnelType(TunnelTypeVxlan.class).build();
Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> output = itmRpcService.getExternalTunnelInterfaceName(input);
try {
if (output.get().isSuccessful()) {
GetExternalTunnelInterfaceNameOutput tunnelInterfaceNameOutput = output.get().getResult();
String tunnelIfaceName = tunnelInterfaceNameOutput.getInterfaceName();
LOG.debug("Received tunnelInterfaceName from getTunnelInterfaceName RPC {}", tunnelIfaceName);
result = buildTunnelItmEgressActions(tunnelIfaceName, vni);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error in RPC call getTunnelInterfaceName {}", e);
}
return result;
}
Aggregations