diff options
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 1edc9b1e..186684a7 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -991,6 +991,15 @@ class OFPRolePropExperimenter(OFPPropCommonExperimenter4ByteData): pass +class OFPBundleProp(OFPPropBase): + _TYPES = {} + + +@OFPBundleProp.register_type(ofproto.OFPRPT_EXPERIMENTER) +class OFPBundlePropExperimenter(OFPPropCommonExperimenter4ByteData): + pass + + class OFPMatchField(StringifyMixin): _FIELDS_HEADERS = {} @@ -5786,3 +5795,58 @@ class OFPSetAsync(MsgBase): bin_props += p.serialize() self.buf += bin_props + + +@_set_msg_type(ofproto.OFPT_BUNDLE_CONTROL) +class OFPBundleCtrlMsg(MsgBase): + """ + Bundle control message + + The controller uses this message to create, destroy and commit bundles + + ================ ====================================================== + Attribute Description + ================ ====================================================== + bundle_id Id of the bundle + type One of the following values. + OFPBCT_OPEN_REQUEST + OFPBCT_OPEN_REPLY + OFPBCT_CLOSE_REQUEST + OFPBCT_CLOSE_REPLY + OFPBCT_COMMIT_REQUEST + OFPBCT_COMMIT_REPLY + OFPBCT_DISCARD_REQUEST + OFPBCT_DISCARD_REPLY + flags Bitmap of the following flags. + OFPBF_ATOMIC + OFPBF_ORDERED + properties List of ``OFPBundleProp`` subclass instance + ================ ====================================================== + + Example:: + + def send_bundle_control(self, datapath): + ofp = datapath.ofproto + ofp_parser = datapath.ofproto_parser + + req = ofp_parser.OFPBundleCtrlMsg(datapath, 7, + ofp.OFPBCT_OPEN_REQUEST, + [ofp.OFPBF_ATOMIC], []) + datapath.send_msg(req) + """ + def __init__(self, datapath, bundle_id, type_, flags, properties): + super(OFPBundleCtrlMsg, self).__init__(datapath) + self.bundle_id = bundle_id + self.type = type_ + self.flags = flags + self.properties = properties + + def _serialize_body(self): + bin_props = bytearray() + for p in self.properties: + bin_props += p.serialize() + + msg_pack_into(ofproto.OFP_BUNDLE_CTRL_MSG_PACK_STR, + self.buf, ofproto.OFP_HEADER_SIZE, self.bundle_id, + self.type, self.flags) + self.buf += bin_props |