summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-02-20 09:11:02 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-26 23:39:27 +0900
commit5309a5649fada04ce5c03423b738de8e1f1c7bea (patch)
treef8e429d15d2f20f666548dbc9175999e4b2b02e5
parent60411c3f7a77512674fe5a88a561d7b31fa8db84 (diff)
of14: Add table desc request and reply message support
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_4_parser.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index 0da6c069..e5e58ef1 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -2344,6 +2344,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)
+
+
+@OFPMultipartReply.register_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 = {}