Skip to content

Commit 82be74e

Browse files
authored
Merge pull request #1 from RoyAl82/temp
Create a new branch so i could update this branch
2 parents a7d322f + 6902c53 commit 82be74e

2 files changed

Lines changed: 14 additions & 25 deletions

File tree

pyof/v0x05/common/header.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ class Type(IntEnum):
6060
# Queue Configuration messages
6161
# Controller/Switch message
6262

63-
#OFPT_QUEUE_GET_CONFIG_REQUEST = 22
64-
#OFPT_QUEUE_GET_CONFIG_REPLY = 23
65-
63+
# OFPT_QUEUE_GET_CONFIG_REQUEST = 22
64+
# OFPT_QUEUE_GET_CONFIG_REPLY = 23
6665

6766
# Controller role change request message
6867
# Controller/Switch message
@@ -79,21 +78,20 @@ class Type(IntEnum):
7978
# Controller/Switch message
8079
OFPT_METER_MOD = 29
8180

82-
83-
#Controller role change event messages
84-
#Async message
81+
# Controller role change event messages
82+
# Async message
8583
OFPT_ROLE_STATUS = 30
8684

87-
#Asynchronous message
88-
#Async message
85+
# Asynchronous message
86+
# Async message
8987
OFPT_TABLE_STATUS = 31
9088

91-
#Request forwarding by switch
92-
#Async message
89+
# Request forwarding by switch
90+
# Async message
9391
OFPT_REQUESTFORWARD = 32
9492

95-
#Bundle operations (Multiple messages as a single operation)
96-
#Controller/Switch message
93+
# Bundle operations (Multiple messages as a single operation)
94+
# Controller/Switch message
9795
OFPT_BUNDLE_CONTROL = 33
9896
OFPT_BUNDLE_ADD_MESSAGE = 34
9997

@@ -108,7 +106,6 @@ class Header(GenericStruct):
108106
length = UBInt16()
109107
xid = UBInt32()
110108

111-
112109
def __init__(self, message_type=None, length=None, xid=None):
113110
"""Create a Header with the optional parameters below.
114111

pyof/v0x05/symmetric/hello.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
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
77
from pyof.foundation.exceptions import PackException
88
from pyof.v0x05.common.header import Header, Type
99

@@ -14,7 +14,7 @@
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-
2726
class 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-
113110
class 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

Comments
 (0)