Search in sources :

Example 96 with ElanInstance

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);
    }
}
Also used : EtreeLeafTagName(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName)

Example 97 with ElanInstance

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);
}
Also used : ActionGroup(org.opendaylight.genius.mdsalutil.actions.ActionGroup) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) Bucket(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket) ActionGroup(org.opendaylight.genius.mdsalutil.actions.ActionGroup) ArrayList(java.util.ArrayList) BigInteger(java.math.BigInteger)

Example 98 with ElanInstance

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;
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) ArrayList(java.util.ArrayList) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) ElanInstances(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanInstances) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) HashSet(java.util.HashSet)

Example 99 with ElanInstance

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);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) MacTable(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.forwarding.tables.MacTable)

Example 100 with ElanInstance

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);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) MacTable(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.forwarding.tables.MacTable)

Aggregations

ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)75 BigInteger (java.math.BigInteger)36 ArrayList (java.util.ArrayList)33 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)18 DpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.elan.dpn.interfaces.list.DpnInterfaces)16 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)14 Bucket (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket)14 ElanInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface)13 ElanDpnInterfacesList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.ElanDpnInterfacesList)12 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)11 EtreeInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeInstance)11 ElanDpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanDpnInterfaces)11 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)10 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)10 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)10 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)10 ElanInstanceBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstanceBuilder)10 ElanInstanceKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstanceKey)10 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)9 MacEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry)9