On Tue, 5 Mar 2013 21:59:02 +0000 Zhang Dongya <[email protected]> wrote:
> From: Zhang Dongya <[email protected]> > > > Signed-off-by: Zhang Dongya <[email protected]> > --- > ryu/ofproto/ofproto_v1_3.py | 2 +- > ryu/ofproto/ofproto_v1_3_parser.py | 18 +++++++++++++++--- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/ryu/ofproto/ofproto_v1_3.py b/ryu/ofproto/ofproto_v1_3.py > index f7da873..4699aef 100644 > --- a/ryu/ofproto/ofproto_v1_3.py > +++ b/ryu/ofproto/ofproto_v1_3.py > @@ -406,7 +406,7 @@ OFPFF_NO_PKT_COUNTS = 1 << 3 # Don't keep track of > packet count. > OFPFF_NO_BYT_COUNTS = 1 << 4 # Don't keep track of byte count. > > # struct ofp_group_mod > -OFP_GROUP_MOD_PACK_STR = '!HBBI' > +OFP_GROUP_MOD_PACK_STR = '!HBxI' > OFP_GROUP_MOD_SIZE = 16 > assert (calcsize(OFP_GROUP_MOD_PACK_STR) + OFP_HEADER_SIZE == > OFP_GROUP_MOD_SIZE) > diff --git a/ryu/ofproto/ofproto_v1_3_parser.py > b/ryu/ofproto/ofproto_v1_3_parser.py > index 0d0bc66..3916168 100644 > --- a/ryu/ofproto/ofproto_v1_3_parser.py > +++ b/ryu/ofproto/ofproto_v1_3_parser.py > @@ -1894,6 +1894,19 @@ class OFPBucket(object): > > return msg > > + def serialize(self, buf, offset): > + action_offset = offset + ofproto_v1_3.OFP_BUCKET_SIZE > + action_len = 0 > + for a in self.actions: > + a.serialize(buf, action_offset) > + action_offset += a.len > + action_len += a.len > + > + self.len = utils.round_up(ofproto_v1_3.OFP_BUCKET_SIZE + action_len, > + 8) > + msg_pack_into(ofproto_v1_3.OFP_BUCKET_PACK_STR, buf, offset, > + self.len, self.weight, self.watch_port, > self.watch_group) > + > > @_set_msg_type(ofproto_v1_3.OFPT_GROUP_MOD) > class OFPGroupMod(MsgBase): > @@ -1909,12 +1922,11 @@ class OFPGroupMod(MsgBase): > ofproto_v1_3.OFP_HEADER_SIZE, > self.command, self.type, self.group_id) > > - offset = ofproto_v1_3.OFP_HEADER_SIZE + > ofproto_v1_3.OFP_GROUP_MOD_SIZE > + offset = ofproto_v1_3.OFP_GROUP_MOD_SIZE > for b in self.buckets: > - b.serialize(self, buf, offset) > + b.serialize(self.buf, offset) > offset += b.len > > - Removing the above line leads to pep8 warning: fujita@rouen:~/git/ryu$ ./run_tests.sh -p Running pep8 ... ryu/ofproto/ofproto_v1_3_parser.py:1930:1: E302 expected 2 blank lines, found 1 @_set_msg_type(ofproto_v1_3.OFPT_PORT_MOD) ^ I've fixed it and applied this patch. Thanks! ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
