blob: c88b084a4a44c9fcb789b1cb111d099f56eff8cc [file] [log] [blame]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2# Copyright (c) 2011, 2012 Open Networking Foundation
3# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Dan Talaycof6202252013-07-02 01:00:29 -07004# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -07005
6# Automatically generated by LOXI from template const.py
7# Do not modify
8
9OFP_VERSION = 4
10
11# Identifiers from group macro_definitions
Rich Lanec2ee4b82013-04-24 17:12:38 -070012OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070013OFP_MAX_PORT_NAME_LEN = 16
Rich Lane6f4978c2013-10-20 21:33:52 -070014OFP_TCP_PORT = 6653
15OFP_SSL_PORT = 6653
Dan Talaycof6202252013-07-02 01:00:29 -070016OFP_ETH_ALEN = 6
17OFP_DEFAULT_MISS_SEND_LEN = 128
18OFP_VLAN_NONE = 0
19OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070020OFP_DEFAULT_PRIORITY = 32768
Rich Lanec2ee4b82013-04-24 17:12:38 -070021OFP_NO_BUFFER = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070022DESC_STR_LEN = 256
23SERIAL_NUM_LEN = 32
24OFPQ_ALL = 4294967295
25OFPQ_MAX_RATE_UNCFG = 65535
26OFPQ_MIN_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070027
Rich Lane7b0f2012013-11-22 14:15:26 -080028# Identifiers from group of_bsn_lacp_convergence_status_t
29LACP_SUCCESS = 0
30LACP_TIMEDOUT = 1
31LACP_OUT_OF_SYNC = 2
32
33of_bsn_lacp_convergence_status_t_map = {
34 0: 'LACP_SUCCESS',
35 1: 'LACP_TIMEDOUT',
36 2: 'LACP_OUT_OF_SYNC',
37}
38
Rich Lane6f4978c2013-10-20 21:33:52 -070039# Identifiers from group of_bsn_pdu_slot_num_t
40BSN_PDU_SLOT_NUM_ANY = 255
41
42of_bsn_pdu_slot_num_t_map = {
43 255: 'BSN_PDU_SLOT_NUM_ANY',
44}
45
Rich Lane7dcdf022013-12-11 14:45:27 -080046# Identifiers from group of_bsn_vlan_counter_t
47OFP_BSN_VLAN_COUNTER_RX_BYTES = 0
48OFP_BSN_VLAN_COUNTER_RX_PACKETS = 1
49OFP_BSN_VLAN_COUNTER_TX_BYTES = 2
50OFP_BSN_VLAN_COUNTER_TX_PACKETS = 3
51
52of_bsn_vlan_counter_t_map = {
53 0: 'OFP_BSN_VLAN_COUNTER_RX_BYTES',
54 1: 'OFP_BSN_VLAN_COUNTER_RX_PACKETS',
55 2: 'OFP_BSN_VLAN_COUNTER_TX_BYTES',
56 3: 'OFP_BSN_VLAN_COUNTER_TX_PACKETS',
57}
58
Rich Lanec2ee4b82013-04-24 17:12:38 -070059# Identifiers from group ofp_action_type
60OFPAT_OUTPUT = 0
61OFPAT_COPY_TTL_OUT = 11
62OFPAT_COPY_TTL_IN = 12
63OFPAT_SET_MPLS_TTL = 15
64OFPAT_DEC_MPLS_TTL = 16
65OFPAT_PUSH_VLAN = 17
66OFPAT_POP_VLAN = 18
67OFPAT_PUSH_MPLS = 19
68OFPAT_POP_MPLS = 20
69OFPAT_SET_QUEUE = 21
70OFPAT_GROUP = 22
71OFPAT_SET_NW_TTL = 23
72OFPAT_DEC_NW_TTL = 24
73OFPAT_SET_FIELD = 25
74OFPAT_PUSH_PBB = 26
75OFPAT_POP_PBB = 27
76OFPAT_EXPERIMENTER = 65535
77
78ofp_action_type_map = {
79 0: 'OFPAT_OUTPUT',
80 11: 'OFPAT_COPY_TTL_OUT',
81 12: 'OFPAT_COPY_TTL_IN',
82 15: 'OFPAT_SET_MPLS_TTL',
83 16: 'OFPAT_DEC_MPLS_TTL',
84 17: 'OFPAT_PUSH_VLAN',
85 18: 'OFPAT_POP_VLAN',
86 19: 'OFPAT_PUSH_MPLS',
87 20: 'OFPAT_POP_MPLS',
88 21: 'OFPAT_SET_QUEUE',
89 22: 'OFPAT_GROUP',
90 23: 'OFPAT_SET_NW_TTL',
91 24: 'OFPAT_DEC_NW_TTL',
92 25: 'OFPAT_SET_FIELD',
93 26: 'OFPAT_PUSH_PBB',
94 27: 'OFPAT_POP_PBB',
95 65535: 'OFPAT_EXPERIMENTER',
96}
97
98# Identifiers from group ofp_bad_action_code
99OFPBAC_BAD_TYPE = 0
100OFPBAC_BAD_LEN = 1
101OFPBAC_BAD_EXPERIMENTER = 2
Rich Lane6f4978c2013-10-20 21:33:52 -0700102OFPBAC_BAD_EXPERIMENTER_TYPE = 3
Rich Lanec2ee4b82013-04-24 17:12:38 -0700103OFPBAC_BAD_OUT_PORT = 4
104OFPBAC_BAD_ARGUMENT = 5
105OFPBAC_EPERM = 6
106OFPBAC_TOO_MANY = 7
107OFPBAC_BAD_QUEUE = 8
108OFPBAC_BAD_OUT_GROUP = 9
109OFPBAC_MATCH_INCONSISTENT = 10
110OFPBAC_UNSUPPORTED_ORDER = 11
111OFPBAC_BAD_TAG = 12
112OFPBAC_BAD_SET_TYPE = 13
113OFPBAC_BAD_SET_LEN = 14
114OFPBAC_BAD_SET_ARGUMENT = 15
115
116ofp_bad_action_code_map = {
117 0: 'OFPBAC_BAD_TYPE',
118 1: 'OFPBAC_BAD_LEN',
119 2: 'OFPBAC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700120 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700121 4: 'OFPBAC_BAD_OUT_PORT',
122 5: 'OFPBAC_BAD_ARGUMENT',
123 6: 'OFPBAC_EPERM',
124 7: 'OFPBAC_TOO_MANY',
125 8: 'OFPBAC_BAD_QUEUE',
126 9: 'OFPBAC_BAD_OUT_GROUP',
127 10: 'OFPBAC_MATCH_INCONSISTENT',
128 11: 'OFPBAC_UNSUPPORTED_ORDER',
129 12: 'OFPBAC_BAD_TAG',
130 13: 'OFPBAC_BAD_SET_TYPE',
131 14: 'OFPBAC_BAD_SET_LEN',
132 15: 'OFPBAC_BAD_SET_ARGUMENT',
133}
134
135# Identifiers from group ofp_bad_instruction_code
136OFPBIC_UNKNOWN_INST = 0
137OFPBIC_UNSUP_INST = 1
138OFPBIC_BAD_TABLE_ID = 2
139OFPBIC_UNSUP_METADATA = 3
140OFPBIC_UNSUP_METADATA_MASK = 4
141OFPBIC_BAD_EXPERIMENTER = 5
Rich Lane6f4978c2013-10-20 21:33:52 -0700142OFPBIC_BAD_EXPERIMENTER_TYPE = 6
Rich Lanec2ee4b82013-04-24 17:12:38 -0700143OFPBIC_BAD_LEN = 7
144OFPBIC_EPERM = 8
145
146ofp_bad_instruction_code_map = {
147 0: 'OFPBIC_UNKNOWN_INST',
148 1: 'OFPBIC_UNSUP_INST',
149 2: 'OFPBIC_BAD_TABLE_ID',
150 3: 'OFPBIC_UNSUP_METADATA',
151 4: 'OFPBIC_UNSUP_METADATA_MASK',
152 5: 'OFPBIC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700153 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700154 7: 'OFPBIC_BAD_LEN',
155 8: 'OFPBIC_EPERM',
156}
157
158# Identifiers from group ofp_bad_match_code
159OFPBMC_BAD_TYPE = 0
160OFPBMC_BAD_LEN = 1
161OFPBMC_BAD_TAG = 2
162OFPBMC_BAD_DL_ADDR_MASK = 3
163OFPBMC_BAD_NW_ADDR_MASK = 4
164OFPBMC_BAD_WILDCARDS = 5
165OFPBMC_BAD_FIELD = 6
166OFPBMC_BAD_VALUE = 7
167OFPBMC_BAD_MASK = 8
168OFPBMC_BAD_PREREQ = 9
169OFPBMC_DUP_FIELD = 10
170OFPBMC_EPERM = 11
171
172ofp_bad_match_code_map = {
173 0: 'OFPBMC_BAD_TYPE',
174 1: 'OFPBMC_BAD_LEN',
175 2: 'OFPBMC_BAD_TAG',
176 3: 'OFPBMC_BAD_DL_ADDR_MASK',
177 4: 'OFPBMC_BAD_NW_ADDR_MASK',
178 5: 'OFPBMC_BAD_WILDCARDS',
179 6: 'OFPBMC_BAD_FIELD',
180 7: 'OFPBMC_BAD_VALUE',
181 8: 'OFPBMC_BAD_MASK',
182 9: 'OFPBMC_BAD_PREREQ',
183 10: 'OFPBMC_DUP_FIELD',
184 11: 'OFPBMC_EPERM',
185}
186
187# Identifiers from group ofp_bad_request_code
188OFPBRC_BAD_VERSION = 0
189OFPBRC_BAD_TYPE = 1
Rich Lane6f4978c2013-10-20 21:33:52 -0700190OFPBRC_BAD_STAT = 2
Rich Lanec2ee4b82013-04-24 17:12:38 -0700191OFPBRC_BAD_EXPERIMENTER = 3
Rich Lane6f4978c2013-10-20 21:33:52 -0700192OFPBRC_BAD_EXPERIMENTER_TYPE = 4
Rich Lanec2ee4b82013-04-24 17:12:38 -0700193OFPBRC_EPERM = 5
194OFPBRC_BAD_LEN = 6
195OFPBRC_BUFFER_EMPTY = 7
196OFPBRC_BUFFER_UNKNOWN = 8
197OFPBRC_BAD_TABLE_ID = 9
198OFPBRC_IS_SLAVE = 10
199OFPBRC_BAD_PORT = 11
200OFPBRC_BAD_PACKET = 12
201OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13
202
203ofp_bad_request_code_map = {
204 0: 'OFPBRC_BAD_VERSION',
205 1: 'OFPBRC_BAD_TYPE',
Rich Lane6f4978c2013-10-20 21:33:52 -0700206 2: 'OFPBRC_BAD_STAT',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700207 3: 'OFPBRC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700208 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700209 5: 'OFPBRC_EPERM',
210 6: 'OFPBRC_BAD_LEN',
211 7: 'OFPBRC_BUFFER_EMPTY',
212 8: 'OFPBRC_BUFFER_UNKNOWN',
213 9: 'OFPBRC_BAD_TABLE_ID',
214 10: 'OFPBRC_IS_SLAVE',
215 11: 'OFPBRC_BAD_PORT',
216 12: 'OFPBRC_BAD_PACKET',
217 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
218}
219
Rich Lane5454b682014-01-14 17:07:36 -0800220# Identifiers from group ofp_bsn_controller_connection_state
221OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED = 0
222OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED = 1
223
224ofp_bsn_controller_connection_state_map = {
225 0: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED',
226 1: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED',
227}
228
229# Identifiers from group ofp_bsn_controller_role_reason
230OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST = 0
231OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG = 1
232OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER = 2
233
234ofp_bsn_controller_role_reason_map = {
235 0: 'OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST',
236 1: 'OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG',
237 2: 'OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER',
238}
239
Rich Lane93b33132014-04-21 12:20:58 -0700240# Identifiers from group ofp_bsn_pktin_flag
241OFP_BSN_PKTIN_FLAG_PDU = 1
242OFP_BSN_PKTIN_FLAG_NEW_HOST = 2
243OFP_BSN_PKTIN_FLAG_STATION_MOVE = 4
244OFP_BSN_PKTIN_FLAG_ARP = 8
245OFP_BSN_PKTIN_FLAG_DHCP = 16
246OFP_BSN_PKTIN_FLAG_L2_CPU = 32
247OFP_BSN_PKTIN_FLAG_DEBUG = 64
248OFP_BSN_PKTIN_FLAG_TTL_EXPIRED = 128
249OFP_BSN_PKTIN_FLAG_L3_MISS = 256
250OFP_BSN_PKTIN_FLAG_L3_CPU = 512
251
252ofp_bsn_pktin_flag_map = {
253 1: 'OFP_BSN_PKTIN_FLAG_PDU',
254 2: 'OFP_BSN_PKTIN_FLAG_NEW_HOST',
255 4: 'OFP_BSN_PKTIN_FLAG_STATION_MOVE',
256 8: 'OFP_BSN_PKTIN_FLAG_ARP',
257 16: 'OFP_BSN_PKTIN_FLAG_DHCP',
258 32: 'OFP_BSN_PKTIN_FLAG_L2_CPU',
259 64: 'OFP_BSN_PKTIN_FLAG_DEBUG',
260 128: 'OFP_BSN_PKTIN_FLAG_TTL_EXPIRED',
261 256: 'OFP_BSN_PKTIN_FLAG_L3_MISS',
262 512: 'OFP_BSN_PKTIN_FLAG_L3_CPU',
263}
264
Rich Lane7dcdf022013-12-11 14:45:27 -0800265# Identifiers from group ofp_bsn_port_counter
266OFP_BSN_PORT_COUNTER_RX_BYTES = 0
267OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST = 1
268OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST = 2
269OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST = 3
270OFP_BSN_PORT_COUNTER_RX_DROPPED = 4
271OFP_BSN_PORT_COUNTER_RX_ERRORS = 5
272OFP_BSN_PORT_COUNTER_TX_BYTES = 6
273OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST = 7
274OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST = 8
275OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST = 9
276OFP_BSN_PORT_COUNTER_TX_DROPPED = 10
277OFP_BSN_PORT_COUNTER_TX_ERRORS = 11
278
279ofp_bsn_port_counter_map = {
280 0: 'OFP_BSN_PORT_COUNTER_RX_BYTES',
281 1: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST',
282 2: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST',
283 3: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST',
284 4: 'OFP_BSN_PORT_COUNTER_RX_DROPPED',
285 5: 'OFP_BSN_PORT_COUNTER_RX_ERRORS',
286 6: 'OFP_BSN_PORT_COUNTER_TX_BYTES',
287 7: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST',
288 8: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST',
289 9: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST',
290 10: 'OFP_BSN_PORT_COUNTER_TX_DROPPED',
291 11: 'OFP_BSN_PORT_COUNTER_TX_ERRORS',
292}
293
Rich Lane93b33132014-04-21 12:20:58 -0700294# Identifiers from group ofp_bsn_udf_anchor
295OFP_BSN_UDF_ANCHOR_PACKET_START = 0
296OFP_BSN_UDF_ANCHOR_L3_HEADER_START = 1
297OFP_BSN_UDF_ANCHOR_L4_HEADER_START = 2
298
299ofp_bsn_udf_anchor_map = {
300 0: 'OFP_BSN_UDF_ANCHOR_PACKET_START',
301 1: 'OFP_BSN_UDF_ANCHOR_L3_HEADER_START',
302 2: 'OFP_BSN_UDF_ANCHOR_L4_HEADER_START',
303}
304
305# Identifiers from group ofp_bsn_vport_l2gre_flags
306OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
307OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
308OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
309
310ofp_bsn_vport_l2gre_flags_map = {
311 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
312 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
313 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
314}
315
Dan Talaycof6202252013-07-02 01:00:29 -0700316# Identifiers from group ofp_bsn_vport_q_in_q_untagged
317OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
318
319ofp_bsn_vport_q_in_q_untagged_map = {
320 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
321}
322
Rich Laned53156a2013-08-05 17:17:33 -0700323# Identifiers from group ofp_bsn_vport_status
324OF_BSN_VPORT_STATUS_OK = 0
325OF_BSN_VPORT_STATUS_FAILED = 1
326
327ofp_bsn_vport_status_map = {
328 0: 'OF_BSN_VPORT_STATUS_OK',
329 1: 'OF_BSN_VPORT_STATUS_FAILED',
330}
331
Rich Lanec2ee4b82013-04-24 17:12:38 -0700332# Identifiers from group ofp_capabilities
333OFPC_FLOW_STATS = 1
334OFPC_TABLE_STATS = 2
335OFPC_PORT_STATS = 4
336OFPC_GROUP_STATS = 8
337OFPC_IP_REASM = 32
338OFPC_QUEUE_STATS = 64
339OFPC_PORT_BLOCKED = 256
340
341ofp_capabilities_map = {
342 1: 'OFPC_FLOW_STATS',
343 2: 'OFPC_TABLE_STATS',
344 4: 'OFPC_PORT_STATS',
345 8: 'OFPC_GROUP_STATS',
346 32: 'OFPC_IP_REASM',
347 64: 'OFPC_QUEUE_STATS',
348 256: 'OFPC_PORT_BLOCKED',
349}
350
351# Identifiers from group ofp_config_flags
352OFPC_FRAG_NORMAL = 0
353OFPC_FRAG_DROP = 1
354OFPC_FRAG_REASM = 2
355OFPC_FRAG_MASK = 3
356
357ofp_config_flags_map = {
358 0: 'OFPC_FRAG_NORMAL',
359 1: 'OFPC_FRAG_DROP',
360 2: 'OFPC_FRAG_REASM',
361 3: 'OFPC_FRAG_MASK',
362}
363
364# Identifiers from group ofp_controller_max_len
365OFPCML_MAX = 65509
366OFPCML_NO_BUFFER = 65535
367
368ofp_controller_max_len_map = {
369 65509: 'OFPCML_MAX',
370 65535: 'OFPCML_NO_BUFFER',
371}
372
373# Identifiers from group ofp_controller_role
374OFPCR_ROLE_NOCHANGE = 0
375OFPCR_ROLE_EQUAL = 1
376OFPCR_ROLE_MASTER = 2
377OFPCR_ROLE_SLAVE = 3
378
379ofp_controller_role_map = {
380 0: 'OFPCR_ROLE_NOCHANGE',
381 1: 'OFPCR_ROLE_EQUAL',
382 2: 'OFPCR_ROLE_MASTER',
383 3: 'OFPCR_ROLE_SLAVE',
384}
385
386# Identifiers from group ofp_error_type
387OFPET_HELLO_FAILED = 0
388OFPET_BAD_REQUEST = 1
389OFPET_BAD_ACTION = 2
390OFPET_BAD_INSTRUCTION = 3
391OFPET_BAD_MATCH = 4
392OFPET_FLOW_MOD_FAILED = 5
393OFPET_GROUP_MOD_FAILED = 6
394OFPET_PORT_MOD_FAILED = 7
395OFPET_TABLE_MOD_FAILED = 8
396OFPET_QUEUE_OP_FAILED = 9
397OFPET_SWITCH_CONFIG_FAILED = 10
398OFPET_ROLE_REQUEST_FAILED = 11
399OFPET_METER_MOD_FAILED = 12
400OFPET_TABLE_FEATURES_FAILED = 13
401OFPET_EXPERIMENTER = 65535
402
403ofp_error_type_map = {
404 0: 'OFPET_HELLO_FAILED',
405 1: 'OFPET_BAD_REQUEST',
406 2: 'OFPET_BAD_ACTION',
407 3: 'OFPET_BAD_INSTRUCTION',
408 4: 'OFPET_BAD_MATCH',
409 5: 'OFPET_FLOW_MOD_FAILED',
410 6: 'OFPET_GROUP_MOD_FAILED',
411 7: 'OFPET_PORT_MOD_FAILED',
412 8: 'OFPET_TABLE_MOD_FAILED',
413 9: 'OFPET_QUEUE_OP_FAILED',
414 10: 'OFPET_SWITCH_CONFIG_FAILED',
415 11: 'OFPET_ROLE_REQUEST_FAILED',
416 12: 'OFPET_METER_MOD_FAILED',
417 13: 'OFPET_TABLE_FEATURES_FAILED',
418 65535: 'OFPET_EXPERIMENTER',
419}
420
421# Identifiers from group ofp_flow_mod_command
422OFPFC_ADD = 0
423OFPFC_MODIFY = 1
424OFPFC_MODIFY_STRICT = 2
425OFPFC_DELETE = 3
426OFPFC_DELETE_STRICT = 4
427
428ofp_flow_mod_command_map = {
429 0: 'OFPFC_ADD',
430 1: 'OFPFC_MODIFY',
431 2: 'OFPFC_MODIFY_STRICT',
432 3: 'OFPFC_DELETE',
433 4: 'OFPFC_DELETE_STRICT',
434}
435
436# Identifiers from group ofp_flow_mod_failed_code
437OFPFMFC_UNKNOWN = 0
438OFPFMFC_TABLE_FULL = 1
439OFPFMFC_BAD_TABLE_ID = 2
440OFPFMFC_OVERLAP = 3
441OFPFMFC_EPERM = 4
442OFPFMFC_BAD_TIMEOUT = 5
443OFPFMFC_BAD_COMMAND = 6
444OFPFMFC_BAD_FLAGS = 7
445
446ofp_flow_mod_failed_code_map = {
447 0: 'OFPFMFC_UNKNOWN',
448 1: 'OFPFMFC_TABLE_FULL',
449 2: 'OFPFMFC_BAD_TABLE_ID',
450 3: 'OFPFMFC_OVERLAP',
451 4: 'OFPFMFC_EPERM',
452 5: 'OFPFMFC_BAD_TIMEOUT',
453 6: 'OFPFMFC_BAD_COMMAND',
454 7: 'OFPFMFC_BAD_FLAGS',
455}
456
457# Identifiers from group ofp_flow_mod_flags
458OFPFF_SEND_FLOW_REM = 1
459OFPFF_CHECK_OVERLAP = 2
460OFPFF_RESET_COUNTS = 4
461OFPFF_NO_PKT_COUNTS = 8
462OFPFF_NO_BYT_COUNTS = 16
Rich Lane6f4978c2013-10-20 21:33:52 -0700463OFPFF_BSN_SEND_IDLE = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -0700464
465ofp_flow_mod_flags_map = {
466 1: 'OFPFF_SEND_FLOW_REM',
467 2: 'OFPFF_CHECK_OVERLAP',
468 4: 'OFPFF_RESET_COUNTS',
469 8: 'OFPFF_NO_PKT_COUNTS',
470 16: 'OFPFF_NO_BYT_COUNTS',
Rich Lane6f4978c2013-10-20 21:33:52 -0700471 128: 'OFPFF_BSN_SEND_IDLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700472}
473
474# Identifiers from group ofp_flow_removed_reason
475OFPRR_IDLE_TIMEOUT = 0
476OFPRR_HARD_TIMEOUT = 1
477OFPRR_DELETE = 2
478OFPRR_GROUP_DELETE = 3
479
480ofp_flow_removed_reason_map = {
481 0: 'OFPRR_IDLE_TIMEOUT',
482 1: 'OFPRR_HARD_TIMEOUT',
483 2: 'OFPRR_DELETE',
484 3: 'OFPRR_GROUP_DELETE',
485}
486
487# Identifiers from group ofp_group
488OFPG_MAX = 4294967040
489OFPG_ALL = 4294967292
490OFPG_ANY = 4294967295
491
492ofp_group_map = {
493 4294967040: 'OFPG_MAX',
494 4294967292: 'OFPG_ALL',
495 4294967295: 'OFPG_ANY',
496}
497
498# Identifiers from group ofp_group_capabilities
499OFPGFC_SELECT_WEIGHT = 1
500OFPGFC_SELECT_LIVENESS = 2
501OFPGFC_CHAINING = 4
502OFPGFC_CHAINING_CHECKS = 8
503
504ofp_group_capabilities_map = {
505 1: 'OFPGFC_SELECT_WEIGHT',
506 2: 'OFPGFC_SELECT_LIVENESS',
507 4: 'OFPGFC_CHAINING',
508 8: 'OFPGFC_CHAINING_CHECKS',
509}
510
511# Identifiers from group ofp_group_mod_command
512OFPGC_ADD = 0
513OFPGC_MODIFY = 1
514OFPGC_DELETE = 2
515
516ofp_group_mod_command_map = {
517 0: 'OFPGC_ADD',
518 1: 'OFPGC_MODIFY',
519 2: 'OFPGC_DELETE',
520}
521
522# Identifiers from group ofp_group_mod_failed_code
523OFPGMFC_GROUP_EXISTS = 0
524OFPGMFC_INVALID_GROUP = 1
525OFPGMFC_WEIGHT_UNSUPPORTED = 2
526OFPGMFC_OUT_OF_GROUPS = 3
527OFPGMFC_OUT_OF_BUCKETS = 4
528OFPGMFC_CHAINING_UNSUPPORTED = 5
529OFPGMFC_WATCH_UNSUPPORTED = 6
530OFPGMFC_LOOP = 7
531OFPGMFC_UNKNOWN_GROUP = 8
532OFPGMFC_CHAINED_GROUP = 9
533OFPGMFC_BAD_TYPE = 10
534OFPGMFC_BAD_COMMAND = 11
535OFPGMFC_BAD_BUCKET = 12
536OFPGMFC_BAD_WATCH = 13
537OFPGMFC_EPERM = 14
538
539ofp_group_mod_failed_code_map = {
540 0: 'OFPGMFC_GROUP_EXISTS',
541 1: 'OFPGMFC_INVALID_GROUP',
542 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
543 3: 'OFPGMFC_OUT_OF_GROUPS',
544 4: 'OFPGMFC_OUT_OF_BUCKETS',
545 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
546 6: 'OFPGMFC_WATCH_UNSUPPORTED',
547 7: 'OFPGMFC_LOOP',
548 8: 'OFPGMFC_UNKNOWN_GROUP',
549 9: 'OFPGMFC_CHAINED_GROUP',
550 10: 'OFPGMFC_BAD_TYPE',
551 11: 'OFPGMFC_BAD_COMMAND',
552 12: 'OFPGMFC_BAD_BUCKET',
553 13: 'OFPGMFC_BAD_WATCH',
554 14: 'OFPGMFC_EPERM',
555}
556
557# Identifiers from group ofp_group_type
558OFPGT_ALL = 0
559OFPGT_SELECT = 1
560OFPGT_INDIRECT = 2
561OFPGT_FF = 3
562
563ofp_group_type_map = {
564 0: 'OFPGT_ALL',
565 1: 'OFPGT_SELECT',
566 2: 'OFPGT_INDIRECT',
567 3: 'OFPGT_FF',
568}
569
570# Identifiers from group ofp_hello_elem_type
571OFPHET_VERSIONBITMAP = 1
572
573ofp_hello_elem_type_map = {
574 1: 'OFPHET_VERSIONBITMAP',
575}
576
577# Identifiers from group ofp_hello_failed_code
578OFPHFC_INCOMPATIBLE = 0
579OFPHFC_EPERM = 1
580
581ofp_hello_failed_code_map = {
582 0: 'OFPHFC_INCOMPATIBLE',
583 1: 'OFPHFC_EPERM',
584}
585
586# Identifiers from group ofp_instruction_type
587OFPIT_GOTO_TABLE = 1
588OFPIT_WRITE_METADATA = 2
589OFPIT_WRITE_ACTIONS = 3
590OFPIT_APPLY_ACTIONS = 4
591OFPIT_CLEAR_ACTIONS = 5
592OFPIT_METER = 6
593OFPIT_EXPERIMENTER = 65535
594
595ofp_instruction_type_map = {
596 1: 'OFPIT_GOTO_TABLE',
597 2: 'OFPIT_WRITE_METADATA',
598 3: 'OFPIT_WRITE_ACTIONS',
599 4: 'OFPIT_APPLY_ACTIONS',
600 5: 'OFPIT_CLEAR_ACTIONS',
601 6: 'OFPIT_METER',
602 65535: 'OFPIT_EXPERIMENTER',
603}
604
605# Identifiers from group ofp_ipv6exthdr_flags
606OFPIEH_NONEXT = 1
607OFPIEH_ESP = 2
608OFPIEH_AUTH = 4
609OFPIEH_DEST = 8
610OFPIEH_FRAG = 16
611OFPIEH_ROUTER = 32
612OFPIEH_HOP = 64
613OFPIEH_UNREP = 128
614OFPIEH_UNSEQ = 256
615
616ofp_ipv6exthdr_flags_map = {
617 1: 'OFPIEH_NONEXT',
618 2: 'OFPIEH_ESP',
619 4: 'OFPIEH_AUTH',
620 8: 'OFPIEH_DEST',
621 16: 'OFPIEH_FRAG',
622 32: 'OFPIEH_ROUTER',
623 64: 'OFPIEH_HOP',
624 128: 'OFPIEH_UNREP',
625 256: 'OFPIEH_UNSEQ',
626}
627
628# Identifiers from group ofp_match_type
629OFPMT_STANDARD = 0
630OFPMT_OXM = 1
631
632ofp_match_type_map = {
633 0: 'OFPMT_STANDARD',
634 1: 'OFPMT_OXM',
635}
636
637# Identifiers from group ofp_meter
638OFPM_MAX = 4294901760
639OFPM_SLOWPATH = 4294967293
640OFPM_CONTROLLER = 4294967294
641OFPM_ALL = 4294967295
642
643ofp_meter_map = {
644 4294901760: 'OFPM_MAX',
645 4294967293: 'OFPM_SLOWPATH',
646 4294967294: 'OFPM_CONTROLLER',
647 4294967295: 'OFPM_ALL',
648}
649
650# Identifiers from group ofp_meter_band_type
651OFPMBT_DROP = 1
652OFPMBT_DSCP_REMARK = 2
653OFPMBT_EXPERIMENTER = 65535
654
655ofp_meter_band_type_map = {
656 1: 'OFPMBT_DROP',
657 2: 'OFPMBT_DSCP_REMARK',
658 65535: 'OFPMBT_EXPERIMENTER',
659}
660
661# Identifiers from group ofp_meter_flags
662OFPMF_KBPS = 1
663OFPMF_PKTPS = 2
664OFPMF_BURST = 4
665OFPMF_STATS = 8
666
667ofp_meter_flags_map = {
668 1: 'OFPMF_KBPS',
669 2: 'OFPMF_PKTPS',
670 4: 'OFPMF_BURST',
671 8: 'OFPMF_STATS',
672}
673
674# Identifiers from group ofp_meter_mod_command
675OFPMC_ADD = 0
676OFPMC_MODIFY = 1
677OFPMC_DELETE = 2
678
679ofp_meter_mod_command_map = {
680 0: 'OFPMC_ADD',
681 1: 'OFPMC_MODIFY',
682 2: 'OFPMC_DELETE',
683}
684
685# Identifiers from group ofp_meter_mod_failed_code
686OFPMMFC_UNKNOWN = 0
687OFPMMFC_METER_EXISTS = 1
688OFPMMFC_INVALID_METER = 2
689OFPMMFC_UNKNOWN_METER = 3
690OFPMMFC_BAD_COMMAND = 4
691OFPMMFC_BAD_FLAGS = 5
692OFPMMFC_BAD_RATE = 6
693OFPMMFC_BAD_BURST = 7
694OFPMMFC_BAD_BAND = 8
695OFPMMFC_BAD_BAND_VALUE = 9
696OFPMMFC_OUT_OF_METERS = 10
697OFPMMFC_OUT_OF_BANDS = 11
698
699ofp_meter_mod_failed_code_map = {
700 0: 'OFPMMFC_UNKNOWN',
701 1: 'OFPMMFC_METER_EXISTS',
702 2: 'OFPMMFC_INVALID_METER',
703 3: 'OFPMMFC_UNKNOWN_METER',
704 4: 'OFPMMFC_BAD_COMMAND',
705 5: 'OFPMMFC_BAD_FLAGS',
706 6: 'OFPMMFC_BAD_RATE',
707 7: 'OFPMMFC_BAD_BURST',
708 8: 'OFPMMFC_BAD_BAND',
709 9: 'OFPMMFC_BAD_BAND_VALUE',
710 10: 'OFPMMFC_OUT_OF_METERS',
711 11: 'OFPMMFC_OUT_OF_BANDS',
712}
713
Rich Lanec2ee4b82013-04-24 17:12:38 -0700714# Identifiers from group ofp_oxm_class
715OFPXMC_NXM_0 = 0
716OFPXMC_NXM_1 = 1
717OFPXMC_OPENFLOW_BASIC = 32768
718OFPXMC_EXPERIMENTER = 65535
719
720ofp_oxm_class_map = {
721 0: 'OFPXMC_NXM_0',
722 1: 'OFPXMC_NXM_1',
723 32768: 'OFPXMC_OPENFLOW_BASIC',
724 65535: 'OFPXMC_EXPERIMENTER',
725}
726
727# Identifiers from group ofp_packet_in_reason
728OFPR_NO_MATCH = 0
729OFPR_ACTION = 1
730OFPR_INVALID_TTL = 2
Rich Laned9e3f7b2013-11-04 11:40:43 -0800731OFPR_BSN_NEW_HOST = 128
732OFPR_BSN_STATION_MOVE = 129
733OFPR_BSN_BAD_VLAN = 130
734OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131
Rich Lane5454b682014-01-14 17:07:36 -0800735OFPR_BSN_NO_ROUTE = 132
Rich Lane95f7fc92014-01-27 17:08:16 -0800736OFPR_BSN_ICMP_ECHO_REQUEST = 133
737OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134
738OFPR_BSN_DEST_HOST_UNREACHABLE = 135
739OFPR_BSN_DEST_PORT_UNREACHABLE = 136
740OFPR_BSN_FRAGMENTATION_REQUIRED = 137
741OFPR_BSN_ARP = 139
Rich Lane1b75abf2014-02-05 11:23:20 -0800742OFPR_BSN_DHCP = 140
Rich Lane9ec3fca2014-02-26 16:22:56 -0800743OFPR_BSN_DEBUG = 141
Rich Lanef50b7c32014-03-20 11:38:02 -0700744OFPR_BSN_PACKET_OF_DEATH = 142
Rich Lanec2ee4b82013-04-24 17:12:38 -0700745
746ofp_packet_in_reason_map = {
747 0: 'OFPR_NO_MATCH',
748 1: 'OFPR_ACTION',
749 2: 'OFPR_INVALID_TTL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800750 128: 'OFPR_BSN_NEW_HOST',
751 129: 'OFPR_BSN_STATION_MOVE',
752 130: 'OFPR_BSN_BAD_VLAN',
753 131: 'OFPR_BSN_DESTINATION_LOOKUP_FAILURE',
Rich Lane5454b682014-01-14 17:07:36 -0800754 132: 'OFPR_BSN_NO_ROUTE',
Rich Lane95f7fc92014-01-27 17:08:16 -0800755 133: 'OFPR_BSN_ICMP_ECHO_REQUEST',
756 134: 'OFPR_BSN_DEST_NETWORK_UNREACHABLE',
757 135: 'OFPR_BSN_DEST_HOST_UNREACHABLE',
758 136: 'OFPR_BSN_DEST_PORT_UNREACHABLE',
759 137: 'OFPR_BSN_FRAGMENTATION_REQUIRED',
760 139: 'OFPR_BSN_ARP',
Rich Lane1b75abf2014-02-05 11:23:20 -0800761 140: 'OFPR_BSN_DHCP',
Rich Lane9ec3fca2014-02-26 16:22:56 -0800762 141: 'OFPR_BSN_DEBUG',
Rich Lanef50b7c32014-03-20 11:38:02 -0700763 142: 'OFPR_BSN_PACKET_OF_DEATH',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700764}
765
766# Identifiers from group ofp_port
767OFPP_MAX = 4294967040
768OFPP_IN_PORT = 4294967288
769OFPP_TABLE = 4294967289
770OFPP_NORMAL = 4294967290
771OFPP_FLOOD = 4294967291
772OFPP_ALL = 4294967292
773OFPP_CONTROLLER = 4294967293
774OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800775OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700776
777ofp_port_map = {
778 4294967040: 'OFPP_MAX',
779 4294967288: 'OFPP_IN_PORT',
780 4294967289: 'OFPP_TABLE',
781 4294967290: 'OFPP_NORMAL',
782 4294967291: 'OFPP_FLOOD',
783 4294967292: 'OFPP_ALL',
784 4294967293: 'OFPP_CONTROLLER',
785 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800786 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700787}
788
789# Identifiers from group ofp_port_config
790OFPPC_PORT_DOWN = 1
791OFPPC_NO_RECV = 4
792OFPPC_NO_FWD = 32
793OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700794OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700795
796ofp_port_config_map = {
797 1: 'OFPPC_PORT_DOWN',
798 4: 'OFPPC_NO_RECV',
799 32: 'OFPPC_NO_FWD',
800 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700801 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700802}
803
804# Identifiers from group ofp_port_features
805OFPPF_10MB_HD = 1
806OFPPF_10MB_FD = 2
807OFPPF_100MB_HD = 4
808OFPPF_100MB_FD = 8
809OFPPF_1GB_HD = 16
810OFPPF_1GB_FD = 32
811OFPPF_10GB_FD = 64
812OFPPF_40GB_FD = 128
813OFPPF_100GB_FD = 256
814OFPPF_1TB_FD = 512
815OFPPF_OTHER = 1024
816OFPPF_COPPER = 2048
817OFPPF_FIBER = 4096
818OFPPF_AUTONEG = 8192
819OFPPF_PAUSE = 16384
820OFPPF_PAUSE_ASYM = 32768
821
822ofp_port_features_map = {
823 1: 'OFPPF_10MB_HD',
824 2: 'OFPPF_10MB_FD',
825 4: 'OFPPF_100MB_HD',
826 8: 'OFPPF_100MB_FD',
827 16: 'OFPPF_1GB_HD',
828 32: 'OFPPF_1GB_FD',
829 64: 'OFPPF_10GB_FD',
830 128: 'OFPPF_40GB_FD',
831 256: 'OFPPF_100GB_FD',
832 512: 'OFPPF_1TB_FD',
833 1024: 'OFPPF_OTHER',
834 2048: 'OFPPF_COPPER',
835 4096: 'OFPPF_FIBER',
836 8192: 'OFPPF_AUTONEG',
837 16384: 'OFPPF_PAUSE',
838 32768: 'OFPPF_PAUSE_ASYM',
839}
840
841# Identifiers from group ofp_port_mod_failed_code
842OFPPMFC_BAD_PORT = 0
843OFPPMFC_BAD_HW_ADDR = 1
844OFPPMFC_BAD_CONFIG = 2
845OFPPMFC_BAD_ADVERTISE = 3
846OFPPMFC_EPERM = 4
847
848ofp_port_mod_failed_code_map = {
849 0: 'OFPPMFC_BAD_PORT',
850 1: 'OFPPMFC_BAD_HW_ADDR',
851 2: 'OFPPMFC_BAD_CONFIG',
852 3: 'OFPPMFC_BAD_ADVERTISE',
853 4: 'OFPPMFC_EPERM',
854}
855
Rich Lanec2ee4b82013-04-24 17:12:38 -0700856# Identifiers from group ofp_port_reason
857OFPPR_ADD = 0
858OFPPR_DELETE = 1
859OFPPR_MODIFY = 2
860
861ofp_port_reason_map = {
862 0: 'OFPPR_ADD',
863 1: 'OFPPR_DELETE',
864 2: 'OFPPR_MODIFY',
865}
866
867# Identifiers from group ofp_port_state
868OFPPS_LINK_DOWN = 1
869OFPPS_BLOCKED = 2
870OFPPS_LIVE = 4
871
872ofp_port_state_map = {
873 1: 'OFPPS_LINK_DOWN',
874 2: 'OFPPS_BLOCKED',
875 4: 'OFPPS_LIVE',
876}
877
878# Identifiers from group ofp_queue_op_failed_code
879OFPQOFC_BAD_PORT = 0
880OFPQOFC_BAD_QUEUE = 1
881OFPQOFC_EPERM = 2
882
883ofp_queue_op_failed_code_map = {
884 0: 'OFPQOFC_BAD_PORT',
885 1: 'OFPQOFC_BAD_QUEUE',
886 2: 'OFPQOFC_EPERM',
887}
888
889# Identifiers from group ofp_queue_properties
890OFPQT_MIN_RATE = 1
891OFPQT_MAX_RATE = 2
892OFPQT_EXPERIMENTER = 65535
893
894ofp_queue_properties_map = {
895 1: 'OFPQT_MIN_RATE',
896 2: 'OFPQT_MAX_RATE',
897 65535: 'OFPQT_EXPERIMENTER',
898}
899
900# Identifiers from group ofp_role_request_failed_code
901OFPRRFC_STALE = 0
902OFPRRFC_UNSUP = 1
903OFPRRFC_BAD_ROLE = 2
904
905ofp_role_request_failed_code_map = {
906 0: 'OFPRRFC_STALE',
907 1: 'OFPRRFC_UNSUP',
908 2: 'OFPRRFC_BAD_ROLE',
909}
910
Rich Lane6f4978c2013-10-20 21:33:52 -0700911# Identifiers from group ofp_stats_reply_flags
912OFPSF_REPLY_MORE = 1
913
914ofp_stats_reply_flags_map = {
915 1: 'OFPSF_REPLY_MORE',
916}
917
918# Identifiers from group ofp_stats_request_flags
919OFPSF_REQ_MORE = 1
920
921ofp_stats_request_flags_map = {
922 1: 'OFPSF_REQ_MORE',
923}
924
925# Identifiers from group ofp_stats_type
926OFPST_DESC = 0
927OFPST_FLOW = 1
928OFPST_AGGREGATE = 2
929OFPST_TABLE = 3
930OFPST_PORT = 4
931OFPST_QUEUE = 5
932OFPST_GROUP = 6
933OFPST_GROUP_DESC = 7
934OFPST_GROUP_FEATURES = 8
935OFPST_METER = 9
936OFPST_METER_CONFIG = 10
937OFPST_METER_FEATURES = 11
938OFPST_TABLE_FEATURES = 12
939OFPST_PORT_DESC = 13
940OFPST_EXPERIMENTER = 65535
941
942ofp_stats_type_map = {
943 0: 'OFPST_DESC',
944 1: 'OFPST_FLOW',
945 2: 'OFPST_AGGREGATE',
946 3: 'OFPST_TABLE',
947 4: 'OFPST_PORT',
948 5: 'OFPST_QUEUE',
949 6: 'OFPST_GROUP',
950 7: 'OFPST_GROUP_DESC',
951 8: 'OFPST_GROUP_FEATURES',
952 9: 'OFPST_METER',
953 10: 'OFPST_METER_CONFIG',
954 11: 'OFPST_METER_FEATURES',
955 12: 'OFPST_TABLE_FEATURES',
956 13: 'OFPST_PORT_DESC',
957 65535: 'OFPST_EXPERIMENTER',
958}
959
Rich Lanec2ee4b82013-04-24 17:12:38 -0700960# Identifiers from group ofp_switch_config_failed_code
961OFPSCFC_BAD_FLAGS = 0
962OFPSCFC_BAD_LEN = 1
963OFPSCFC_EPERM = 2
964
965ofp_switch_config_failed_code_map = {
966 0: 'OFPSCFC_BAD_FLAGS',
967 1: 'OFPSCFC_BAD_LEN',
968 2: 'OFPSCFC_EPERM',
969}
970
971# Identifiers from group ofp_table
972OFPTT_MAX = 254
973OFPTT_ALL = 255
974
975ofp_table_map = {
976 254: 'OFPTT_MAX',
977 255: 'OFPTT_ALL',
978}
979
980# Identifiers from group ofp_table_config
981OFPTC_DEPRECATED_MASK = 3
982
983ofp_table_config_map = {
984 3: 'OFPTC_DEPRECATED_MASK',
985}
986
987# Identifiers from group ofp_table_feature_prop_type
988OFPTFPT_INSTRUCTIONS = 0
989OFPTFPT_INSTRUCTIONS_MISS = 1
990OFPTFPT_NEXT_TABLES = 2
991OFPTFPT_NEXT_TABLES_MISS = 3
992OFPTFPT_WRITE_ACTIONS = 4
993OFPTFPT_WRITE_ACTIONS_MISS = 5
994OFPTFPT_APPLY_ACTIONS = 6
995OFPTFPT_APPLY_ACTIONS_MISS = 7
996OFPTFPT_MATCH = 8
997OFPTFPT_WILDCARDS = 10
998OFPTFPT_WRITE_SETFIELD = 12
999OFPTFPT_WRITE_SETFIELD_MISS = 13
1000OFPTFPT_APPLY_SETFIELD = 14
1001OFPTFPT_APPLY_SETFIELD_MISS = 15
1002OFPTFPT_EXPERIMENTER = 65534
1003OFPTFPT_EXPERIMENTER_MISS = 65535
1004
1005ofp_table_feature_prop_type_map = {
1006 0: 'OFPTFPT_INSTRUCTIONS',
1007 1: 'OFPTFPT_INSTRUCTIONS_MISS',
1008 2: 'OFPTFPT_NEXT_TABLES',
1009 3: 'OFPTFPT_NEXT_TABLES_MISS',
1010 4: 'OFPTFPT_WRITE_ACTIONS',
1011 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
1012 6: 'OFPTFPT_APPLY_ACTIONS',
1013 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
1014 8: 'OFPTFPT_MATCH',
1015 10: 'OFPTFPT_WILDCARDS',
1016 12: 'OFPTFPT_WRITE_SETFIELD',
1017 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
1018 14: 'OFPTFPT_APPLY_SETFIELD',
1019 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
1020 65534: 'OFPTFPT_EXPERIMENTER',
1021 65535: 'OFPTFPT_EXPERIMENTER_MISS',
1022}
1023
1024# Identifiers from group ofp_table_features_failed_code
1025OFPTFFC_BAD_TABLE = 0
1026OFPTFFC_BAD_METADATA = 1
1027OFPTFFC_BAD_TYPE = 2
1028OFPTFFC_BAD_LEN = 3
1029OFPTFFC_BAD_ARGUMENT = 4
1030OFPTFFC_EPERM = 5
1031
1032ofp_table_features_failed_code_map = {
1033 0: 'OFPTFFC_BAD_TABLE',
1034 1: 'OFPTFFC_BAD_METADATA',
1035 2: 'OFPTFFC_BAD_TYPE',
1036 3: 'OFPTFFC_BAD_LEN',
1037 4: 'OFPTFFC_BAD_ARGUMENT',
1038 5: 'OFPTFFC_EPERM',
1039}
1040
1041# Identifiers from group ofp_table_mod_failed_code
1042OFPTMFC_BAD_TABLE = 0
1043OFPTMFC_BAD_CONFIG = 1
1044OFPTMFC_EPERM = 2
1045
1046ofp_table_mod_failed_code_map = {
1047 0: 'OFPTMFC_BAD_TABLE',
1048 1: 'OFPTMFC_BAD_CONFIG',
1049 2: 'OFPTMFC_EPERM',
1050}
1051
1052# Identifiers from group ofp_type
1053OFPT_HELLO = 0
1054OFPT_ERROR = 1
1055OFPT_ECHO_REQUEST = 2
1056OFPT_ECHO_REPLY = 3
1057OFPT_EXPERIMENTER = 4
1058OFPT_FEATURES_REQUEST = 5
1059OFPT_FEATURES_REPLY = 6
1060OFPT_GET_CONFIG_REQUEST = 7
1061OFPT_GET_CONFIG_REPLY = 8
1062OFPT_SET_CONFIG = 9
1063OFPT_PACKET_IN = 10
1064OFPT_FLOW_REMOVED = 11
1065OFPT_PORT_STATUS = 12
1066OFPT_PACKET_OUT = 13
1067OFPT_FLOW_MOD = 14
1068OFPT_GROUP_MOD = 15
1069OFPT_PORT_MOD = 16
1070OFPT_TABLE_MOD = 17
Rich Lane6f4978c2013-10-20 21:33:52 -07001071OFPT_STATS_REQUEST = 18
1072OFPT_STATS_REPLY = 19
Rich Lanec2ee4b82013-04-24 17:12:38 -07001073OFPT_BARRIER_REQUEST = 20
1074OFPT_BARRIER_REPLY = 21
1075OFPT_QUEUE_GET_CONFIG_REQUEST = 22
1076OFPT_QUEUE_GET_CONFIG_REPLY = 23
1077OFPT_ROLE_REQUEST = 24
1078OFPT_ROLE_REPLY = 25
1079OFPT_GET_ASYNC_REQUEST = 26
1080OFPT_GET_ASYNC_REPLY = 27
1081OFPT_SET_ASYNC = 28
1082OFPT_METER_MOD = 29
1083
1084ofp_type_map = {
1085 0: 'OFPT_HELLO',
1086 1: 'OFPT_ERROR',
1087 2: 'OFPT_ECHO_REQUEST',
1088 3: 'OFPT_ECHO_REPLY',
1089 4: 'OFPT_EXPERIMENTER',
1090 5: 'OFPT_FEATURES_REQUEST',
1091 6: 'OFPT_FEATURES_REPLY',
1092 7: 'OFPT_GET_CONFIG_REQUEST',
1093 8: 'OFPT_GET_CONFIG_REPLY',
1094 9: 'OFPT_SET_CONFIG',
1095 10: 'OFPT_PACKET_IN',
1096 11: 'OFPT_FLOW_REMOVED',
1097 12: 'OFPT_PORT_STATUS',
1098 13: 'OFPT_PACKET_OUT',
1099 14: 'OFPT_FLOW_MOD',
1100 15: 'OFPT_GROUP_MOD',
1101 16: 'OFPT_PORT_MOD',
1102 17: 'OFPT_TABLE_MOD',
Rich Lane6f4978c2013-10-20 21:33:52 -07001103 18: 'OFPT_STATS_REQUEST',
1104 19: 'OFPT_STATS_REPLY',
Rich Lanec2ee4b82013-04-24 17:12:38 -07001105 20: 'OFPT_BARRIER_REQUEST',
1106 21: 'OFPT_BARRIER_REPLY',
1107 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
1108 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
1109 24: 'OFPT_ROLE_REQUEST',
1110 25: 'OFPT_ROLE_REPLY',
1111 26: 'OFPT_GET_ASYNC_REQUEST',
1112 27: 'OFPT_GET_ASYNC_REPLY',
1113 28: 'OFPT_SET_ASYNC',
1114 29: 'OFPT_METER_MOD',
1115}
1116
1117# Identifiers from group ofp_vlan_id
1118OFPVID_NONE = 0
1119OFPVID_PRESENT = 4096
1120
1121ofp_vlan_id_map = {
1122 0: 'OFPVID_NONE',
1123 4096: 'OFPVID_PRESENT',
1124}
1125