blob: 70a63f878c2037121afc1b14cbb6bf8b6742a254 [file] [log] [blame]
Matteo Scandoloa229eca2017-08-08 13:05:28 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Rich Lanec2ee4b82013-04-24 17:12:38 -070017# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
18# Copyright (c) 2011, 2012 Open Networking Foundation
19# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Dan Talaycof6202252013-07-02 01:00:29 -070020# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -070021
22# Automatically generated by LOXI from template const.py
23# Do not modify
24
25OFP_VERSION = 3
26
27# Identifiers from group macro_definitions
Rich Lanec2ee4b82013-04-24 17:12:38 -070028OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070029OFP_MAX_PORT_NAME_LEN = 16
Rich Lane6f4978c2013-10-20 21:33:52 -070030OFP_TCP_PORT = 6653
31OFP_SSL_PORT = 6653
Dan Talaycof6202252013-07-02 01:00:29 -070032OFP_ETH_ALEN = 6
33OFP_DEFAULT_MISS_SEND_LEN = 128
34OFP_VLAN_NONE = 0
35OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070036OFP_DEFAULT_PRIORITY = 32768
Dan Talaycof6202252013-07-02 01:00:29 -070037OFP_NO_BUFFER = 4294967295
38DESC_STR_LEN = 256
39SERIAL_NUM_LEN = 32
40OFPQ_ALL = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -070041OFPQ_MIN_RATE_UNCFG = 65535
42OFPQ_MAX_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070043
Rich Lane2e079da2014-10-29 15:30:24 -070044# Identifiers from group of_bsn_pdu_slot_num
Rich Lane6f4978c2013-10-20 21:33:52 -070045BSN_PDU_SLOT_NUM_ANY = 255
46
Rich Lane2e079da2014-10-29 15:30:24 -070047of_bsn_pdu_slot_num_map = {
Rich Lane6f4978c2013-10-20 21:33:52 -070048 255: 'BSN_PDU_SLOT_NUM_ANY',
49}
50
Rich Lanec2ee4b82013-04-24 17:12:38 -070051# Identifiers from group ofp_action_type
52OFPAT_OUTPUT = 0
53OFPAT_COPY_TTL_OUT = 11
54OFPAT_COPY_TTL_IN = 12
55OFPAT_SET_MPLS_TTL = 15
56OFPAT_DEC_MPLS_TTL = 16
57OFPAT_PUSH_VLAN = 17
58OFPAT_POP_VLAN = 18
59OFPAT_PUSH_MPLS = 19
60OFPAT_POP_MPLS = 20
61OFPAT_SET_QUEUE = 21
62OFPAT_GROUP = 22
63OFPAT_SET_NW_TTL = 23
64OFPAT_DEC_NW_TTL = 24
65OFPAT_SET_FIELD = 25
66OFPAT_EXPERIMENTER = 65535
67
68ofp_action_type_map = {
69 0: 'OFPAT_OUTPUT',
70 11: 'OFPAT_COPY_TTL_OUT',
71 12: 'OFPAT_COPY_TTL_IN',
72 15: 'OFPAT_SET_MPLS_TTL',
73 16: 'OFPAT_DEC_MPLS_TTL',
74 17: 'OFPAT_PUSH_VLAN',
75 18: 'OFPAT_POP_VLAN',
76 19: 'OFPAT_PUSH_MPLS',
77 20: 'OFPAT_POP_MPLS',
78 21: 'OFPAT_SET_QUEUE',
79 22: 'OFPAT_GROUP',
80 23: 'OFPAT_SET_NW_TTL',
81 24: 'OFPAT_DEC_NW_TTL',
82 25: 'OFPAT_SET_FIELD',
83 65535: 'OFPAT_EXPERIMENTER',
84}
85
86# Identifiers from group ofp_bad_action_code
87OFPBAC_BAD_TYPE = 0
88OFPBAC_BAD_LEN = 1
89OFPBAC_BAD_EXPERIMENTER = 2
Rich Lane6f4978c2013-10-20 21:33:52 -070090OFPBAC_BAD_EXPERIMENTER_TYPE = 3
Rich Lanec2ee4b82013-04-24 17:12:38 -070091OFPBAC_BAD_OUT_PORT = 4
92OFPBAC_BAD_ARGUMENT = 5
93OFPBAC_EPERM = 6
94OFPBAC_TOO_MANY = 7
95OFPBAC_BAD_QUEUE = 8
96OFPBAC_BAD_OUT_GROUP = 9
97OFPBAC_MATCH_INCONSISTENT = 10
98OFPBAC_UNSUPPORTED_ORDER = 11
99OFPBAC_BAD_TAG = 12
100OFPBAC_BAD_SET_TYPE = 13
101OFPBAC_BAD_SET_LEN = 14
102OFPBAC_BAD_SET_ARGUMENT = 15
103
104ofp_bad_action_code_map = {
105 0: 'OFPBAC_BAD_TYPE',
106 1: 'OFPBAC_BAD_LEN',
107 2: 'OFPBAC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700108 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700109 4: 'OFPBAC_BAD_OUT_PORT',
110 5: 'OFPBAC_BAD_ARGUMENT',
111 6: 'OFPBAC_EPERM',
112 7: 'OFPBAC_TOO_MANY',
113 8: 'OFPBAC_BAD_QUEUE',
114 9: 'OFPBAC_BAD_OUT_GROUP',
115 10: 'OFPBAC_MATCH_INCONSISTENT',
116 11: 'OFPBAC_UNSUPPORTED_ORDER',
117 12: 'OFPBAC_BAD_TAG',
118 13: 'OFPBAC_BAD_SET_TYPE',
119 14: 'OFPBAC_BAD_SET_LEN',
120 15: 'OFPBAC_BAD_SET_ARGUMENT',
121}
122
123# Identifiers from group ofp_bad_instruction_code
124OFPBIC_UNKNOWN_INST = 0
125OFPBIC_UNSUP_INST = 1
126OFPBIC_BAD_TABLE_ID = 2
127OFPBIC_UNSUP_METADATA = 3
128OFPBIC_UNSUP_METADATA_MASK = 4
129OFPBIC_BAD_EXPERIMENTER = 5
Rich Lane6f4978c2013-10-20 21:33:52 -0700130OFPBIC_BAD_EXPERIMENTER_TYPE = 6
Rich Lanec2ee4b82013-04-24 17:12:38 -0700131OFPBIC_BAD_LEN = 7
132OFPBIC_EPERM = 8
133
134ofp_bad_instruction_code_map = {
135 0: 'OFPBIC_UNKNOWN_INST',
136 1: 'OFPBIC_UNSUP_INST',
137 2: 'OFPBIC_BAD_TABLE_ID',
138 3: 'OFPBIC_UNSUP_METADATA',
139 4: 'OFPBIC_UNSUP_METADATA_MASK',
140 5: 'OFPBIC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700141 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700142 7: 'OFPBIC_BAD_LEN',
143 8: 'OFPBIC_EPERM',
144}
145
146# Identifiers from group ofp_bad_match_code
147OFPBMC_BAD_TYPE = 0
148OFPBMC_BAD_LEN = 1
149OFPBMC_BAD_TAG = 2
150OFPBMC_BAD_DL_ADDR_MASK = 3
151OFPBMC_BAD_NW_ADDR_MASK = 4
152OFPBMC_BAD_WILDCARDS = 5
153OFPBMC_BAD_FIELD = 6
154OFPBMC_BAD_VALUE = 7
155OFPBMC_BAD_MASK = 8
156OFPBMC_BAD_PREREQ = 9
157OFPBMC_DUP_FIELD = 10
158OFPBMC_EPERM = 11
159
160ofp_bad_match_code_map = {
161 0: 'OFPBMC_BAD_TYPE',
162 1: 'OFPBMC_BAD_LEN',
163 2: 'OFPBMC_BAD_TAG',
164 3: 'OFPBMC_BAD_DL_ADDR_MASK',
165 4: 'OFPBMC_BAD_NW_ADDR_MASK',
166 5: 'OFPBMC_BAD_WILDCARDS',
167 6: 'OFPBMC_BAD_FIELD',
168 7: 'OFPBMC_BAD_VALUE',
169 8: 'OFPBMC_BAD_MASK',
170 9: 'OFPBMC_BAD_PREREQ',
171 10: 'OFPBMC_DUP_FIELD',
172 11: 'OFPBMC_EPERM',
173}
174
175# Identifiers from group ofp_bad_request_code
176OFPBRC_BAD_VERSION = 0
177OFPBRC_BAD_TYPE = 1
178OFPBRC_BAD_STAT = 2
179OFPBRC_BAD_EXPERIMENTER = 3
Rich Lane6f4978c2013-10-20 21:33:52 -0700180OFPBRC_BAD_EXPERIMENTER_TYPE = 4
Rich Lanec2ee4b82013-04-24 17:12:38 -0700181OFPBRC_EPERM = 5
182OFPBRC_BAD_LEN = 6
183OFPBRC_BUFFER_EMPTY = 7
184OFPBRC_BUFFER_UNKNOWN = 8
185OFPBRC_BAD_TABLE_ID = 9
186OFPBRC_IS_SLAVE = 10
187OFPBRC_BAD_PORT = 11
188OFPBRC_BAD_PACKET = 12
189
190ofp_bad_request_code_map = {
191 0: 'OFPBRC_BAD_VERSION',
192 1: 'OFPBRC_BAD_TYPE',
193 2: 'OFPBRC_BAD_STAT',
194 3: 'OFPBRC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700195 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700196 5: 'OFPBRC_EPERM',
197 6: 'OFPBRC_BAD_LEN',
198 7: 'OFPBRC_BUFFER_EMPTY',
199 8: 'OFPBRC_BUFFER_UNKNOWN',
200 9: 'OFPBRC_BAD_TABLE_ID',
201 10: 'OFPBRC_IS_SLAVE',
202 11: 'OFPBRC_BAD_PORT',
203 12: 'OFPBRC_BAD_PACKET',
204}
205
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700206# Identifiers from group ofp_bsn_tcp_flag
207OFP_BSN_TCP_FLAG_FIN = 1
208OFP_BSN_TCP_FLAG_SYN = 2
209OFP_BSN_TCP_FLAG_RST = 4
210OFP_BSN_TCP_FLAG_PSH = 8
211OFP_BSN_TCP_FLAG_ACK = 16
212OFP_BSN_TCP_FLAG_URG = 32
213OFP_BSN_TCP_FLAG_ECE = 64
214OFP_BSN_TCP_FLAG_CWR = 128
215OFP_BSN_TCP_FLAG_NS = 256
216
217ofp_bsn_tcp_flag_map = {
218 1: 'OFP_BSN_TCP_FLAG_FIN',
219 2: 'OFP_BSN_TCP_FLAG_SYN',
220 4: 'OFP_BSN_TCP_FLAG_RST',
221 8: 'OFP_BSN_TCP_FLAG_PSH',
222 16: 'OFP_BSN_TCP_FLAG_ACK',
223 32: 'OFP_BSN_TCP_FLAG_URG',
224 64: 'OFP_BSN_TCP_FLAG_ECE',
225 128: 'OFP_BSN_TCP_FLAG_CWR',
226 256: 'OFP_BSN_TCP_FLAG_NS',
227}
228
Rich Lane93b33132014-04-21 12:20:58 -0700229# Identifiers from group ofp_bsn_vport_l2gre_flags
230OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
231OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
232OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700233OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lanef9530c42014-09-15 09:59:43 -0700234OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
Rich Lane93b33132014-04-21 12:20:58 -0700235
236ofp_bsn_vport_l2gre_flags_map = {
237 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
238 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
239 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700240 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lanef9530c42014-09-15 09:59:43 -0700241 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700242}
243
Dan Talaycof6202252013-07-02 01:00:29 -0700244# Identifiers from group ofp_bsn_vport_q_in_q_untagged
245OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
246
247ofp_bsn_vport_q_in_q_untagged_map = {
248 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
249}
250
Rich Laned53156a2013-08-05 17:17:33 -0700251# Identifiers from group ofp_bsn_vport_status
252OF_BSN_VPORT_STATUS_OK = 0
253OF_BSN_VPORT_STATUS_FAILED = 1
254
255ofp_bsn_vport_status_map = {
256 0: 'OF_BSN_VPORT_STATUS_OK',
257 1: 'OF_BSN_VPORT_STATUS_FAILED',
258}
259
Rich Lanec2ee4b82013-04-24 17:12:38 -0700260# Identifiers from group ofp_capabilities
261OFPC_FLOW_STATS = 1
262OFPC_TABLE_STATS = 2
263OFPC_PORT_STATS = 4
264OFPC_GROUP_STATS = 8
265OFPC_IP_REASM = 32
266OFPC_QUEUE_STATS = 64
267OFPC_PORT_BLOCKED = 256
268
269ofp_capabilities_map = {
270 1: 'OFPC_FLOW_STATS',
271 2: 'OFPC_TABLE_STATS',
272 4: 'OFPC_PORT_STATS',
273 8: 'OFPC_GROUP_STATS',
274 32: 'OFPC_IP_REASM',
275 64: 'OFPC_QUEUE_STATS',
276 256: 'OFPC_PORT_BLOCKED',
277}
278
279# Identifiers from group ofp_config_flags
280OFPC_FRAG_NORMAL = 0
281OFPC_FRAG_DROP = 1
282OFPC_FRAG_REASM = 2
283OFPC_FRAG_MASK = 3
284OFPC_INVALID_TTL_TO_CONTROLLER = 4
285
286ofp_config_flags_map = {
287 0: 'OFPC_FRAG_NORMAL',
288 1: 'OFPC_FRAG_DROP',
289 2: 'OFPC_FRAG_REASM',
290 3: 'OFPC_FRAG_MASK',
291 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
292}
293
294# Identifiers from group ofp_controller_max_len
295OFPCML_MAX = 65509
296OFPCML_NO_BUFFER = 65535
297
298ofp_controller_max_len_map = {
299 65509: 'OFPCML_MAX',
300 65535: 'OFPCML_NO_BUFFER',
301}
302
303# Identifiers from group ofp_controller_role
304OFPCR_ROLE_NOCHANGE = 0
305OFPCR_ROLE_EQUAL = 1
306OFPCR_ROLE_MASTER = 2
307OFPCR_ROLE_SLAVE = 3
308
309ofp_controller_role_map = {
310 0: 'OFPCR_ROLE_NOCHANGE',
311 1: 'OFPCR_ROLE_EQUAL',
312 2: 'OFPCR_ROLE_MASTER',
313 3: 'OFPCR_ROLE_SLAVE',
314}
315
316# Identifiers from group ofp_error_type
317OFPET_HELLO_FAILED = 0
318OFPET_BAD_REQUEST = 1
319OFPET_BAD_ACTION = 2
320OFPET_BAD_INSTRUCTION = 3
321OFPET_BAD_MATCH = 4
322OFPET_FLOW_MOD_FAILED = 5
323OFPET_GROUP_MOD_FAILED = 6
324OFPET_PORT_MOD_FAILED = 7
325OFPET_TABLE_MOD_FAILED = 8
326OFPET_QUEUE_OP_FAILED = 9
327OFPET_SWITCH_CONFIG_FAILED = 10
328OFPET_ROLE_REQUEST_FAILED = 11
329OFPET_EXPERIMENTER = 65535
330
331ofp_error_type_map = {
332 0: 'OFPET_HELLO_FAILED',
333 1: 'OFPET_BAD_REQUEST',
334 2: 'OFPET_BAD_ACTION',
335 3: 'OFPET_BAD_INSTRUCTION',
336 4: 'OFPET_BAD_MATCH',
337 5: 'OFPET_FLOW_MOD_FAILED',
338 6: 'OFPET_GROUP_MOD_FAILED',
339 7: 'OFPET_PORT_MOD_FAILED',
340 8: 'OFPET_TABLE_MOD_FAILED',
341 9: 'OFPET_QUEUE_OP_FAILED',
342 10: 'OFPET_SWITCH_CONFIG_FAILED',
343 11: 'OFPET_ROLE_REQUEST_FAILED',
344 65535: 'OFPET_EXPERIMENTER',
345}
346
347# Identifiers from group ofp_flow_mod_command
348OFPFC_ADD = 0
349OFPFC_MODIFY = 1
350OFPFC_MODIFY_STRICT = 2
351OFPFC_DELETE = 3
352OFPFC_DELETE_STRICT = 4
353
354ofp_flow_mod_command_map = {
355 0: 'OFPFC_ADD',
356 1: 'OFPFC_MODIFY',
357 2: 'OFPFC_MODIFY_STRICT',
358 3: 'OFPFC_DELETE',
359 4: 'OFPFC_DELETE_STRICT',
360}
361
362# Identifiers from group ofp_flow_mod_failed_code
363OFPFMFC_UNKNOWN = 0
364OFPFMFC_TABLE_FULL = 1
365OFPFMFC_BAD_TABLE_ID = 2
366OFPFMFC_OVERLAP = 3
367OFPFMFC_EPERM = 4
368OFPFMFC_BAD_TIMEOUT = 5
369OFPFMFC_BAD_COMMAND = 6
370OFPFMFC_BAD_FLAGS = 7
371
372ofp_flow_mod_failed_code_map = {
373 0: 'OFPFMFC_UNKNOWN',
374 1: 'OFPFMFC_TABLE_FULL',
375 2: 'OFPFMFC_BAD_TABLE_ID',
376 3: 'OFPFMFC_OVERLAP',
377 4: 'OFPFMFC_EPERM',
378 5: 'OFPFMFC_BAD_TIMEOUT',
379 6: 'OFPFMFC_BAD_COMMAND',
380 7: 'OFPFMFC_BAD_FLAGS',
381}
382
383# Identifiers from group ofp_flow_mod_flags
384OFPFF_SEND_FLOW_REM = 1
385OFPFF_CHECK_OVERLAP = 2
386OFPFF_RESET_COUNTS = 4
387
388ofp_flow_mod_flags_map = {
389 1: 'OFPFF_SEND_FLOW_REM',
390 2: 'OFPFF_CHECK_OVERLAP',
391 4: 'OFPFF_RESET_COUNTS',
392}
393
394# Identifiers from group ofp_flow_removed_reason
395OFPRR_IDLE_TIMEOUT = 0
396OFPRR_HARD_TIMEOUT = 1
397OFPRR_DELETE = 2
398OFPRR_GROUP_DELETE = 3
399
400ofp_flow_removed_reason_map = {
401 0: 'OFPRR_IDLE_TIMEOUT',
402 1: 'OFPRR_HARD_TIMEOUT',
403 2: 'OFPRR_DELETE',
404 3: 'OFPRR_GROUP_DELETE',
405}
406
407# Identifiers from group ofp_group
408OFPG_MAX = 4294967040
409OFPG_ALL = 4294967292
410OFPG_ANY = 4294967295
411
412ofp_group_map = {
413 4294967040: 'OFPG_MAX',
414 4294967292: 'OFPG_ALL',
415 4294967295: 'OFPG_ANY',
416}
417
418# Identifiers from group ofp_group_capabilities
419OFPGFC_SELECT_WEIGHT = 1
420OFPGFC_SELECT_LIVENESS = 2
421OFPGFC_CHAINING = 4
422OFPGFC_CHAINING_CHECKS = 8
423
424ofp_group_capabilities_map = {
425 1: 'OFPGFC_SELECT_WEIGHT',
426 2: 'OFPGFC_SELECT_LIVENESS',
427 4: 'OFPGFC_CHAINING',
428 8: 'OFPGFC_CHAINING_CHECKS',
429}
430
431# Identifiers from group ofp_group_mod_command
432OFPGC_ADD = 0
433OFPGC_MODIFY = 1
434OFPGC_DELETE = 2
435
436ofp_group_mod_command_map = {
437 0: 'OFPGC_ADD',
438 1: 'OFPGC_MODIFY',
439 2: 'OFPGC_DELETE',
440}
441
442# Identifiers from group ofp_group_mod_failed_code
443OFPGMFC_GROUP_EXISTS = 0
444OFPGMFC_INVALID_GROUP = 1
445OFPGMFC_WEIGHT_UNSUPPORTED = 2
446OFPGMFC_OUT_OF_GROUPS = 3
447OFPGMFC_OUT_OF_BUCKETS = 4
448OFPGMFC_CHAINING_UNSUPPORTED = 5
449OFPGMFC_WATCH_UNSUPPORTED = 6
450OFPGMFC_LOOP = 7
451OFPGMFC_UNKNOWN_GROUP = 8
452OFPGMFC_CHAINED_GROUP = 9
453OFPGMFC_BAD_TYPE = 10
454OFPGMFC_BAD_COMMAND = 11
455OFPGMFC_BAD_BUCKET = 12
456OFPGMFC_BAD_WATCH = 13
457OFPGMFC_EPERM = 14
458
459ofp_group_mod_failed_code_map = {
460 0: 'OFPGMFC_GROUP_EXISTS',
461 1: 'OFPGMFC_INVALID_GROUP',
462 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
463 3: 'OFPGMFC_OUT_OF_GROUPS',
464 4: 'OFPGMFC_OUT_OF_BUCKETS',
465 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
466 6: 'OFPGMFC_WATCH_UNSUPPORTED',
467 7: 'OFPGMFC_LOOP',
468 8: 'OFPGMFC_UNKNOWN_GROUP',
469 9: 'OFPGMFC_CHAINED_GROUP',
470 10: 'OFPGMFC_BAD_TYPE',
471 11: 'OFPGMFC_BAD_COMMAND',
472 12: 'OFPGMFC_BAD_BUCKET',
473 13: 'OFPGMFC_BAD_WATCH',
474 14: 'OFPGMFC_EPERM',
475}
476
477# Identifiers from group ofp_group_type
478OFPGT_ALL = 0
479OFPGT_SELECT = 1
480OFPGT_INDIRECT = 2
481OFPGT_FF = 3
482
483ofp_group_type_map = {
484 0: 'OFPGT_ALL',
485 1: 'OFPGT_SELECT',
486 2: 'OFPGT_INDIRECT',
487 3: 'OFPGT_FF',
488}
489
490# Identifiers from group ofp_hello_failed_code
491OFPHFC_INCOMPATIBLE = 0
492OFPHFC_EPERM = 1
493
494ofp_hello_failed_code_map = {
495 0: 'OFPHFC_INCOMPATIBLE',
496 1: 'OFPHFC_EPERM',
497}
498
499# Identifiers from group ofp_instruction_type
500OFPIT_GOTO_TABLE = 1
501OFPIT_WRITE_METADATA = 2
502OFPIT_WRITE_ACTIONS = 3
503OFPIT_APPLY_ACTIONS = 4
504OFPIT_CLEAR_ACTIONS = 5
505OFPIT_EXPERIMENTER = 65535
506
507ofp_instruction_type_map = {
508 1: 'OFPIT_GOTO_TABLE',
509 2: 'OFPIT_WRITE_METADATA',
510 3: 'OFPIT_WRITE_ACTIONS',
511 4: 'OFPIT_APPLY_ACTIONS',
512 5: 'OFPIT_CLEAR_ACTIONS',
513 65535: 'OFPIT_EXPERIMENTER',
514}
515
516# Identifiers from group ofp_match_type
517OFPMT_STANDARD = 0
518OFPMT_OXM = 1
519
520ofp_match_type_map = {
521 0: 'OFPMT_STANDARD',
522 1: 'OFPMT_OXM',
523}
524
525# Identifiers from group ofp_oxm_class
526OFPXMC_NXM_0 = 0
527OFPXMC_NXM_1 = 1
528OFPXMC_OPENFLOW_BASIC = 32768
529OFPXMC_EXPERIMENTER = 65535
530
531ofp_oxm_class_map = {
532 0: 'OFPXMC_NXM_0',
533 1: 'OFPXMC_NXM_1',
534 32768: 'OFPXMC_OPENFLOW_BASIC',
535 65535: 'OFPXMC_EXPERIMENTER',
536}
537
538# Identifiers from group ofp_packet_in_reason
539OFPR_NO_MATCH = 0
540OFPR_ACTION = 1
541OFPR_INVALID_TTL = 2
542
543ofp_packet_in_reason_map = {
544 0: 'OFPR_NO_MATCH',
545 1: 'OFPR_ACTION',
546 2: 'OFPR_INVALID_TTL',
547}
548
549# Identifiers from group ofp_port
550OFPP_MAX = 4294967040
551OFPP_IN_PORT = 4294967288
552OFPP_TABLE = 4294967289
553OFPP_NORMAL = 4294967290
554OFPP_FLOOD = 4294967291
555OFPP_ALL = 4294967292
556OFPP_CONTROLLER = 4294967293
557OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800558OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700559
560ofp_port_map = {
561 4294967040: 'OFPP_MAX',
562 4294967288: 'OFPP_IN_PORT',
563 4294967289: 'OFPP_TABLE',
564 4294967290: 'OFPP_NORMAL',
565 4294967291: 'OFPP_FLOOD',
566 4294967292: 'OFPP_ALL',
567 4294967293: 'OFPP_CONTROLLER',
568 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800569 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700570}
571
572# Identifiers from group ofp_port_config
573OFPPC_PORT_DOWN = 1
574OFPPC_NO_RECV = 4
575OFPPC_NO_FWD = 32
576OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700577OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700578
579ofp_port_config_map = {
580 1: 'OFPPC_PORT_DOWN',
581 4: 'OFPPC_NO_RECV',
582 32: 'OFPPC_NO_FWD',
583 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700584 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700585}
586
587# Identifiers from group ofp_port_features
588OFPPF_10MB_HD = 1
589OFPPF_10MB_FD = 2
590OFPPF_100MB_HD = 4
591OFPPF_100MB_FD = 8
592OFPPF_1GB_HD = 16
593OFPPF_1GB_FD = 32
594OFPPF_10GB_FD = 64
595OFPPF_40GB_FD = 128
596OFPPF_100GB_FD = 256
597OFPPF_1TB_FD = 512
598OFPPF_OTHER = 1024
599OFPPF_COPPER = 2048
600OFPPF_FIBER = 4096
601OFPPF_AUTONEG = 8192
602OFPPF_PAUSE = 16384
603OFPPF_PAUSE_ASYM = 32768
604
605ofp_port_features_map = {
606 1: 'OFPPF_10MB_HD',
607 2: 'OFPPF_10MB_FD',
608 4: 'OFPPF_100MB_HD',
609 8: 'OFPPF_100MB_FD',
610 16: 'OFPPF_1GB_HD',
611 32: 'OFPPF_1GB_FD',
612 64: 'OFPPF_10GB_FD',
613 128: 'OFPPF_40GB_FD',
614 256: 'OFPPF_100GB_FD',
615 512: 'OFPPF_1TB_FD',
616 1024: 'OFPPF_OTHER',
617 2048: 'OFPPF_COPPER',
618 4096: 'OFPPF_FIBER',
619 8192: 'OFPPF_AUTONEG',
620 16384: 'OFPPF_PAUSE',
621 32768: 'OFPPF_PAUSE_ASYM',
622}
623
624# Identifiers from group ofp_port_mod_failed_code
625OFPPMFC_BAD_PORT = 0
626OFPPMFC_BAD_HW_ADDR = 1
627OFPPMFC_BAD_CONFIG = 2
628OFPPMFC_BAD_ADVERTISE = 3
629OFPPMFC_EPERM = 4
630
631ofp_port_mod_failed_code_map = {
632 0: 'OFPPMFC_BAD_PORT',
633 1: 'OFPPMFC_BAD_HW_ADDR',
634 2: 'OFPPMFC_BAD_CONFIG',
635 3: 'OFPPMFC_BAD_ADVERTISE',
636 4: 'OFPPMFC_EPERM',
637}
638
Rich Lanec2ee4b82013-04-24 17:12:38 -0700639# Identifiers from group ofp_port_reason
640OFPPR_ADD = 0
641OFPPR_DELETE = 1
642OFPPR_MODIFY = 2
643
644ofp_port_reason_map = {
645 0: 'OFPPR_ADD',
646 1: 'OFPPR_DELETE',
647 2: 'OFPPR_MODIFY',
648}
649
650# Identifiers from group ofp_port_state
651OFPPS_LINK_DOWN = 1
652OFPPS_BLOCKED = 2
653OFPPS_LIVE = 4
654
655ofp_port_state_map = {
656 1: 'OFPPS_LINK_DOWN',
657 2: 'OFPPS_BLOCKED',
658 4: 'OFPPS_LIVE',
659}
660
661# Identifiers from group ofp_queue_op_failed_code
662OFPQOFC_BAD_PORT = 0
663OFPQOFC_BAD_QUEUE = 1
664OFPQOFC_EPERM = 2
665
666ofp_queue_op_failed_code_map = {
667 0: 'OFPQOFC_BAD_PORT',
668 1: 'OFPQOFC_BAD_QUEUE',
669 2: 'OFPQOFC_EPERM',
670}
671
672# Identifiers from group ofp_queue_properties
673OFPQT_MIN_RATE = 1
674OFPQT_MAX_RATE = 2
675OFPQT_EXPERIMENTER = 65535
676
677ofp_queue_properties_map = {
678 1: 'OFPQT_MIN_RATE',
679 2: 'OFPQT_MAX_RATE',
680 65535: 'OFPQT_EXPERIMENTER',
681}
682
683# Identifiers from group ofp_role_request_failed_code
684OFPRRFC_STALE = 0
685OFPRRFC_UNSUP = 1
686OFPRRFC_BAD_ROLE = 2
687
688ofp_role_request_failed_code_map = {
689 0: 'OFPRRFC_STALE',
690 1: 'OFPRRFC_UNSUP',
691 2: 'OFPRRFC_BAD_ROLE',
692}
693
694# Identifiers from group ofp_stats_reply_flags
695OFPSF_REPLY_MORE = 1
696
697ofp_stats_reply_flags_map = {
698 1: 'OFPSF_REPLY_MORE',
699}
700
Rich Laned9e3f7b2013-11-04 11:40:43 -0800701# Identifiers from group ofp_stats_request_flags
702
703ofp_stats_request_flags_map = {
704}
705
Rich Lane6f4978c2013-10-20 21:33:52 -0700706# Identifiers from group ofp_stats_type
Rich Lanec2ee4b82013-04-24 17:12:38 -0700707OFPST_DESC = 0
708OFPST_FLOW = 1
709OFPST_AGGREGATE = 2
710OFPST_TABLE = 3
711OFPST_PORT = 4
712OFPST_QUEUE = 5
713OFPST_GROUP = 6
714OFPST_GROUP_DESC = 7
715OFPST_GROUP_FEATURES = 8
716OFPST_EXPERIMENTER = 65535
717
Rich Lane6f4978c2013-10-20 21:33:52 -0700718ofp_stats_type_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700719 0: 'OFPST_DESC',
720 1: 'OFPST_FLOW',
721 2: 'OFPST_AGGREGATE',
722 3: 'OFPST_TABLE',
723 4: 'OFPST_PORT',
724 5: 'OFPST_QUEUE',
725 6: 'OFPST_GROUP',
726 7: 'OFPST_GROUP_DESC',
727 8: 'OFPST_GROUP_FEATURES',
728 65535: 'OFPST_EXPERIMENTER',
729}
730
731# Identifiers from group ofp_switch_config_failed_code
732OFPSCFC_BAD_FLAGS = 0
733OFPSCFC_BAD_LEN = 1
734OFPSCFC_EPERM = 2
735
736ofp_switch_config_failed_code_map = {
737 0: 'OFPSCFC_BAD_FLAGS',
738 1: 'OFPSCFC_BAD_LEN',
739 2: 'OFPSCFC_EPERM',
740}
741
742# Identifiers from group ofp_table
743OFPTT_MAX = 254
744OFPTT_ALL = 255
745
746ofp_table_map = {
747 254: 'OFPTT_MAX',
748 255: 'OFPTT_ALL',
749}
750
751# Identifiers from group ofp_table_config
752OFPTC_TABLE_MISS_CONTROLLER = 0
753OFPTC_TABLE_MISS_CONTINUE = 1
754OFPTC_TABLE_MISS_DROP = 2
755OFPTC_TABLE_MISS_MASK = 3
756
757ofp_table_config_map = {
758 0: 'OFPTC_TABLE_MISS_CONTROLLER',
759 1: 'OFPTC_TABLE_MISS_CONTINUE',
760 2: 'OFPTC_TABLE_MISS_DROP',
761 3: 'OFPTC_TABLE_MISS_MASK',
762}
763
764# Identifiers from group ofp_table_mod_failed_code
765OFPTMFC_BAD_TABLE = 0
766OFPTMFC_BAD_CONFIG = 1
767OFPTMFC_EPERM = 2
768
769ofp_table_mod_failed_code_map = {
770 0: 'OFPTMFC_BAD_TABLE',
771 1: 'OFPTMFC_BAD_CONFIG',
772 2: 'OFPTMFC_EPERM',
773}
774
775# Identifiers from group ofp_type
776OFPT_HELLO = 0
777OFPT_ERROR = 1
778OFPT_ECHO_REQUEST = 2
779OFPT_ECHO_REPLY = 3
780OFPT_EXPERIMENTER = 4
781OFPT_FEATURES_REQUEST = 5
782OFPT_FEATURES_REPLY = 6
783OFPT_GET_CONFIG_REQUEST = 7
784OFPT_GET_CONFIG_REPLY = 8
785OFPT_SET_CONFIG = 9
786OFPT_PACKET_IN = 10
787OFPT_FLOW_REMOVED = 11
788OFPT_PORT_STATUS = 12
789OFPT_PACKET_OUT = 13
790OFPT_FLOW_MOD = 14
791OFPT_GROUP_MOD = 15
792OFPT_PORT_MOD = 16
793OFPT_TABLE_MOD = 17
794OFPT_STATS_REQUEST = 18
795OFPT_STATS_REPLY = 19
796OFPT_BARRIER_REQUEST = 20
797OFPT_BARRIER_REPLY = 21
798OFPT_QUEUE_GET_CONFIG_REQUEST = 22
799OFPT_QUEUE_GET_CONFIG_REPLY = 23
800OFPT_ROLE_REQUEST = 24
801OFPT_ROLE_REPLY = 25
802
803ofp_type_map = {
804 0: 'OFPT_HELLO',
805 1: 'OFPT_ERROR',
806 2: 'OFPT_ECHO_REQUEST',
807 3: 'OFPT_ECHO_REPLY',
808 4: 'OFPT_EXPERIMENTER',
809 5: 'OFPT_FEATURES_REQUEST',
810 6: 'OFPT_FEATURES_REPLY',
811 7: 'OFPT_GET_CONFIG_REQUEST',
812 8: 'OFPT_GET_CONFIG_REPLY',
813 9: 'OFPT_SET_CONFIG',
814 10: 'OFPT_PACKET_IN',
815 11: 'OFPT_FLOW_REMOVED',
816 12: 'OFPT_PORT_STATUS',
817 13: 'OFPT_PACKET_OUT',
818 14: 'OFPT_FLOW_MOD',
819 15: 'OFPT_GROUP_MOD',
820 16: 'OFPT_PORT_MOD',
821 17: 'OFPT_TABLE_MOD',
822 18: 'OFPT_STATS_REQUEST',
823 19: 'OFPT_STATS_REPLY',
824 20: 'OFPT_BARRIER_REQUEST',
825 21: 'OFPT_BARRIER_REPLY',
826 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
827 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
828 24: 'OFPT_ROLE_REQUEST',
829 25: 'OFPT_ROLE_REPLY',
830}
831
832# Identifiers from group ofp_vlan_id
833OFPVID_NONE = 0
834OFPVID_PRESENT = 4096
835
836ofp_vlan_id_map = {
837 0: 'OFPVID_NONE',
838 4096: 'OFPVID_PRESENT',
839}
840