use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.Transport in project netvirt by opendaylight.
the class ElanDpnToTransportZoneListener method add.
@Override
protected void add(InstanceIdentifier<DpnInterfaces> key, DpnInterfaces dataObjectModification) {
LOG.debug("Elan dpn {} add detected, updating transport zones", dataObjectModification.getDpId());
BigInteger dpId = dataObjectModification.getDpId();
String elanInstanceName = key.firstKeyOf(ElanDpnInterfacesList.class).getElanInstanceName();
if (!ElanUtils.isVxlanNetworkOrVxlanSegment(elanInstanceCache.get(elanInstanceName).orNull())) {
return;
}
transportZoneNotificationUtil.updateTransportZone(elanInstanceName, dpId);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.Transport in project netvirt by opendaylight.
the class TransportZoneNotificationUtil method addVtep.
/**
* Tries to add a vtep for a transport zone.
*
* @return Whether a vtep was added or not.
*/
private boolean addVtep(TransportZone zone, String subnetIp, BigInteger dpnId, @Nullable String localIp) {
List<Subnets> zoneSubnets = zone.getSubnets();
if (zoneSubnets == null) {
return false;
}
Subnets subnets = getOrAddSubnet(zoneSubnets, subnetIp);
for (Vteps existingVtep : subnets.getVteps()) {
if (existingVtep.getDpnId().equals(dpnId)) {
return false;
}
}
if (localIp != null) {
IpAddress nodeIp = new IpAddress(localIp.toCharArray());
VtepsBuilder vtepsBuilder = new VtepsBuilder().setDpnId(dpnId).setIpAddress(nodeIp).setPortname(TUNNEL_PORT).setOptionOfTunnel(elanConfig.isUseOfTunnels());
subnets.getVteps().add(vtepsBuilder.build());
return true;
}
return false;
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.Transport in project netvirt by opendaylight.
the class OpenFlow13Provider method createEgressClassifierNextHopNoC1C2Flow.
/*
* Egress Classifier NextHop No C1/C2 flow:
* Set C1/C2 accordingly
* Match [C1, C2] == [0, 0], Move [TunIpv4Dst, TunVnid] to [C1, C2],
* Move Reg0 (SFF IP) to TunIpv4Dst, and goto Egress Classifier
* Transport Egress table on match
*/
public Flow createEgressClassifierNextHopNoC1C2Flow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchNshNsc1(match, DEFAULT_NSH_CONTEXT_VALUE);
OpenFlow13Utils.addMatchNshNsc2(match, DEFAULT_NSH_CONTEXT_VALUE);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxMoveReg0ToNsc1Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxMoveTunIdToNsc2Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxMoveReg6ToNsc4Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadTunId(SFC_TUNNEL_ID, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
OpenFlow13Utils.appendGotoTableInstruction(isb, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
String flowIdStr = EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE, EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY, EGRESS_CLASSIFIER_NEXTHOP_COOKIE, EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.Transport in project netvirt by opendaylight.
the class OpenFlow13Provider method createEgressClassifierNextHopC1C2Flow.
/*
* Egress Classifier NextHop with C1/C2 flow:
* Set C1/C2 accordingly
* MatchAny (C1, C2 already set) goto Egress Classifier
* Transport Egress table
*/
public Flow createEgressClassifierNextHopC1C2Flow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
InstructionsBuilder isb = OpenFlow13Utils.appendGotoTableInstruction(new InstructionsBuilder(), NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
String flowIdStr = EGRESS_CLASSIFIER_NEXTHOP_C1C2_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE, EGRESS_CLASSIFIER_NEXTHOP_C1C2_PRIORITY, EGRESS_CLASSIFIER_NEXTHOP_COOKIE, EGRESS_CLASSIFIER_NEXTHOP_C1C2_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.Transport in project genius by opendaylight.
the class ItmTzInstanceRecoveryHandler method recoverTransportZone.
private void recoverTransportZone(String entityId) throws InterruptedException {
// Get the transport Zone from the transport Zone Name
InstanceIdentifier<TransportZone> tzII = ItmUtils.getTZInstanceIdentifier(entityId);
TransportZone tz = ItmUtils.getTransportZoneFromConfigDS(entityId, dataBroker);
if (tz != null) {
// Delete the transportZone and re create it
jobCoordinator.enqueueJob(entityId, () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.delete(LogicalDatastoreType.CONFIGURATION, tzII))), ITMConstants.JOB_MAX_RETRIES);
jobCoordinator.enqueueJob(entityId, () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.CONFIGURATION, tzII, tz))), ITMConstants.JOB_MAX_RETRIES);
}
}
Aggregations