Package org.openflow.protocol

Examples of org.openflow.protocol.OFFeaturesReply


                (IFloodlightProviderService)getContext().getAttributes().
                get(IFloodlightProviderService.class.getCanonicalName());

        IOFSwitch sw = floodlightProvider.getSwitch(switchId);
        Future<OFFeaturesReply> future;
        OFFeaturesReply featuresReply = null;
        if (sw != null) {
            try {
                future = sw.querySwitchFeaturesReply();
                featuresReply = future.get(10, TimeUnit.SECONDS);
            } catch (Exception e) {
View Full Code Here


    }

    @JsonIgnore
    public OFFeaturesReply getFeaturesReply() {
        OFFeaturesReply fr = new OFFeaturesReply();
        fr.setDatapathId(dpid);
        fr.setBuffers(buffers);
        fr.setTables(tables);
        fr.setCapabilities(capabilities);
        fr.setActions(actions);
        fr.setPorts(toOFPhysicalPortList(ports));
        return fr;
    }
View Full Code Here

        forwarding.startUp(fmc);
        flowReconcileMgr.startUp(fmc);
        entityClassifier.startUp(fmc);
        verify(topology);

        swFeatures = new OFFeaturesReply();
        swFeatures.setBuffers(1000);
        // Mock switches
        sw1 = EasyMock.createMock(IOFSwitch.class);
        expect(sw1.getId()).andReturn(1L).anyTimes();
        expect(sw1.getBuffers()).andReturn(swFeatures.getBuffers()).anyTimes();
View Full Code Here

        desc.setSoftwareDescription("");
        return desc;
    }

    private static OFFeaturesReply createOFFeaturesReply() {
        OFFeaturesReply fr = new OFFeaturesReply();
        fr.setPorts(Collections.<OFPhysicalPort>emptyList());
        return fr;
    }
View Full Code Here

        IOFSwitchListener listener = createMock(IOFSwitchListener.class);
        controller.addOFSwitchListener(listener);
        replay(listener);


        OFFeaturesReply featuresReply = createOFFeaturesReply();
        featuresReply.setDatapathId(42L);
        OFDescriptionStatistics desc = createOFDescriptionStatistics();
        SwitchSyncRepresentation ssr =
                new SwitchSyncRepresentation(featuresReply, desc);
        storeClient.put(1L, ssr);
View Full Code Here

        //---------------------------------------

        // Switch 1
        // no actual IOFSwitch here because we simply add features reply
        // and desc stats to store
        OFFeaturesReply fr1a = createOFFeaturesReply();
        fr1a.setDatapathId(1L);
        OFPhysicalPort p = createOFPhysicalPort("P1", 1);
        ImmutablePort sw1p1 = ImmutablePort.fromOFPhysicalPort(p);
        List<OFPhysicalPort> ports1a = Collections.singletonList(p);
        fr1a.setPorts(ports1a);
        List<ImmutablePort> ports1aImmutable =
                ImmutablePort.immutablePortListOf(ports1a);
        // an alternative featuers reply
        OFFeaturesReply fr1b = createOFFeaturesReply();
        fr1b.setDatapathId(1L);
        p = new OFPhysicalPort();
        p = createOFPhysicalPort("P1", 1); // same port as above
        List<OFPhysicalPort> ports1b = new ArrayList<OFPhysicalPort>();
        ports1b.add(p);
        p = createOFPhysicalPort("P2", 42000);
        ImmutablePort sw1p2 = ImmutablePort.fromOFPhysicalPort(p);
        ports1b.add(p);
        fr1b.setPorts(ports1b);
        List<ImmutablePort> ports1bImmutable =
                ImmutablePort.immutablePortListOf(ports1b);

        // Switch 2
        // no actual IOFSwitch here because we simply add features reply
        // and desc stats to store
        OFFeaturesReply fr2a = createOFFeaturesReply();
        fr2a.setDatapathId(2L);
        ImmutablePort sw2p1 = sw1p1;
        List<OFPhysicalPort> ports2a = new ArrayList<OFPhysicalPort>(ports1a);
        fr2a.setPorts(ports2a);
        List<ImmutablePort> ports2aImmutable =
                ImmutablePort.immutablePortListOf(ports2a);
        // an alternative features reply
        OFFeaturesReply fr2b = createOFFeaturesReply();
        fr2b.setDatapathId(2L);
        p = new OFPhysicalPort();
        p = createOFPhysicalPort("P1", 2); // port number changed
        ImmutablePort sw2p1Changed = ImmutablePort.fromOFPhysicalPort(p);
        List<OFPhysicalPort> ports2b = Collections.singletonList(p);
        fr2b.setPorts(ports2b);

        // Switches 3 and 4 are create with default features reply and desc
        // so nothing to do here

        //---------------------------------------
View Full Code Here

    public void testSwitchActivatedWithAlreadyActiveSwitch() throws Exception {
        OFDescriptionStatistics oldDesc = createOFDescriptionStatistics();
        oldDesc.setDatapathDescription("Ye Olde Switch");
        OFDescriptionStatistics newDesc = createOFDescriptionStatistics();
        newDesc.setDatapathDescription("The new Switch");
        OFFeaturesReply featuresReply = createOFFeaturesReply();


        // Setup: add a switch to the controller
        IOFSwitch oldsw = createMock(IOFSwitch.class);
        setupSwitchForAddSwitch(oldsw, 0L, oldDesc, featuresReply);
View Full Code Here

    */
   @Test
   public void testNotifySwitchPoArtChanged() throws Exception {
       long dpid = 42L;

       OFFeaturesReply fr1 = createOFFeaturesReply();
       fr1.setDatapathId(dpid);
       OFPhysicalPort p1 = createOFPhysicalPort("Port1", 1);
       fr1.setPorts(Collections.singletonList(p1));

       OFFeaturesReply fr2 = createOFFeaturesReply();
       fr1.setDatapathId(dpid);
       OFPhysicalPort p2 = createOFPhysicalPort("Port1", 1);
       p2.setAdvertisedFeatures(0x2); // just some bogus values
       fr2.setPorts(Collections.singletonList(p2));

       OFDescriptionStatistics desc = createOFDescriptionStatistics();

       // activate switch
       IOFSwitch sw = doActivateNewSwitch(dpid, desc, fr1);
View Full Code Here

TOP

Related Classes of org.openflow.protocol.OFFeaturesReply

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.