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

Commit 9a7a786

Browse files
authored
Merge pull request #321 from macartur/updating_new_message_from_type_v0x04
Updating new message from type v0x04
2 parents 2afd428 + 6d85667 commit 9a7a786

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

pyof/v0x04/common/utils.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,25 @@
1717
from pyof.v0x04.controller2switch.features_reply import FeaturesReply
1818
from pyof.v0x04.controller2switch.features_request import FeaturesRequest
1919
from pyof.v0x04.controller2switch.flow_mod import FlowMod
20+
from pyof.v0x04.controller2switch.get_async_reply import GetAsyncReply
21+
from pyof.v0x04.controller2switch.get_async_request import GetAsyncRequest
2022
from pyof.v0x04.controller2switch.get_config_reply import GetConfigReply
2123
from pyof.v0x04.controller2switch.get_config_request import GetConfigRequest
24+
from pyof.v0x04.controller2switch.group_mod import GroupMod
25+
from pyof.v0x04.controller2switch.meter_mod import MeterMod
2226
from pyof.v0x04.controller2switch.multipart_reply import MultipartReply
27+
from pyof.v0x04.controller2switch.multipart_request import MultipartRequest
2328
from pyof.v0x04.controller2switch.packet_out import PacketOut
2429
from pyof.v0x04.controller2switch.port_mod import PortMod
2530
from pyof.v0x04.controller2switch.queue_get_config_reply import \
2631
QueueGetConfigReply
2732
from pyof.v0x04.controller2switch.queue_get_config_request import \
2833
QueueGetConfigRequest
34+
from pyof.v0x04.controller2switch.role_reply import RoleReply
35+
from pyof.v0x04.controller2switch.role_request import RoleRequest
36+
from pyof.v0x04.controller2switch.set_async import SetAsync
2937
from pyof.v0x04.controller2switch.set_config import SetConfig
38+
from pyof.v0x04.controller2switch.table_mod import TableMod
3039
# Importing symmetric messages
3140
from pyof.v0x04.symmetric.echo_reply import EchoReply
3241
from pyof.v0x04.symmetric.echo_request import EchoRequest
@@ -51,27 +60,64 @@ def new_message_from_message_type(message_type):
5160
message_type = str(message_type)
5261

5362
available_classes = {
63+
64+
# Symetric/Immutable messages
5465
str(Type.OFPT_HELLO): Hello,
5566
str(Type.OFPT_ERROR): ErrorMsg,
5667
str(Type.OFPT_ECHO_REQUEST): EchoRequest,
5768
str(Type.OFPT_ECHO_REPLY): EchoReply,
5869
str(Type.OFPT_EXPERIMENTER): ExperimenterHeader,
70+
71+
# Switch configuration messages
72+
# Controller/Switch messages
5973
str(Type.OFPT_FEATURES_REQUEST): FeaturesRequest,
6074
str(Type.OFPT_FEATURES_REPLY): FeaturesReply,
6175
str(Type.OFPT_GET_CONFIG_REQUEST): GetConfigRequest,
6276
str(Type.OFPT_GET_CONFIG_REPLY): GetConfigReply,
6377
str(Type.OFPT_SET_CONFIG): SetConfig,
78+
79+
# Async messages
6480
str(Type.OFPT_PACKET_IN): PacketIn,
6581
str(Type.OFPT_FLOW_REMOVED): FlowRemoved,
6682
str(Type.OFPT_PORT_STATUS): PortStatus,
83+
84+
# Controller command messages
85+
# Controller/Switch message
6786
str(Type.OFPT_PACKET_OUT): PacketOut,
6887
str(Type.OFPT_FLOW_MOD): FlowMod,
88+
str(Type.OFPT_GROUP_MOD): GroupMod,
6989
str(Type.OFPT_PORT_MOD): PortMod,
90+
str(Type.OFPT_TABLE_MOD): TableMod,
91+
92+
# Multipart messages.
93+
# Controller/Switch message
94+
str(Type.OFPT_MULTIPART_REPLY): MultipartReply,
95+
str(Type.OFPT_MULTIPART_REQUEST): MultipartRequest,
96+
97+
# Barrier messages
98+
# Controller/Switch message
7099
str(Type.OFPT_BARRIER_REQUEST): BarrierRequest,
71100
str(Type.OFPT_BARRIER_REPLY): BarrierReply,
101+
102+
# Queue Configuration messages
103+
# Controller/Switch message
72104
str(Type.OFPT_QUEUE_GET_CONFIG_REQUEST): QueueGetConfigRequest,
73105
str(Type.OFPT_QUEUE_GET_CONFIG_REPLY): QueueGetConfigReply,
74-
str(Type.OFPT_MULTIPART_REPLY): MultipartReply,
106+
107+
# Controller role change request message
108+
# Controller/Switch message
109+
str(Type.OFPT_ROLE_REQUEST): RoleRequest,
110+
str(Type.OFPT_ROLE_REPLY): RoleReply,
111+
112+
# Asynchronous message configuration
113+
# Controller/Switch message
114+
str(Type.OFPT_GET_ASYNC_REQUEST): GetAsyncRequest,
115+
str(Type.OFPT_GET_ASYNC_REPLY): GetAsyncReply,
116+
str(Type.OFPT_SET_ASYNC): SetAsync,
117+
118+
# Meters and rate limiters configuration messages
119+
# Controller/Switch message
120+
str(Type.OFPT_METER_MOD): MeterMod,
75121
}
76122

77123
if message_type not in available_classes:

0 commit comments

Comments
 (0)