Examples of OFVendor


Examples of org.openflow.protocol.OFVendor

    /**
     * Send an setL2TableSet message to the switch.
     */
    private void sendHandshakeL2TableSet() {
        OFVendor l2TableSet = (OFVendor)
                BasicFactory.getInstance().getMessage(OFType.VENDOR);
        l2TableSet.setXid(handshakeTransactionIds--);
        OFBsnL2TableSetVendorData l2TableSetData =
                new OFBsnL2TableSetVendorData(true,
                                              controller.getCoreFlowPriority());
        l2TableSet.setVendor(OFBigSwitchVendorData.BSN_VENDOR_ID);
        l2TableSet.setVendorData(l2TableSetData);
        l2TableSet.setLengthU(OFVendor.MINIMUM_LENGTH +
                              l2TableSetData.getLength());
        channel.write(Collections.singletonList(l2TableSet));
    }
View Full Code Here

Examples of org.openflow.protocol.OFVendor

            // Convert the role enum to the appropriate integer constant used
            // in the NX role request message
            int nxRole = role.toNxRole();

            // Construct the role request message
            OFVendor roleRequest = (OFVendor)BasicFactory.getInstance()
                    .getMessage(OFType.VENDOR);
            roleRequest.setXid(xid);
            roleRequest.setVendor(OFNiciraVendorData.NX_VENDOR_ID);
            OFRoleRequestVendorData roleRequestData = new OFRoleRequestVendorData();
            roleRequestData.setRole(nxRole);
            roleRequest.setVendorData(roleRequestData);
            roleRequest.setLengthU(OFVendor.MINIMUM_LENGTH +
                    roleRequestData.getLength());

            // Send it to the switch
            sw.write(Collections.<OFMessage>singletonList(roleRequest),
                     new FloodlightContext());
View Full Code Here

Examples of org.openflow.protocol.OFVendor

     */
    private void verifyRoleRequest(OFMessage m,
                                   int expectedXid,
                                   Role expectedRole) {
        assertEquals(OFType.VENDOR, m.getType());
        OFVendor vendorMsg = (OFVendor)m;
        assertEquals(expectedXid, vendorMsg.getXid());
        assertEquals(OFNiciraVendorData.NX_VENDOR_ID, vendorMsg.getVendor());
        assertTrue("Vendor data is not an instance of OFRoleRequestVendorData"
                   + " its class is: " + vendorMsg.getVendorData().getClass().getName(),
                   vendorMsg.getVendorData() instanceof OFRoleRequestVendorData);
        OFRoleRequestVendorData requestData =
                (OFRoleRequestVendorData)vendorMsg.getVendorData();
        assertEquals(expectedRole.toNxRole(), requestData.getRole());
    }
View Full Code Here

Examples of org.openflow.protocol.OFVendor

        verify(sw);
    }

    /** Return a Nicira RoleReply message for the given role */
    private OFMessage getRoleReply(int xid, Role role) {
        OFVendor vm = (OFVendor)BasicFactory.getInstance()
                .getMessage(OFType.VENDOR);
        vm.setXid(xid);
        vm.setVendor(OFNiciraVendorData.NX_VENDOR_ID);
        OFRoleReplyVendorData replyData = new OFRoleReplyVendorData();
        replyData.setRole(role.toNxRole());
        vm.setVendorData(replyData);
        return vm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.