diff --git a/pyof/v0x04/symmetric/experimenter.py b/pyof/v0x04/symmetric/experimenter.py new file mode 100644 index 000000000..aab83a7e6 --- /dev/null +++ b/pyof/v0x04/symmetric/experimenter.py @@ -0,0 +1,49 @@ +"""Defines Experimenter message.""" + +# System imports + +# Third-party imports + +from pyof.v0x04.common.header import Header, Type +from pyof.foundation.base import GenericMessage +from pyof.foundation.basic_types import UBInt32 + +__all__ = ('ExperimenterHeader',) + +# Classes + + +class ExperimenterHeader(GenericMessage): + """OpenFlow Experimenter message. + + The experimenter field is a 32-bit value that uniquely identifies the + experimenter. If the most significant byte is zero, the next three bytes + are the experimenter’s IEEE OUI. If the most significant byte is not zero, + it is a value allocated by the Open Networking Foundation. If experimenter + does not have (or wish to use) their OUI, they should contact the Open + Networking Foundation to obtain a unique experimenter ID. + + The rest of the body is uninterpreted by standard OpenFlow processing and + is arbitrarily defined by the corresponding experimenter. + + If a switch does not understand a experimenter extension, it must send an + OFPT_ERROR message with a OFPBRC_BAD_EXPERIMENTER error code and + OFPET_BAD_REQUEST error type. + """ + + header = Header(message_type=Type.OFPT_EXPERIMENTER) + experimenter = UBInt32() + exp_type = UBInt32() + + def __init__(self, xid=None, experimenter=None, exp_type=None): + """The constructor takes the parameters below. + + Args: + xid (int): xid to be used on the message header. + experimenter (int): Vendor ID: + MSB 0: low-order bytes are IEEE OUI. + MSB != 0: defined by ONF. + exp_type (int): Experimenter defined. + """ + super().__init__(xid) + self.vendor = vendor diff --git a/pyof/v0x04/symmetric/vendor_header.py b/pyof/v0x04/symmetric/vendor_header.py deleted file mode 100644 index 656e1e9c9..000000000 --- a/pyof/v0x04/symmetric/vendor_header.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Defines Vendor message.""" - -# System imports - -# Third-party imports - -from pyof.v0x04.common.header import Header, Type -from pyof.foundation.base import GenericMessage -from pyof.foundation.basic_types import UBInt32 - -__all__ = ('VendorHeader',) - -# Classes - - -class VendorHeader(GenericMessage): - """OpenFlow Vendor message. - - This message does not contain a body beyond the OpenFlow Header. - """ - - header = Header(message_type=Type.OFPT_VENDOR) - vendor = UBInt32() - - def __init__(self, xid=None, vendor=None): - """The constructor takes the parameters below. - - Args: - xid (int): xid to be used on the message header. - vendor (int): Vendor ID: - MSB 0: low-order bytes are IEEE OUI. - MSB != 0: defined by OpenFlow consortium. - """ - super().__init__(xid) - self.vendor = vendor