I have no idea of your error, but you can not use "!8S". You need to take a
look of how to use struct:https://docs.python.org/3.0/library/struct.html
mentioned by Shinpei .
------------------
Distance ????
_____________________________________________________
School of Information and Communication Engineering
Beijing University of Posts and Telecommunications
Beijing 100876, PR China
??????????????????????????????????????????
_____________________________________________________
Mobile Phone:
(+86) 151-1698-3550 Beijing
E-mail:
[email protected]
[email protected]
Homepage:
http://www.muzixing.com
------------------ ???????? ------------------
??????: "Shinpei Muraoka";<[email protected]>;
????????: 2016??3??31??(??????) ????9:27
??????: "Monica.Rajasekaran"<[email protected]>;
"ryu-devel"<[email protected]>;
????: Re: [Ryu-devel] Create a new OpenFlow message
Hi,
> I suspect the line ??OFP_NEW_MSG_PACK_STR = '!8S'??. I might have given a
> wrong value there.
You have set the wrong format to OFP_NEW_MSG_PACK_STR.
You can not use 'S' to format of struct.calcsize().
Sorry, I do not know the value to be set in the PACK_STR value,
but please refer to following about the format of struct.calcsize().
https://docs.python.org/3.0/library/struct.html
Maybe...I think "OFP_NEW_MSG_PACK_STR = '!8s'" is correct.
Thanks,
On 2016??03??31?? 00:56, Rajasekaran, Monica wrote:
> I suspect the line ??OFP_NEW_MSG_PACK_STR = '!8S'??. I might have given a
> wrong value there.
>
> But, I am not able to find a good explanation on the notation used for
> each message??s PACK_STR value.
>
> If anyone has information on that, will be great !
>
> /Thanks /
>
> *From:*Rajasekaran, Monica
> *Sent:* Wednesday, March 30, 2016 10:45 AM
> *To:* '????-????' <[email protected]>; 'ryu-devel'
> <[email protected]>
> *Subject:* RE: Re:[Ryu-devel] Create a new OpenFlow message
>
> Hi,
>
> I followed the steps in the link to create a new OpenFlow message type
> but I get an ??*_error (attached image)??_* after I recompile and run
> ryu-manager.
>
> The steps I followed are:
>
> 1.Added the following to ofproto_v1_3.py:
>
> 2.OFPT_NEW_MSG = 30 # User Added
>
> # struct ofp_new_msg
> OFP_NEW_MSG_PACK_STR = '!8S'
> OFP_NEW_MSG_SIZE = 16
> assert (calcsize(OFP_NEW_MSG_PACK_STR) + OFP_HEADER_SIZE ==
> OFP_NEW_MSG_SIZE)
>
> 3.Added the following to ofproto_v1_3_parser.py:
>
> 4.@_register_parser
> @_set_msg_type(ofproto.OFPT_NEW_MSG)
> class OFPNEWMSG(MsgBase):
> """
> USER ADDED CLASS FOR NEW MESSAGE
>
> """
> def __init__(self, datapath, data=None):
> super(OFPNEWMSG,self).__init__(datapath)
> self.data=data
>
> @classmethod
> def parser(cls, datapath, version, MSG_TYPE, msg_len, XID, buf):
> msg = super(OFPNEWMSG,cls).parser(datapath, version, MSG_TYPE,
> msg_len, XID, buf)
> offset = ofproto.OFP_HELLO_HEADER_SIZE
> data= struct.unpack_from(ofproto.OFP_NEW_MSG_PACK_STR, msg.buf,
> offset)
> msg.data=data
> return msg
>
> def _serialize_body(self):
> msg_pack_into(ofproto.OFP_NEW_MSG_PACK_STR, self.buf,
> ofproto.OFP_HEADER_SIZE, self.data)
>
> 5.Recompiled using ??python ./setup.py install??
>
> 6.Ran ryu-manager --verbose
>
> Any help is appreciated.
>
> /Thanks /
>
> *From:*Rajasekaran, Monica
> *Sent:* Tuesday, March 29, 2016 4:17 PM
> *To:* '????-????' <[email protected] <mailto:[email protected]>>;
> ryu-devel <[email protected]
> <mailto:[email protected]>>
> *Subject:* RE: Re:[Ryu-devel] Create a new OpenFlow message
>
> Hi,
>
> Thanks for the useful link. I will try it out by including the structure
> of the message in ofproto_v1_3.py and adding a definition to
> ofproto_v1_3_parser.py. Will send out an update on the same.
>
> /Thanks/
>
> *From:*????-????[mailto:[email protected]]
> *Sent:* Monday, March 28, 2016 8:26 PM
> *To:* Rajasekaran, Monica <[email protected]
> <mailto:[email protected]>>; ryu-devel
> <[email protected] <mailto:[email protected]>>
> *Subject:* Re:[Ryu-devel] Create a new OpenFlow message
>
> You can find useful info at:
>
> http://www.muzixing.com/pages/2015/11/20/ji-yu-ryuda-zao-zi-ding-yi-kong-zhi-qi.html
>
> please locate the info at the context of ??????????.
>
> ------------------
>
> Distance ????
>
> _____________________________________________________
>
> School of Information and Communication Engineering
> Beijing University of Posts and Telecommunications
>
> Beijing 100876, PR China
>
>
> ??????????????????????????????????????????
>
> _____________________________________________________
>
> Mobile Phone:
> (+86) 151-1698-3550 Beijing
>
> E-mail:
>
> [email protected] <mailto:[email protected]>
>
> [email protected] <mailto:[email protected]>
>
> Homepage:
>
> http://www.muzixing.com
>
> ------------------ Original ------------------
>
> *From:*"Rajasekaran, Monica"<[email protected]
> <mailto:[email protected]>>;
>
> *Date:*2016??3??29??(??????) ????5:38
>
> *To:*"ryu-devel"<[email protected]
> <mailto:[email protected]>>;
>
> *Subject:*[Ryu-devel] Create a new OpenFlow message
>
> Hello,
>
> I am a newbie to the Ryu Controller source code. I wish to create a new
> Openflow message and send it to my OVS. Could someone provide me with
> some guidance on how to proceed ?
>
> I have already instructed my OVS on how to handle the same, trying to
> figure out the controller part.
>
> /Thanks./
>
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel