Package org.openflow.protocol.factory

Examples of org.openflow.protocol.factory.OFMessageFactory


                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00 };
        OFMessageFactory factory = BasicFactory.getInstance();
        ChannelBuffer oferrorBuf =
                ChannelBuffers.wrappedBuffer(oferrorRaw);
        List<OFMessage> msg = factory.parseMessage(oferrorBuf);
        TestCase.assertNotNull(msg);
        TestCase.assertEquals(msg.size(), 1);
        TestCase.assertEquals(76, msg.get(0).getLengthU());
        ChannelBuffer out = ChannelBuffers.dynamicBuffer();
        msg.get(0).writeTo(out);
View Full Code Here


                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                (byte) 0xff, 0x00, (byte) 0xff, (byte) 0xff };

        OFMessageFactory factory = BasicFactory.getInstance();
        ChannelBuffer packetBuf = ChannelBuffers.wrappedBuffer(packet);
        List<OFMessage> msg = factory.parseMessage(packetBuf);
        TestCase.assertNotNull(msg);
        TestCase.assertEquals(msg.size(), 1);
        TestCase.assertTrue(msg.get(0) instanceof OFStatisticsRequest);
        OFStatisticsRequest sr = (OFStatisticsRequest) msg.get(0);
        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
View Full Code Here

                (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x50, 0x04,
                0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x00, 0x00, 0x00,
                (byte) 0xff, (byte) 0xff, 0x4e, 0x20 };

        OFMessageFactory factory = BasicFactory.getInstance();
        ChannelBuffer packetBuf = ChannelBuffers.wrappedBuffer(packet);
        List<OFMessage> msg = factory.parseMessage(packetBuf);
        TestCase.assertNotNull(msg);
        TestCase.assertEquals(msg.size(), 1);
        TestCase.assertTrue(msg.get(0) instanceof OFStatisticsRequest);
        OFStatisticsRequest sr = (OFStatisticsRequest) msg.get(0);
        TestCase.assertEquals(OFStatisticsType.VENDOR, sr.getStatisticType());
View Full Code Here

                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0xc4, 0x00, 0x00, 0x00,
                0x08, 0x00, 0x02, 0x00, 0x00 };

        OFMessageFactory factory = BasicFactory.getInstance();
        ChannelBuffer packetBuf = ChannelBuffers.wrappedBuffer(packet);
        List<OFMessage> msg = factory.parseMessage(packetBuf);
        TestCase.assertNotNull(msg);
        TestCase.assertEquals(msg.size(), 1);
        TestCase.assertTrue(msg.get(0) instanceof OFStatisticsReply);
        OFStatisticsReply sr = (OFStatisticsReply) msg.get(0);
        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
View Full Code Here

                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00 };
        OFMessageFactory factory = new BasicFactory();
        ByteBuffer oferrorBuf = ByteBuffer.wrap(oferrorRaw);
        List<OFMessage> msgs = factory.parseMessages(oferrorBuf,
                oferrorRaw.length);
        TestCase.assertEquals(1, msgs.size());
        OFMessage msg = msgs.get(0);
        TestCase.assertEquals(76, msg.getLengthU());
        ByteBuffer out = ByteBuffer.allocate(1024);
View Full Code Here

                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                (byte) 0xff, 0x00, (byte) 0xff, (byte) 0xff };

        OFMessageFactory factory = new BasicFactory();
        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
        TestCase.assertEquals(1, msgs.size());
        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsRequest);
        OFStatisticsRequest sr = (OFStatisticsRequest) msgs.get(0);
        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
        TestCase.assertTrue(sr.getStatistics() instanceof OFFlowStatisticsRequest);
View Full Code Here

                (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x50, 0x04,
                0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x00, 0x00, 0x00,
                (byte) 0xff, (byte) 0xff, 0x4e, 0x20 };

        OFMessageFactory factory = new BasicFactory();
        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
        TestCase.assertEquals(1, msgs.size());
        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsRequest);
        OFStatisticsRequest sr = (OFStatisticsRequest) msgs.get(0);
        TestCase.assertEquals(OFStatisticsType.VENDOR, sr.getStatisticType());
        TestCase.assertTrue(sr.getStatistics() instanceof OFVendorStatistics);
View Full Code Here

                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0xc4, 0x00, 0x00, 0x00,
                0x08, 0x00, 0x02, 0x00, 0x00 };

        OFMessageFactory factory = new BasicFactory();
        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
        TestCase.assertEquals(1, msgs.size());
        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsReply);
        OFStatisticsReply sr = (OFStatisticsReply) msgs.get(0);
        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
        TestCase.assertEquals(3, sr.getStatistics().size());
View Full Code Here

TOP

Related Classes of org.openflow.protocol.factory.OFMessageFactory

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.