summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-02-20 09:11:01 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-26 23:39:27 +0900
commit60411c3f7a77512674fe5a88a561d7b31fa8db84 (patch)
tree8615b485696db31a841775b63558014e7bb29df8
parent96f7f51762efda4e9890679ac5123b5d27c9a872 (diff)
of14: Add OFPTableDesc
This may be table status and table desc messages. 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.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index 74b2b9b1..0da6c069 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -1665,6 +1665,28 @@ class OFPPort(StringifyMixin):
return ofpport
+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