Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com> --- ryu/ofproto/ofproto_v1_3.py | 9 +++++++++ ryu/ofproto/ofproto_v1_4.py | 9 +++++++++ ryu/ofproto/ofproto_v1_4_parser.py | 4 ++-- ryu/ofproto/ofproto_v1_5.py | 9 +++++++++ ryu/ofproto/ofproto_v1_5_parser.py | 4 ++-- 5 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_3.py b/ryu/ofproto/ofproto_v1_3.py index 366eaff..5fc1ae1 100644 --- a/ryu/ofproto/ofproto_v1_3.py +++ b/ryu/ofproto/ofproto_v1_3.py @@ -1219,6 +1219,15 @@ oxm_types = [ oxm_fields.generate(__name__) +# Note: struct ofp_prop_experimenter is specific to this implementation. +# It does not have a corresponding structure in the specification. +# This structure defines common structure for ofp_*_prop_experimenter. +# struct ofp_prop_experimenter +OFP_PROP_EXPERIMENTER_PACK_STR = '!HHII' +OFP_PROP_EXPERIMENTER_SIZE = 12 +assert (calcsize(OFP_PROP_EXPERIMENTER_PACK_STR) == + OFP_PROP_EXPERIMENTER_SIZE) + # define constants OFP_VERSION = 0x04 OFP_TCP_PORT = 6633 diff --git a/ryu/ofproto/ofproto_v1_4.py b/ryu/ofproto/ofproto_v1_4.py index 47c2f1a..345846e 100644 --- a/ryu/ofproto/ofproto_v1_4.py +++ b/ryu/ofproto/ofproto_v1_4.py @@ -1473,6 +1473,15 @@ OFP_BUNDLE_ADD_MSG_SIZE = 24 assert (calcsize(OFP_BUNDLE_ADD_MSG_PACK_STR) + OFP_HEADER_SIZE == OFP_BUNDLE_ADD_MSG_SIZE) +# Note: struct ofp_prop_experimenter is specific to this implementation. +# It does not have a corresponding structure in the specification. +# This structure defines common structure for ofp_*_prop_experimenter. +# struct ofp_prop_experimenter +OFP_PROP_EXPERIMENTER_PACK_STR = '!HHII' +OFP_PROP_EXPERIMENTER_SIZE = 12 +assert (calcsize(OFP_PROP_EXPERIMENTER_PACK_STR) == + OFP_PROP_EXPERIMENTER_SIZE) + # define constants OFP_VERSION = 0x05 OFP_TCP_PORT = 6653 diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 3cf2a40..f9efba5 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -893,8 +893,8 @@ class OFPPropCommonExperimenter4ByteData(StringifyMixin): @classmethod def parser(cls, buf): (type_, length, experimenter, exp_type) = struct.unpack_from( - ofproto.OFP_TABLE_MOD_PROP_EXPERIMENTER_PACK_STR, buf, 0) - data = buf[ofproto.OFP_TABLE_MOD_PROP_EXPERIMENTER_SIZE:length] + ofproto.OFP_PROP_EXPERIMENTER_PACK_STR, buf, 0) + data = buf[ofproto.OFP_PROP_EXPERIMENTER_SIZE:length] return cls(type_, length, experimenter, exp_type, data) def serialize(self): diff --git a/ryu/ofproto/ofproto_v1_5.py b/ryu/ofproto/ofproto_v1_5.py index e93a820..0fc22df 100644 --- a/ryu/ofproto/ofproto_v1_5.py +++ b/ryu/ofproto/ofproto_v1_5.py @@ -1808,6 +1808,15 @@ OFP_BUNDLE_ADD_MSG_SIZE = 24 assert (calcsize(OFP_BUNDLE_ADD_MSG_PACK_STR) + OFP_HEADER_SIZE == OFP_BUNDLE_ADD_MSG_SIZE) +# Note: struct ofp_prop_experimenter is specific to this implementation. +# It does not have a corresponding structure in the specification. +# This structure defines common structure for ofp_*_prop_experimenter. +# struct ofp_prop_experimenter +OFP_PROP_EXPERIMENTER_PACK_STR = '!HHII' +OFP_PROP_EXPERIMENTER_SIZE = 12 +assert (calcsize(OFP_PROP_EXPERIMENTER_PACK_STR) == + OFP_PROP_EXPERIMENTER_SIZE) + # define constants OFP_VERSION = 0x06 OFP_TCP_PORT = 6653 diff --git a/ryu/ofproto/ofproto_v1_5_parser.py b/ryu/ofproto/ofproto_v1_5_parser.py index c62bf75..e548f2e 100644 --- a/ryu/ofproto/ofproto_v1_5_parser.py +++ b/ryu/ofproto/ofproto_v1_5_parser.py @@ -1037,8 +1037,8 @@ class OFPPropCommonExperimenter4ByteData(StringifyMixin): @classmethod def parser(cls, buf): (type_, length, experimenter, exp_type) = struct.unpack_from( - ofproto.OFP_TABLE_MOD_PROP_EXPERIMENTER_PACK_STR, buf, 0) - data = buf[ofproto.OFP_TABLE_MOD_PROP_EXPERIMENTER_SIZE:length] + ofproto.OFP_PROP_EXPERIMENTER_PACK_STR, buf, 0) + data = buf[ofproto.OFP_PROP_EXPERIMENTER_SIZE:length] return cls(type_, length, experimenter, exp_type, data) def serialize(self): -- 1.9.1 ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel