use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method getRemoteBCGroupBucketsOfElanL2GwDevices.
public List<Bucket> getRemoteBCGroupBucketsOfElanL2GwDevices(ElanInstance elanInfo, BigInteger dpnId, int bucketId) {
List<Bucket> listBucketInfo = new ArrayList<>();
ConcurrentMap<String, L2GatewayDevice> map = ElanL2GwCacheUtils.getInvolvedL2GwDevices(elanInfo.getElanInstanceName());
for (L2GatewayDevice device : map.values()) {
String interfaceName = elanItmUtils.getExternalTunnelInterfaceName(String.valueOf(dpnId), device.getHwvtepNodeId());
if (interfaceName == null) {
continue;
}
List<Action> listActionInfo = elanItmUtils.buildTunnelItmEgressActions(interfaceName, ElanUtils.getVxlanSegmentationId(elanInfo));
listBucketInfo.add(MDSALUtil.buildBucket(listActionInfo, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
}
return listBucketInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method getRemoteBCGroupBuckets.
@Nonnull
public List<Bucket> getRemoteBCGroupBuckets(ElanInstance elanInfo, DpnInterfaces dpnInterfaces, BigInteger dpnId, int bucketId, long elanTag) {
List<Bucket> listBucketInfo = new ArrayList<>();
ElanDpnInterfacesList elanDpns = elanUtils.getElanDpnInterfacesList(elanInfo.getElanInstanceName());
if (isVxlanNetworkOrVxlanSegment(elanInfo)) {
listBucketInfo.addAll(getRemoteBCGroupTunnelBuckets(elanDpns, dpnId, bucketId, elanUtils.isOpenstackVniSemanticsEnforced() ? elanUtils.getVxlanSegmentationId(elanInfo) : elanTag));
}
listBucketInfo.addAll(getRemoteBCGroupExternalPortBuckets(elanDpns, dpnInterfaces, dpnId, getNextAvailableBucketId(listBucketInfo.size())));
listBucketInfo.addAll(getRemoteBCGroupBucketsOfElanExternalTeps(elanInfo, dpnId, getNextAvailableBucketId(listBucketInfo.size())));
return listBucketInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method getRemoteBCGroupExternalPortBuckets.
private List<Bucket> getRemoteBCGroupExternalPortBuckets(ElanDpnInterfacesList elanDpns, DpnInterfaces dpnInterfaces, BigInteger dpnId, int bucketId) {
DpnInterfaces currDpnInterfaces = dpnInterfaces != null ? dpnInterfaces : getDpnInterfaces(elanDpns, dpnId);
if (currDpnInterfaces == null || !elanUtils.isDpnPresent(currDpnInterfaces.getDpId()) || currDpnInterfaces.getInterfaces() == null || currDpnInterfaces.getInterfaces().isEmpty()) {
return emptyList();
}
List<Bucket> listBucketInfo = new ArrayList<>();
for (String interfaceName : currDpnInterfaces.getInterfaces()) {
if (interfaceManager.isExternalInterface(interfaceName)) {
List<Action> listActionInfo = elanItmUtils.getExternalPortItmEgressAction(interfaceName);
if (!listActionInfo.isEmpty()) {
listBucketInfo.add(MDSALUtil.buildBucket(listActionInfo, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
}
}
}
return listBucketInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method setupLeavesEtreeBroadcastGroups.
public void setupLeavesEtreeBroadcastGroups(ElanInstance elanInfo, DpnInterfaces dpnInterfaces, BigInteger dpnId) {
EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
if (etreeInstance != null) {
long etreeLeafTag = etreeInstance.getEtreeLeafTagVal().getValue();
List<Bucket> listBucket = new ArrayList<>();
int bucketId = 0;
int actionKey = 0;
List<Action> listAction = new ArrayList<>();
listAction.add(new ActionGroup(ElanUtils.getEtreeLeafLocalBCGId(etreeLeafTag)).buildAction(++actionKey));
listBucket.add(MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
List<Bucket> listBucketInfoRemote = getRemoteBCGroupBuckets(elanInfo, dpnInterfaces, dpnId, bucketId, etreeLeafTag);
listBucket.addAll(listBucketInfoRemote);
long groupId = ElanUtils.getEtreeLeafRemoteBCGId(etreeLeafTag);
Group group = MDSALUtil.buildGroup(groupId, elanInfo.getElanInstanceName(), GroupTypes.GroupAll, MDSALUtil.buildBucketLists(listBucket));
LOG.trace("Installing the remote BroadCast Group:{}", group);
mdsalManager.syncInstallGroup(dpnId, group);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method setupStandardElanBroadcastGroups.
public void setupStandardElanBroadcastGroups(ElanInstance elanInfo, DpnInterfaces dpnInterfaces, BigInteger dpnId) {
List<Bucket> listBucket = new ArrayList<>();
int bucketId = 0;
int actionKey = 0;
Long elanTag = elanInfo.getElanTag();
List<Action> listAction = new ArrayList<>();
listAction.add(new ActionGroup(ElanUtils.getElanLocalBCGId(elanTag)).buildAction(++actionKey));
listBucket.add(MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
List<Bucket> listBucketInfoRemote = getRemoteBCGroupBuckets(elanInfo, dpnInterfaces, dpnId, bucketId, elanTag);
listBucket.addAll(listBucketInfoRemote);
long groupId = ElanUtils.getElanRemoteBCGId(elanTag);
Group group = MDSALUtil.buildGroup(groupId, elanInfo.getElanInstanceName(), GroupTypes.GroupAll, MDSALUtil.buildBucketLists(listBucket));
LOG.trace("Installing the remote BroadCast Group:{}", group);
mdsalManager.syncInstallGroup(dpnId, group);
}
Aggregations