Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp #1

Merged
merged 4 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions pyof/v0x05/common/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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.

Expand Down
16 changes: 4 additions & 12 deletions pyof/v0x05/symmetric/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -14,7 +14,7 @@
# Enums


class HelloElemType(IntEnum):
class HelloElemType(Enum):
"""Hello element types."""

#: Bitmap of version supported.
Expand All @@ -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:
Expand Down Expand Up @@ -109,7 +107,6 @@ def __init__(self, items=None):
# super().append(items)



class Hello(GenericMessage):
"""OpenFlow Hello Message OFPT_HELLO.

Expand All @@ -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):
Expand Down Expand Up @@ -155,7 +151,3 @@ def __init__(self, length=None, bitmaps=None):
"""
super().__init__(HelloElemType.OFPHET_VERSIONBITMAP, length)
self.bitmaps = bitmaps