Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 1820155

Browse files
authored
Merge pull request #322 from macartur/improving_multipart_structures
Improving multipart structures
2 parents f81d25b + 820fb30 commit 1820155

66 files changed

Lines changed: 1113 additions & 781 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import sys
1615
import os
16+
import sys
17+
1718
import sphinx_bootstrap_theme
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,

pyof/v0x01/asynchronous/error_msg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from pyof.v0x01 import common
1111
from pyof.v0x01.common.header import Header, Type
1212

13-
1413
__all__ = ('ErrorMsg', 'ErrorType', 'BadActionCode', 'BadRequestCode',
1514
'FlowModFailedCode', 'HelloFailedCode', 'PortModFailedCode',
1615
'QueueOpFailedCode')

pyof/v0x01/common/action.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
# Local source tree imports
66
from pyof.foundation.base import GenericBitMask, GenericStruct
7-
from pyof.foundation.basic_types import (HWAddress, Pad, UBInt8, UBInt16,
8-
UBInt32)
7+
from pyof.foundation.basic_types import (FixedTypeList, HWAddress, Pad, UBInt8,
8+
UBInt16, UBInt32)
99
from pyof.foundation.constants import UBINT16_MAX_VALUE
1010

1111
# Third-party imports
@@ -312,3 +312,18 @@ def __init__(self, length=None, vendor=None):
312312
"""
313313
super().__init__(action_type=ActionType.OFPAT_VENDOR, length=length)
314314
self.vendor = vendor
315+
316+
317+
class ListOfActions(FixedTypeList):
318+
"""List of actions.
319+
320+
Represented by instances of ActionHeader and used on ActionHeader objects.
321+
"""
322+
323+
def __init__(self, items=None):
324+
"""The constructor just assings parameters to object attributes.
325+
326+
Args:
327+
items (ActionHeader): Instance or a list of instances.
328+
"""
329+
super().__init__(pyof_class=ActionHeader, items=items)

pyof/v0x01/common/flow_match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
# Local source tree imports
88
from pyof.foundation.base import GenericBitMask, GenericStruct
9-
from pyof.foundation.basic_types import (HWAddress, IPAddress, Pad,
10-
UBInt8, UBInt16, UBInt32)
9+
from pyof.foundation.basic_types import (HWAddress, IPAddress, Pad, UBInt8,
10+
UBInt16, UBInt32)
1111

1212
__all__ = ('Match', 'FlowWildCards')
1313

pyof/v0x01/controller2switch/common.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from enum import Enum
55

66
from pyof.foundation.base import GenericMessage, GenericStruct
7-
from pyof.foundation.basic_types import (Char, FixedTypeList, Pad, UBInt8,
8-
UBInt16, UBInt32, UBInt64)
7+
from pyof.foundation.basic_types import (Char, Pad, UBInt8, UBInt16, UBInt32,
8+
UBInt64)
99
from pyof.foundation.constants import (DESC_STR_LEN, OFP_MAX_TABLE_NAME_LEN,
1010
SERIAL_NUM_LEN)
1111
# Local source tree imports
12-
from pyof.v0x01.common.action import ActionHeader
12+
from pyof.v0x01.common.action import ListOfActions
1313
from pyof.v0x01.common.flow_match import FlowWildCards, Match
1414
from pyof.v0x01.common.header import Header
1515
from pyof.v0x01.common.phy_port import Port
@@ -86,21 +86,6 @@ def __init__(self, xid=None, flags=None, miss_send_len=None):
8686
self.miss_send_len = miss_send_len
8787

8888

89-
class ListOfActions(FixedTypeList):
90-
"""List of actions.
91-
92-
Represented by instances of ActionHeader and used on ActionHeader objects.
93-
"""
94-
95-
def __init__(self, items=None):
96-
"""The constructor just assings parameters to object attributes.
97-
98-
Args:
99-
items (ActionHeader): Instance or a list of instances.
100-
"""
101-
super().__init__(pyof_class=ActionHeader, items=items)
102-
103-
10489
class AggregateStatsReply(GenericStruct):
10590
"""Body of reply to OFPST_AGGREGATE request."""
10691

pyof/v0x01/controller2switch/flow_mod.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
# System imports
44
from enum import Enum
5+
56
from pyof.foundation.base import GenericBitMask, GenericMessage
67
from pyof.foundation.basic_types import UBInt16, UBInt32, UBInt64
8+
from pyof.v0x01.common.action import ListOfActions
79
from pyof.v0x01.common.constants import NO_BUFFER
810
# Local source tree imports
911
from pyof.v0x01.common.flow_match import Match
1012
from pyof.v0x01.common.header import Header, Type
1113
from pyof.v0x01.common.phy_port import Port
12-
from pyof.v0x01.controller2switch.common import ListOfActions
1314

1415
# Third-party imports
1516

pyof/v0x01/controller2switch/packet_out.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from pyof.foundation.base import GenericMessage
55
from pyof.foundation.basic_types import BinaryData, UBInt16, UBInt32
66
from pyof.foundation.exceptions import PackException, ValidationError
7+
from pyof.v0x01.common.action import ListOfActions
78
from pyof.v0x01.common.constants import NO_BUFFER
89
from pyof.v0x01.common.header import Header, Type
910
from pyof.v0x01.common.phy_port import Port
10-
from pyof.v0x01.controller2switch.common import ListOfActions
1111

1212
__all__ = ('PacketOut',)
1313

pyof/v0x01/controller2switch/stats_reply.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Response the stat request packet from the controller."""
22
from importlib import import_module
3+
34
from pyof.foundation.base import GenericMessage
45
from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16
56
from pyof.v0x01.common.header import Header, Type

pyof/v0x01/controller2switch/stats_request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Third-party imports
66

77
from importlib import import_module
8+
89
from pyof.foundation.base import GenericMessage
910
from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16
1011
# Local imports

pyof/v0x04/common/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
__all__ = ('ActionExperimenterHeader', 'ActionGroup', 'ActionHeader',
1313
'ActionMPLSTTL', 'ActionNWTTL', 'ActionOutput', 'ActionPopMPLS',
1414
'ActionPush', 'ActionSetField', 'ActionSetQueue', 'ActionType',
15-
'ControllerMaxLen')
15+
'ControllerMaxLen', 'ListOfActions')
1616

1717
# Enums
1818

0 commit comments

Comments
 (0)