Package akka.util

Examples of akka.util.ByteString.toArray()


      if (msg instanceof Received) {
        
         switch (this.state) {
         case STARTED:
            ByteString in = ((Received) msg).data();
            provider = factory.getMessageProvider(in.toArray());

            builder = new org.flowforwarding.warp.protocol.ofp.avro.OFMessage.OFMessageBuilder(in.toArray());           
            OFMessage inMsg = builder.value(in.toArray()).build();

            if ((provider != null) && (inMsg != null)) {
View Full Code Here


         switch (this.state) {
         case STARTED:
            ByteString in = ((Received) msg).data();
            provider = factory.getMessageProvider(in.toArray());

            builder = new org.flowforwarding.warp.protocol.ofp.avro.OFMessage.OFMessageBuilder(in.toArray());           
            OFMessage inMsg = builder.value(in.toArray()).build();

            if ((provider != null) && (inMsg != null)) {
                if (inMsg.type().equals("OFPT_HELLO")) {
                  log.info ("IN: Hello");
View Full Code Here

         case STARTED:
            ByteString in = ((Received) msg).data();
            provider = factory.getMessageProvider(in.toArray());

            builder = new org.flowforwarding.warp.protocol.ofp.avro.OFMessage.OFMessageBuilder(in.toArray());           
            OFMessage inMsg = builder.value(in.toArray()).build();

            if ((provider != null) && (inMsg != null)) {
                if (inMsg.type().equals("OFPT_HELLO")) {
                  log.info ("IN: Hello");
                    swRef.setVersion(builder.version());
View Full Code Here

            }
           
            break;
         case CONNECTED:  
            in = ((Received) msg).data();
            inMsg = builder.value(in.toArray()).build();
          
            if (inMsg.type().equals("OFPT_FEATURES_REPLY")) {
               log.info("IN: Features Reply");
               byte[] DPID = inMsg.field("datapath_id");
               swRef.setDpid(Convert.toLong(DPID));
View Full Code Here

           
            break;
           
         case HANDSHAKED:
            in = ((Received) msg).data();
            inMsg = builder.value(in.toArray()).build();
           
            if (inMsg.type().equals("OFPT_GET_CONFIG_REPLY")) {
               log.info("IN: Config Reply from Switch " + Long.toHexString(swRef.getDpid().longValue()));
              
               OFMessage flowMod = builder.type("ofp_flow_mod").build();
View Full Code Here

               tlv_fields.get("oxm_tlvs").add(tlv);
              
               tlv_fields.binary();*/
            }
           
            if (provider.isConfig(in.toArray())) {
               ofSessionHandler.tell(new OFEventSwitchConfig(swRef, provider.parseSwitchConfig(in.toArray())), getSelf());
            } else if (provider.isPacketIn(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) +" Packet-In is received from the Switch");
               ofSessionHandler.tell(new OFEventPacketIn(swRef, provider.parsePacketIn(in.toArray())), getSelf());
            else if (provider.isError(in.toArray())) {
View Full Code Here

              
               tlv_fields.binary();*/
            }
           
            if (provider.isConfig(in.toArray())) {
               ofSessionHandler.tell(new OFEventSwitchConfig(swRef, provider.parseSwitchConfig(in.toArray())), getSelf());
            } else if (provider.isPacketIn(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) +" Packet-In is received from the Switch");
               ofSessionHandler.tell(new OFEventPacketIn(swRef, provider.parsePacketIn(in.toArray())), getSelf());
            else if (provider.isError(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Error is received from the Switch ");
View Full Code Here

               tlv_fields.binary();*/
            }
           
            if (provider.isConfig(in.toArray())) {
               ofSessionHandler.tell(new OFEventSwitchConfig(swRef, provider.parseSwitchConfig(in.toArray())), getSelf());
            } else if (provider.isPacketIn(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) +" Packet-In is received from the Switch");
               ofSessionHandler.tell(new OFEventPacketIn(swRef, provider.parsePacketIn(in.toArray())), getSelf());
            else if (provider.isError(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Error is received from the Switch ");
               ofSessionHandler.tell(new OFEventError(swRef, provider.parseError(in.toArray())), getSelf());
View Full Code Here

           
            if (provider.isConfig(in.toArray())) {
               ofSessionHandler.tell(new OFEventSwitchConfig(swRef, provider.parseSwitchConfig(in.toArray())), getSelf());
            } else if (provider.isPacketIn(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) +" Packet-In is received from the Switch");
               ofSessionHandler.tell(new OFEventPacketIn(swRef, provider.parsePacketIn(in.toArray())), getSelf());
            else if (provider.isError(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Error is received from the Switch ");
               ofSessionHandler.tell(new OFEventError(swRef, provider.parseError(in.toArray())), getSelf());
            else if (provider.isEchoRequest(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Echo request is received from the Switch ");
View Full Code Here

            if (provider.isConfig(in.toArray())) {
               ofSessionHandler.tell(new OFEventSwitchConfig(swRef, provider.parseSwitchConfig(in.toArray())), getSelf());
            } else if (provider.isPacketIn(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) +" Packet-In is received from the Switch");
               ofSessionHandler.tell(new OFEventPacketIn(swRef, provider.parsePacketIn(in.toArray())), getSelf());
            else if (provider.isError(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Error is received from the Switch ");
               ofSessionHandler.tell(new OFEventError(swRef, provider.parseError(in.toArray())), getSelf());
            else if (provider.isEchoRequest(in.toArray())) {
               System.out.println("[OF-INFO] DPID: " + Long.toHexString(swRef.getDpid().longValue()) + " Echo request is received from the Switch ");
               getSender().tell(TcpMessage.write(ByteString.fromArray(provider.encodeEchoReply())), getSelf());
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.