diff --git a/pyof/v0x05/common/header.py b/pyof/v0x05/common/header.py index 25670d46f..1acf849a5 100644 --- a/pyof/v0x05/common/header.py +++ b/pyof/v0x05/common/header.py @@ -60,9 +60,8 @@ class Type(IntEnum): # Queue Configuration messages # Controller/Switch message - #OFPT_QUEUE_GET_CONFIG_REQUEST = 22 - #OFPT_QUEUE_GET_CONFIG_REPLY = 23 - + # OFPT_QUEUE_GET_CONFIG_REQUEST = 22 + # OFPT_QUEUE_GET_CONFIG_REPLY = 23 # Controller role change request message # Controller/Switch message @@ -79,21 +78,20 @@ class Type(IntEnum): # Controller/Switch message OFPT_METER_MOD = 29 - - #Controller role change event messages - #Async message + # Controller role change event messages + # Async message OFPT_ROLE_STATUS = 30 - #Asynchronous message - #Async message + # Asynchronous message + # Async message OFPT_TABLE_STATUS = 31 - #Request forwarding by switch - #Async message + # Request forwarding by switch + # Async message OFPT_REQUESTFORWARD = 32 - #Bundle operations (Multiple messages as a single operation) - #Controller/Switch message + # Bundle operations (Multiple messages as a single operation) + # Controller/Switch message OFPT_BUNDLE_CONTROL = 33 OFPT_BUNDLE_ADD_MESSAGE = 34 @@ -108,7 +106,6 @@ class Header(GenericStruct): length = UBInt16() xid = UBInt32() - def __init__(self, message_type=None, length=None, xid=None): """Create a Header with the optional parameters below. diff --git a/pyof/v0x05/symmetric/hello.py b/pyof/v0x05/symmetric/hello.py index 392073b16..3a09d4176 100644 --- a/pyof/v0x05/symmetric/hello.py +++ b/pyof/v0x05/symmetric/hello.py @@ -2,8 +2,8 @@ # System imports -from pyof.foundation.base import GenericMessage, GenericStruct, IntEnum -from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16, UBInt32, TypeList +from pyof.foundation.base import GenericMessage, GenericStruct, Enum +from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16 from pyof.foundation.exceptions import PackException from pyof.v0x05.common.header import Header, Type @@ -14,7 +14,7 @@ # Enums -class HelloElemType(IntEnum): +class HelloElemType(Enum): """Hello element types.""" #: Bitmap of version supported. @@ -23,18 +23,16 @@ class HelloElemType(IntEnum): # Classes - class HelloElemHeader(GenericStruct): """Common header for all Hello Elements.""" - # One of OFPHET_*. type = UBInt16() # Length in bytes of element, including this header, excluding padding. length = UBInt16() # This variable does NOT appear in 1.4 specification # content = BinaryData() - def __init__(self, element_type=None, length=None, content=b''): + def __init__(self, element_type=None, length=None): """Create a HelloElemHeader with the optional parameters below. Args: @@ -109,7 +107,6 @@ def __init__(self, items=None): # super().append(items) - class Hello(GenericMessage): """OpenFlow Hello Message OFPT_HELLO. @@ -121,7 +118,6 @@ class Hello(GenericMessage): header = Header(Type.OFPT_HELLO) #: Hello element list - #: List of elements - 0 or more elements = ListOfHelloElements() def __init__(self, xid=None, elements=None): @@ -155,7 +151,3 @@ def __init__(self, length=None, bitmaps=None): """ super().__init__(HelloElemType.OFPHET_VERSIONBITMAP, length) self.bitmaps = bitmaps - - - -