22
33# System imports
44
5- from pyof .foundation .base import GenericMessage , GenericStruct , IntEnum
6- from pyof .foundation .basic_types import BinaryData , FixedTypeList , UBInt16 , UBInt32 , TypeList
5+ from pyof .foundation .base import GenericMessage , GenericStruct , Enum
6+ from pyof .foundation .basic_types import BinaryData , FixedTypeList , UBInt16
77from pyof .foundation .exceptions import PackException
88from pyof .v0x05 .common .header import Header , Type
99
1414# Enums
1515
1616
17- class HelloElemType (IntEnum ):
17+ class HelloElemType (Enum ):
1818 """Hello element types."""
1919
2020 #: Bitmap of version supported.
@@ -23,18 +23,16 @@ class HelloElemType(IntEnum):
2323
2424# Classes
2525
26-
2726class HelloElemHeader (GenericStruct ):
2827 """Common header for all Hello Elements."""
2928
30- # One of OFPHET_*.
3129 type = UBInt16 ()
3230 # Length in bytes of element, including this header, excluding padding.
3331 length = UBInt16 ()
3432 # This variable does NOT appear in 1.4 specification
3533 # content = BinaryData()
3634
37- def __init__ (self , element_type = None , length = None , content = b'' ):
35+ def __init__ (self , element_type = None , length = None ):
3836 """Create a HelloElemHeader with the optional parameters below.
3937
4038 Args:
@@ -109,7 +107,6 @@ def __init__(self, items=None):
109107 # super().append(items)
110108
111109
112-
113110class Hello (GenericMessage ):
114111 """OpenFlow Hello Message OFPT_HELLO.
115112
@@ -121,7 +118,6 @@ class Hello(GenericMessage):
121118 header = Header (Type .OFPT_HELLO )
122119
123120 #: Hello element list
124- #: List of elements - 0 or more
125121 elements = ListOfHelloElements ()
126122
127123 def __init__ (self , xid = None , elements = None ):
@@ -155,7 +151,3 @@ def __init__(self, length=None, bitmaps=None):
155151 """
156152 super ().__init__ (HelloElemType .OFPHET_VERSIONBITMAP , length )
157153 self .bitmaps = bitmaps
158-
159-
160-
161-
0 commit comments