Package net.floodlightcontroller.routing

Examples of net.floodlightcontroller.routing.Link


            Set<NodePortTuple> nptSet = new HashSet<NodePortTuple>();
            Map<Long, Link> links = tree.getLinks();
            if (links == null) continue;
            for(long nodeId: links.keySet()) {
                Link l = links.get(nodeId);
                if (l == null) continue;
                NodePortTuple npt1 = new NodePortTuple(l.getSrc(), l.getSrcPort());
                NodePortTuple npt2 = new NodePortTuple(l.getDst(), l.getDstPort());
                nptSet.add(npt1);
                nptSet.add(npt2);
            }
            clusterBroadcastNodePorts.put(c.id, nptSet);
        }
View Full Code Here


            // The only possible non-null path for this case is
            // if srcId equals dstId --- and that too is an 'empty' path []

        } else if ((nexthoplinks!=null) && (nexthoplinks.get(srcId)!=null)) {
            while (srcId != dstId) {
                Link l = nexthoplinks.get(srcId);

                npt = new NodePortTuple(l.getSrc(), l.getSrcPort());
                switchPorts.addLast(npt);
                npt = new NodePortTuple(l.getDst(), l.getDstPort());
                switchPorts.addLast(npt);
                srcId = nexthoplinks.get(srcId).getDst();
            }
        }
        // else, no path exists, and path equals null
View Full Code Here

    // IRoutingEngineService interfaces
    protected boolean routeExists(long srcId, long dstId) {
        BroadcastTree bt = destinationRootedTrees.get(dstId);
        if (bt == null) return false;
        Link link = bt.getLinks().get(srcId);
        if (link == null) return false;
        return true;
    }
View Full Code Here

            } else if (links.size() == 2) {
                for(Link l: links) {
                    linkArray.add(l);
                }
                // now, there should be two links in [0] and [1].
                Link l1 = linkArray.get(0);
                Link l2 = linkArray.get(1);

                // check if these two are symmetric.
                if (l1.getSrc() != l2.getDst() ||
                        l1.getSrcPort() != l2.getDstPort() ||
                        l1.getDst() != l2.getSrc() ||
                        l1.getDstPort() != l2.getSrcPort()) {
                    bdPort = true;
                }
            }

            if (bdPort && (broadcastDomainPorts.contains(npt) == false)) {
View Full Code Here

        // If you need to handle tunnel links, this is a placeholder.
    }

    public void addOrUpdateLink(long srcId, short srcPort, long dstId,
                                short dstPort, LinkType type) {
        Link link = new Link(srcId, srcPort, dstId, dstPort);

        if (type.equals(LinkType.MULTIHOP_LINK)) {
            addPortToSwitch(srcId, srcPort);
            addPortToSwitch(dstId, dstPort);
            addLinkToStructure(switchPortLinks, link);
View Full Code Here

        }
    }

    public void removeLink(long srcId, short srcPort,
                           long dstId, short dstPort) {
        Link link = new Link(srcId, srcPort, dstId, dstPort);
        removeLink(link);
    }
View Full Code Here

                    long src = link.getSrc();
                    long dst = link.getDst();
                    short srcPort = link.getSrcPort();
                    short dstPort = link.getDstPort();
                    Link otherLink = new Link(dst, dstPort, src, srcPort);
                    LinkInfo otherInfo = links.get(otherLink);
                    LinkType otherType = null;
                    if (otherInfo != null)
                        otherType = ld.getLinkType(otherLink, otherInfo);
                    if (otherType == LinkType.DIRECT_LINK ||
View Full Code Here

                    long src = link.getSrc();
                    long dst = link.getDst();
                    short srcPort = link.getSrcPort();
                    short dstPort = link.getDstPort();
                    Link otherLink = new Link(dst, dstPort, src, srcPort);
                    LinkInfo otherInfo = links.get(otherLink);
                    LinkType otherType = null;
                    if (otherInfo != null)
                        otherType = ld.getLinkType(otherLink, otherInfo);
                    if (otherType == LinkType.MULTIHOP_LINK) {
View Full Code Here

        mockFloodlightProvider.setSwitches(switches);

        // Create the links between the switches
        // (Switch 4) --> (Switch 3) --> (Switch 2) --> (Switch 1)
        Map<Link, LinkInfo> links = new HashMap<Link, LinkInfo>();
        Link link = new Link(2L, (short) 3, 1L, (short) 1);
        Link link2 = new Link(3L, (short) 3, 2L, (short) 1);
        Link link3 = new Link(4L, (short) 3, 3L, (short) 1);
        LinkInfo linkinfo = null;
        links.put(link, linkinfo);
        links.put(link2, linkinfo);
        links.put(link3, linkinfo);
View Full Code Here

        // Create the links between the switches
        // (Switch 4 output port 3) --> (Switch 1 input port 1)
        // (Switch 3 output port 3) --> (Switch 1 input port 1)
        // (Switch 2 output port 3) --> (Switch 1 input port 1)
        Map<Link, LinkInfo> links = new HashMap<Link, LinkInfo>();
        Link link = new Link(2L, (short) 3, 1L, (short) 1);
        Link link2 = new Link(3L, (short) 3, 1L, (short) 1);
        Link link3 = new Link(4L, (short) 3, 1L, (short) 1);
        LinkInfo linkinfo = null;
        links.put(link, linkinfo);
        links.put(link2, linkinfo);
        links.put(link3, linkinfo);
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.routing.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.