Hi Thank you for fast reply. I need decision of message type because I would to implement a state machine based on that decision: arriving of packetOut to switch. In fact, I would to intercept PktOut. And how to do with @set_ev_cls()? Maurizio.
________________________________ Da: Shinpei Muraoka <shinpei.mura...@gmail.com> Inviato: martedì 13 settembre 2016 04.59 A: soldie...@hotmail.it; ryu-devel@lists.sourceforge.net Oggetto: Re: [Ryu-devel] Ho to extract message type (e.g. pktIN/pktOut) from OpenFlow v1.3 header structure? Hi, sorry. I responded a difficult answer. The following is example of the message type check. diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py index 3e7c598..89dedb9 100644 --- a/ryu/app/simple_switch_13.py +++ b/ryu/app/simple_switch_13.py @@ -76,6 +76,9 @@ class SimpleSwitch13(app_manager.RyuApp): parser = datapath.ofproto_parser in_port = msg.match['in_port'] + self.logger.info("msg.msg_type == ofproto.OFPT_PACKET_IN : %s", + msg.msg_type == ofproto.OFPT_PACKET_IN) + pkt = packet.Packet(msg.data) eth = pkt.get_protocols(ethernet.ethernet)[0] Message type for the check is defined in ofproto/ofproto_v1_3.py. Why do you need a decision of the message type? I think it can check of message type by @set_ev_cls(). Thanks, On 2016?09?12? 20:50, Maurizio Marrocco wrote: > Hi, Shinpei. Sorry if I'm disturbing. > I read the documentation > (http://ryu.readthedocs.io/en/latest/ofproto_base.html#base-class-for-openflow-messages) > but could not find examples of how to pick the type of message from the > header OpenFlow. > You could give me a hand? For example in simple_switch_13.py script, how > can I use the class: class ryu.ofproto.ofproto_parser.MsgBase (* args, > ** kwargs) to take msg_type == pktOut ? > Thanks so much. > Maurizio > > > > > > ------------------------------------------------------------------------ > *Da:* Shinpei Muraoka <shinpei.mura...@gmail.com> > *Inviato:* lunedì 12 settembre 2016 03.15 > *A:* soldie...@hotmail.it; ryu-devel@lists.sourceforge.net; > ryu-devel@lists.sourceforge.net > *Oggetto:* Re: [Ryu-devel] Ho to extract message type (e.g. > pktIN/pktOut) from OpenFlow v1.3 header structure? > > Hi, > > Please refer to the following for extraction method of the type of > OpenFlow message. > http://ryu.readthedocs.io/en/latest/ofproto_base.html#base-class-for-openflow-messages > > Also, Please refer to the chapter 7.1.1 of OpenFlow Spec version 1.3.5 > for the type of OpenFlow message. > > Thanks, > > On 2016?09?10? 22:55, Maurizio Marrocco wrote: >> Hi Ryu team. >> The question is the following: How to extract message ofp_type (e.g. >> OFPT_PACKET_OUT or OFPT_PACKET_IN) from openflow v1.3 ofp_header structure? >> I would to do this statement: >> >> if(header(received PDU)==PacketOut) >> do something. >> >> Have some reference in the documentation about this and in general to >> process the packets? >> PS: I'm using RYU 3.29 >> Thanks. >> Maurizio. >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> Ryu-devel mailing list >> Ryu-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/ryu-devel >>
------------------------------------------------------------------------------
_______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel