use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance in project netvirt by opendaylight.
the class ElanInterfaceManager method setupEtreeUnknownDMacTable.
private void setupEtreeUnknownDMacTable(ElanInstance elanInfo, BigInteger dpId, long elanTag, WriteTransaction writeFlowGroupTx) {
EtreeLeafTagName etreeLeafTag = elanEtreeUtils.getEtreeLeafTagByElanTag(elanTag);
if (etreeLeafTag != null) {
long leafTag = etreeLeafTag.getEtreeLeafTag().getValue();
installRemoteUnknownFlow(elanInfo, dpId, leafTag, writeFlowGroupTx);
installLocalUnknownFlow(elanInfo, dpId, leafTag, writeFlowGroupTx);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance in project netvirt by opendaylight.
the class ElanInterfaceManager method removeElanBroadcastGroup.
public void removeElanBroadcastGroup(ElanInstance elanInfo, InterfaceInfo interfaceInfo, WriteTransaction deleteFlowGroupTx) {
int bucketId = 0;
int actionKey = 0;
Long elanTag = elanInfo.getElanTag();
List<Bucket> listBuckets = new ArrayList<>();
List<Action> listAction = new ArrayList<>();
listAction.add(new ActionGroup(++actionKey, ElanUtils.getElanLocalBCGId(elanTag)).buildAction());
listBuckets.add(MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
listBuckets.addAll(getRemoteBCGroupBucketInfos(elanInfo, bucketId, interfaceInfo, elanTag));
BigInteger dpnId = interfaceInfo.getDpId();
long groupId = ElanUtils.getElanRemoteBCGId(elanInfo.getElanTag());
Group group = MDSALUtil.buildGroup(groupId, elanInfo.getElanInstanceName(), GroupTypes.GroupAll, MDSALUtil.buildBucketLists(listBuckets));
LOG.trace("deleting the remoteBroadCast group:{}", group);
mdsalManager.removeGroupToTx(dpnId, group, deleteFlowGroupTx);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance in project netvirt by opendaylight.
the class NetworkL2gwDeviceInfoCli method doExecute.
@Override
protected Object doExecute() {
List<Node> nodes = new ArrayList<>();
Set<String> networks = new HashSet<>();
if (nodeId == null) {
Optional<Topology> topologyOptional = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, createHwvtepTopologyInstanceIdentifier());
if (topologyOptional.isPresent()) {
nodes = topologyOptional.get().getNode();
}
} else {
Optional<Node> nodeOptional = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, createInstanceIdentifier(new NodeId(new Uri(nodeId))));
if (nodeOptional.isPresent()) {
nodes.add(nodeOptional.get());
}
}
if (elanName == null) {
// get all elan instance
// get all device node id
// print result
Optional<ElanInstances> elanInstancesOptional = MDSALUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(ElanInstances.class).build());
if (elanInstancesOptional.isPresent()) {
List<ElanInstance> elans = elanInstancesOptional.get().getElanInstance();
if (elans != null) {
for (ElanInstance elan : elans) {
networks.add(elan.getElanInstanceName());
}
}
}
} else {
networks.add(elanName);
}
for (Node node : nodes) {
if (node.getNodeId().getValue().contains("physicalswitch")) {
continue;
}
Node hwvtepConfigNode = HwvtepUtils.getHwVtepNode(dataBroker, LogicalDatastoreType.CONFIGURATION, node.getNodeId());
Node hwvtepOpPsNode = getPSnode(node, LogicalDatastoreType.OPERATIONAL);
Node hwvtepConfigPsNode = null;
if (hwvtepOpPsNode != null) {
hwvtepConfigPsNode = HwvtepUtils.getHwVtepNode(dataBroker, LogicalDatastoreType.CONFIGURATION, hwvtepOpPsNode.getNodeId());
opPSNodes.put(node.getNodeId(), hwvtepOpPsNode);
}
opNodes.put(node.getNodeId(), node);
configNodes.put(node.getNodeId(), hwvtepConfigNode);
if (hwvtepConfigPsNode != null) {
configPSNodes.put(node.getNodeId(), hwvtepConfigPsNode);
}
}
for (String network : networks) {
session.getConsole().println("Network info for " + network);
for (Node node : nodes) {
if (node.getNodeId().getValue().contains("physicalswitch")) {
continue;
}
session.getConsole().println("Printing for node " + node.getNodeId().getValue());
process(node.getNodeId(), network);
}
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance in project netvirt by opendaylight.
the class ElanMacEntryListener method remove.
@Override
protected void remove(InstanceIdentifier<MacEntry> instanceIdentifier, MacEntry macEntry) {
LOG.info("ElanMacEntryListener : remove macEntry {} ", instanceIdentifier);
String elanName = instanceIdentifier.firstKeyOf(MacTable.class).getElanInstanceName();
ElanInstance elanInfo = elanInstanceCache.get(elanName).orNull();
if (EvpnUtils.getEvpnNameFromElan(elanInfo) == null) {
LOG.trace("ElanMacEntryListener : Remove evpnName is null for elan {} ", elanInfo);
return;
}
evpnUtils.withdrawPrefix(elanInfo, macEntry);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance in project netvirt by opendaylight.
the class ElanMacEntryListener method add.
@Override
protected void add(InstanceIdentifier<MacEntry> instanceIdentifier, MacEntry macEntry) {
LOG.info("ElanMacEntryListener : ADD macEntry {} ", instanceIdentifier);
String elanName = instanceIdentifier.firstKeyOf(MacTable.class).getElanInstanceName();
ElanInstance elanInfo = elanInstanceCache.get(elanName).orNull();
if (EvpnUtils.getEvpnNameFromElan(elanInfo) == null) {
LOG.trace("ElanMacEntryListener : Add evpnName is null for elan {} ", elanInfo);
return;
}
evpnUtils.advertisePrefix(elanInfo, macEntry);
}
Aggregations