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

Reply via email to