Package net.floodlightcontroller.devicemanager

Examples of net.floodlightcontroller.devicemanager.SwitchPort


        int iSrcDaps = 0, iDstDaps = 0;

        // following Forwarding's same routing routine, retrieve both in-bound and out-bound routes for
        // all clusters.
        while ((iSrcDaps < srcDaps.length) && (iDstDaps < dstDaps.length)) {
            SwitchPort srcDap = srcDaps[iSrcDaps];
            SwitchPort dstDap = dstDaps[iDstDaps];
            Long srcCluster =
                    topology.getL2DomainId(srcDap.getSwitchDPID());
            Long dstCluster =
                    topology.getL2DomainId(dstDap.getSwitchDPID());

            int srcVsDest = srcCluster.compareTo(dstCluster);
            if (srcVsDest == 0) {
                if (!srcDap.equals(dstDap) &&
                        (srcCluster != null) &&
                        (dstCluster != null)) {
                    Route routeIn =
                            routingEngine.getRoute(srcDap.getSwitchDPID(),
                                                   (short)srcDap.getPort(),
                                                   dstDap.getSwitchDPID(),
                                                   (short)dstDap.getPort(), 0);
                    Route routeOut =
                            routingEngine.getRoute(dstDap.getSwitchDPID(),
                                                   (short)dstDap.getPort(),
                                                   srcDap.getSwitchDPID(),
                                                   (short)srcDap.getPort(), 0);

                    // use static flow entry pusher to push flow mod along in and out path
                    // in: match src client (ip, port), rewrite dest from vip ip/port to member ip/port, forward
View Full Code Here


            Arrays.sort(dstDaps, clusterIdComparator);

            int iSrcDaps = 0, iDstDaps = 0;

            while ((iSrcDaps < srcDaps.length) && (iDstDaps < dstDaps.length)) {
                SwitchPort srcDap = srcDaps[iSrcDaps];
                SwitchPort dstDap = dstDaps[iDstDaps];

                // srcCluster and dstCluster here cannot be null as
                // every switch will be at least in its own L2 domain.
                Long srcCluster =
                        topology.getL2DomainId(srcDap.getSwitchDPID());
                Long dstCluster =
                        topology.getL2DomainId(dstDap.getSwitchDPID());

                int srcVsDest = srcCluster.compareTo(dstCluster);
                if (srcVsDest == 0) {
                    if (!srcDap.equals(dstDap)) {
                        Route route =
                                routingEngine.getRoute(srcDap.getSwitchDPID(),
                                                       (short)srcDap.getPort(),
                                                       dstDap.getSwitchDPID(),
                                                       (short)dstDap.getPort(), 0); //cookie = 0, i.e., default route
                        if (route != null) {
                            if (log.isTraceEnabled()) {
                                log.trace("pushRoute match={} route={} " +
                                          "destination={}:{}",
                                          new Object[] {match, route,
                                                        dstDap.getSwitchDPID(),
                                                        dstDap.getPort()});
                            }
                            long cookie =
                                    AppCookie.makeCookie(FORWARDING_APP_ID, 0);

                            // if there is prior routing decision use wildcard
View Full Code Here

            if (macBlockedCache.update(srcMac.toLong())) {
                return;
            }
            // write out drop flow per srcMac
            int port = pin.getInPort();
            SwitchPort swPort = new SwitchPort(getId(), port);
            ForwardingBase.blockHost(floodlightProvider,
                    swPort, srcMac.toLong(), (short) 5,
                    AppCookie.makeCookie(OFSWITCH_APP_ID, 0));
            floodlightProvider.addSwitchEvent(this.datapathId,
                    "SWITCH_PORT_BLOCKED_TEMPORARILY " +
View Full Code Here

            // Check if we already pushed a flow in the last 5 seconds
            if (portBlockedCache.update(port)) {
                return;
            }
            // write out drop flow per port
            SwitchPort swPort = new SwitchPort(getId(), port);
            ForwardingBase.blockHost(floodlightProvider,
                    swPort, -1L, (short) 5,
                    AppCookie.makeCookie(OFSWITCH_APP_ID, 1));
            floodlightProvider.addSwitchEvent(this.datapathId,
                    "SWITCH_PORT_BLOCKED_TEMPORARILY " +
View Full Code Here

         logListeners();
    }

    @Override
    public void addSuppressAPs(long swId, short port) {
        suppressAPs.add(new SwitchPort(swId, port));
    }
View Full Code Here

        suppressAPs.add(new SwitchPort(swId, port));
    }

    @Override
    public void removeSuppressAPs(long swId, short port) {
        suppressAPs.remove(new SwitchPort(swId, port));
    }
View Full Code Here

                                             int switchPort) {
        if (topology.isAttachmentPointPort(switchDPID,
                                           (short)switchPort) == false)
            return false;

        if (suppressAPs.contains(new SwitchPort(switchDPID, switchPort)))
            return false;

        return true;
    }
View Full Code Here

        if (oldAPs != null) oldAPList.addAll(oldAPs);
        removeExpiredAttachmentPoints(oldAPList);

        if (oldAPList != null) {
            for(AttachmentPoint ap: oldAPList) {
                SwitchPort swport = new SwitchPort(ap.getSw(),
                                                   ap.getPort());
                    sp.add(swport);
            }
        }
        return sp.toArray(new SwitchPort[sp.size()]);
View Full Code Here

        // copy ap list.
        List<AttachmentPoint> apList = attachmentPoints;

        if (apList != null) {
            for(AttachmentPoint ap: apList) {
                SwitchPort swport = new SwitchPort(ap.getSw(),
                                                   ap.getPort());
                    sp.add(swport);
            }
        }

        if (!includeError)
            return sp.toArray(new SwitchPort[sp.size()]);

        List<AttachmentPoint> oldAPList;
        oldAPList = new ArrayList<AttachmentPoint>();

        if (oldAPs != null) oldAPList.addAll(oldAPs);

        if (removeExpiredAttachmentPoints(oldAPList))
            this.oldAPs = oldAPList;

        List<AttachmentPoint> dupList;
        // get AP map.
        Map<Long, AttachmentPoint> apMap = getAPMap(apList);
        dupList = this.getDuplicateAttachmentPoints(oldAPList, apMap);
        if (dupList != null) {
            for(AttachmentPoint ap: dupList) {
                SwitchPort swport = new SwitchPort(ap.getSw(),
                                                   ap.getPort(),
                                                   ErrorStatus.DUPLICATE_DEVICE);
                    sp.add(swport);
            }
        }
View Full Code Here

    public RoutingDecision(long swDipd,
                                  short inPort,
                                  IDevice srcDevice,
                                  RoutingAction action) {
        this.srcPort = new SwitchPort(swDipd, inPort);
        this.srcDevice = srcDevice;
        this.destDevices =
                Collections.synchronizedList(new ArrayList<IDevice>());
        this.broadcastIntertfaces =
                Collections.synchronizedList(new ArrayList<SwitchPort>());
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.devicemanager.SwitchPort

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.