ofproto_v1_[345]: Define common structure for experimenter property

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yusuke Iwase 2015-08-19 11:01:38 +09:00 committed by FUJITA Tomonori
parent e61ade46d9
commit 0b5dd61930
5 changed files with 31 additions and 4 deletions

View File

@ -1220,6 +1220,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

View File

@ -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

View File

@ -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):

View File

@ -1809,6 +1809,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

View File

@ -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):