Package net.floodlightcontroller.packet

Examples of net.floodlightcontroller.packet.Ethernet.deserialize()


            OFPacketOut p = (OFPacketOut) m;
           
            // No MAC match if packetOut doesn't have the packet.
            if (p.getPacketData() == null) return null;
           
            eth.deserialize(p.getPacketData(), 0, p.getPacketData().length);
        } else if (m.getType() == OFType.FLOW_MOD) {
            // flow-mod can't be matched by mac.
            return null;
        }
View Full Code Here


                    return;
                }

                if (Controller.ALWAYS_DECODE_ETH) {
                    eth = new Ethernet();
                    eth.deserialize(pi.getPacketData(), 0,
                            pi.getPacketData().length);
                    counterStore.updatePacketInCountersLocal(sw, m, eth);
                }
                // fall through to default case...
View Full Code Here

                                              IDevice srcDevice,
                                              IDevice dstDevice) {
        if (OFType.PACKET_IN.equals(m.getType())) {
            OFPacketIn pi = (OFPacketIn)m;
            Ethernet eth = new Ethernet();
            eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
            IFloodlightProviderService.bcStore.put(bc,
                    IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                    eth);
        }
        if (srcDevice != null) {
View Full Code Here

            Command result = Command.CONTINUE;
            Iterator<IOFMessageListener> it = theListeners.iterator();
            if (OFType.PACKET_IN.equals(msg.getType())) {
                OFPacketIn pi = (OFPacketIn)msg;
                Ethernet eth = new Ethernet();
                eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
                IFloodlightProviderService.bcStore.put(bc,
                        IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                        eth);
            }
            while (it.hasNext() && !Command.STOP.equals(result)) {
View Full Code Here

        /* TEST1: See basic packet flow */
        OFPacketIn pi;
        pi = createPacketIn(mac1, mac2, srcIp, dstIp, vlan);
        FloodlightContext cntx = new FloodlightContext();
        Ethernet eth = new Ethernet();
        eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
        IFloodlightProviderService.bcStore.put(cntx,
                IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                eth);
        Command ret;
        ret = ldm.receive(mockSwitch, pi, cntx);
View Full Code Here

        assertEquals(Command.STOP, ret);
        /* Verify that if we send a packet with another MAC it still works */
        pi = createPacketIn(mac2, mac3, srcIp, dstIp, vlan);
        cntx = new FloodlightContext();
        eth = new Ethernet();
        eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
        IFloodlightProviderService.bcStore.put(cntx,
                IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                eth);
        ret = ldm.receive(mockSwitch, pi, cntx);
        assertEquals(Command.CONTINUE, ret);
View Full Code Here

         * as well.
         */
        pi = createPacketIn(mac3, mac1, srcIp, dstIp, vlan);
        cntx = new FloodlightContext();
        eth = new Ethernet();
        eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
        IFloodlightProviderService.bcStore.put(cntx,
                IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                eth);
        ret = ldm.receive(mockSwitch, pi, cntx);
        assertEquals(Command.STOP, ret);
View Full Code Here

    private Command dispatchPacketIn(long swId, OFPacketIn pi,
                                     FloodlightContext cntx) {
        IOFSwitch sw = mockFloodlightProvider.getSwitch(swId);
        Ethernet eth = new Ethernet();
        eth.deserialize(pi.getPacketData(), 0, pi.getPacketData().length);
        IFloodlightProviderService.bcStore.put(cntx,
                IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                eth);
        return deviceManager.receive(sw, pi, cntx);
    }
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.