On Wed, Feb 19, 2014 at 05:22:42PM +0900, Simon Horman wrote: > Signed-off-by: Simon Horman <[email protected]> > --- > ryu/ofproto/ofproto_v1_4_parser.py | 77 > ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 77 insertions(+)
Sorry, this patch adds a duplicate OFPTableDesc class. I will re-post. > > diff --git a/ryu/ofproto/ofproto_v1_4_parser.py > b/ryu/ofproto/ofproto_v1_4_parser.py > index dba1220..26debbc 100644 > --- a/ryu/ofproto/ofproto_v1_4_parser.py > +++ b/ryu/ofproto/ofproto_v1_4_parser.py > @@ -1685,6 +1685,28 @@ class OFPTableDesc(StringifyMixin): > return ofptabledesc > > > +class OFPTableDesc(StringifyMixin): > + def __init__(self, length=None, table_id=None, config=None, > + properties=None): > + super(OFPTableDesc, self).__init__() > + self.table_id = table_id > + self.length = length > + self.config = config > + self.properties = properties > + > + @classmethod > + def parser(cls, buf, offset): > + (length, table_id, config) = struct.unpack_from( > + ofproto.OFP_TABLE_DESC_PACK_STR, buf, offset) > + props = [] > + rest = buf[offset + ofproto.OFP_TABLE_DESC_SIZE:offset + length] > + while rest: > + p, rest = OFPTableModProp.parse(rest) > + props.append(p) > + ofptabledesc = cls(length, table_id, config, props) > + return ofptabledesc > + > + > def _set_stats_type(stats_type, stats_body_cls): > def _set_cls_stats_type(cls): > cls.cls_stats_type = stats_type > @@ -2342,6 +2364,61 @@ class OFPPortDescStatsReply(OFPMultipartReply): > super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs) > > > +@_set_stats_type(ofproto.OFPMP_TABLE_DESC, OFPTableDesc) > +@_set_msg_type(ofproto.OFPT_MULTIPART_REQUEST) > +class OFPTableDescStatsRequest(OFPMultipartRequest): > + """ > + Table description request message > + > + The controller uses this message to query description of all the tables. > + > + ================ ====================================================== > + Attribute Description > + ================ ====================================================== > + flags Zero or ``OFPMPF_REQ_MORE`` > + ================ ====================================================== > + > + Example:: > + > + def send_tablet_desc_stats_request(self, datapath): > + ofp_parser = datapath.ofproto_parser > + > + req = ofp_parser.OFPTableDescStatsRequest(datapath, 0) > + datapath.send_msg(req) > + """ > + def __init__(self, datapath, flags=0, type_=None): > + super(OFPTableDescStatsRequest, self).__init__(datapath, flags) > + > + > [email protected]_stats_type() > +@_set_stats_type(ofproto.OFPMP_TABLE_DESC, OFPTableDesc) > +@_set_msg_type(ofproto.OFPT_MULTIPART_REPLY) > +class OFPTableDescStatsReply(OFPMultipartReply): > + """ > + Table description reply message > + > + The switch responds with this message to a table description request. > + > + ================ ====================================================== > + Attribute Description > + ================ ====================================================== > + body List of ``OFPTableDescStats`` instance > + ================ ====================================================== > + > + Example:: > + > + @set_ev_cls(ofp_event.EventOFPTableDescStatsReply, MAIN_DISPATCHER) > + def table_desc_stats_reply_handler(self, ev): > + tables = [] > + for p in ev.msg.body: > + tables.append('table_id=%d config=0x%08x properties=%s' % > + (p.table_id, p.config, repr(p.properties))) > + self.logger.debug('OFPTableDescStatsReply received: %s', ports) > + """ > + def __init__(self, datapath, type_=None, **kwargs): > + super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs) > + > + > class OFPQueueProp(OFPPropBase): > _TYPES = {} > > -- > 1.8.5.2 > ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
