blob: 9705d891548ab0c5ebed39a293b78115646df8df [file] [log] [blame]
Zack Williams9731cdc2019-11-22 15:42:30 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
15# Copyright (c) 2011, 2012 Open Networking Foundation
16# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
17# See the file LICENSE.pyloxi which should have been included in the source distribution
18
19# Automatically generated by LOXI from template const.py
20# Do not modify
21
22OFP_VERSION = 2
23
24# Identifiers from group macro_definitions
25OFP_MAX_TABLE_NAME_LEN = 32
26OFP_MAX_PORT_NAME_LEN = 16
27OFP_TCP_PORT = 6653
28OFP_SSL_PORT = 6653
29OFP_ETH_ALEN = 6
30OFP_DEFAULT_MISS_SEND_LEN = 128
31OFPFW_ICMP_TYPE = 64
32OFPFW_ICMP_CODE = 128
33OFP_DL_TYPE_ETH2_CUTOFF = 1536
34OFP_DL_TYPE_NOT_ETH_TYPE = 1535
35OFP_VLAN_NONE = 0
36OFPMT_STANDARD_LENGTH = 88
37OFP_FLOW_PERMANENT = 0
38OFP_DEFAULT_PRIORITY = 32768
39DESC_STR_LEN = 256
40SERIAL_NUM_LEN = 32
41OFPQ_ALL = 4294967295
42OFPQ_MIN_RATE_UNCFG = 65535
43
44# Identifiers from group of_bsn_pdu_slot_num
45BSN_PDU_SLOT_NUM_ANY = 255
46
47of_bsn_pdu_slot_num_map = {
48 255: 'BSN_PDU_SLOT_NUM_ANY',
49}
50
51# Identifiers from group ofp_action_type
52OFPAT_OUTPUT = 0
53OFPAT_SET_VLAN_VID = 1
54OFPAT_SET_VLAN_PCP = 2
55OFPAT_SET_DL_SRC = 3
56OFPAT_SET_DL_DST = 4
57OFPAT_SET_NW_SRC = 5
58OFPAT_SET_NW_DST = 6
59OFPAT_SET_NW_TOS = 7
60OFPAT_SET_NW_ECN = 8
61OFPAT_SET_TP_SRC = 9
62OFPAT_SET_TP_DST = 10
63OFPAT_COPY_TTL_OUT = 11
64OFPAT_COPY_TTL_IN = 12
65OFPAT_SET_MPLS_LABEL = 13
66OFPAT_SET_MPLS_TC = 14
67OFPAT_SET_MPLS_TTL = 15
68OFPAT_DEC_MPLS_TTL = 16
69OFPAT_PUSH_VLAN = 17
70OFPAT_POP_VLAN = 18
71OFPAT_PUSH_MPLS = 19
72OFPAT_POP_MPLS = 20
73OFPAT_SET_QUEUE = 21
74OFPAT_GROUP = 22
75OFPAT_SET_NW_TTL = 23
76OFPAT_DEC_NW_TTL = 24
77OFPAT_EXPERIMENTER = 65535
78
79ofp_action_type_map = {
80 0: 'OFPAT_OUTPUT',
81 1: 'OFPAT_SET_VLAN_VID',
82 2: 'OFPAT_SET_VLAN_PCP',
83 3: 'OFPAT_SET_DL_SRC',
84 4: 'OFPAT_SET_DL_DST',
85 5: 'OFPAT_SET_NW_SRC',
86 6: 'OFPAT_SET_NW_DST',
87 7: 'OFPAT_SET_NW_TOS',
88 8: 'OFPAT_SET_NW_ECN',
89 9: 'OFPAT_SET_TP_SRC',
90 10: 'OFPAT_SET_TP_DST',
91 11: 'OFPAT_COPY_TTL_OUT',
92 12: 'OFPAT_COPY_TTL_IN',
93 13: 'OFPAT_SET_MPLS_LABEL',
94 14: 'OFPAT_SET_MPLS_TC',
95 15: 'OFPAT_SET_MPLS_TTL',
96 16: 'OFPAT_DEC_MPLS_TTL',
97 17: 'OFPAT_PUSH_VLAN',
98 18: 'OFPAT_POP_VLAN',
99 19: 'OFPAT_PUSH_MPLS',
100 20: 'OFPAT_POP_MPLS',
101 21: 'OFPAT_SET_QUEUE',
102 22: 'OFPAT_GROUP',
103 23: 'OFPAT_SET_NW_TTL',
104 24: 'OFPAT_DEC_NW_TTL',
105 65535: 'OFPAT_EXPERIMENTER',
106}
107
108# Identifiers from group ofp_bad_action_code
109OFPBAC_BAD_TYPE = 0
110OFPBAC_BAD_LEN = 1
111OFPBAC_BAD_EXPERIMENTER = 2
112OFPBAC_BAD_EXPERIMENTER_TYPE = 3
113OFPBAC_BAD_OUT_PORT = 4
114OFPBAC_BAD_ARGUMENT = 5
115OFPBAC_EPERM = 6
116OFPBAC_TOO_MANY = 7
117OFPBAC_BAD_QUEUE = 8
118OFPBAC_BAD_OUT_GROUP = 9
119OFPBAC_MATCH_INCONSISTENT = 10
120OFPBAC_UNSUPPORTED_ORDER = 11
121OFPBAC_BAD_TAG = 12
122
123ofp_bad_action_code_map = {
124 0: 'OFPBAC_BAD_TYPE',
125 1: 'OFPBAC_BAD_LEN',
126 2: 'OFPBAC_BAD_EXPERIMENTER',
127 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
128 4: 'OFPBAC_BAD_OUT_PORT',
129 5: 'OFPBAC_BAD_ARGUMENT',
130 6: 'OFPBAC_EPERM',
131 7: 'OFPBAC_TOO_MANY',
132 8: 'OFPBAC_BAD_QUEUE',
133 9: 'OFPBAC_BAD_OUT_GROUP',
134 10: 'OFPBAC_MATCH_INCONSISTENT',
135 11: 'OFPBAC_UNSUPPORTED_ORDER',
136 12: 'OFPBAC_BAD_TAG',
137}
138
139# Identifiers from group ofp_bad_instruction_code
140OFPBIC_UNKNOWN_INST = 0
141OFPBIC_UNSUP_INST = 1
142OFPBIC_BAD_TABLE_ID = 2
143OFPBIC_UNSUP_METADATA = 3
144OFPBIC_UNSUP_METADATA_MASK = 4
145OFPBIC_UNSUP_EXP_INST = 5
146
147ofp_bad_instruction_code_map = {
148 0: 'OFPBIC_UNKNOWN_INST',
149 1: 'OFPBIC_UNSUP_INST',
150 2: 'OFPBIC_BAD_TABLE_ID',
151 3: 'OFPBIC_UNSUP_METADATA',
152 4: 'OFPBIC_UNSUP_METADATA_MASK',
153 5: 'OFPBIC_UNSUP_EXP_INST',
154}
155
156# Identifiers from group ofp_bad_match_code
157OFPBMC_BAD_TYPE = 0
158OFPBMC_BAD_LEN = 1
159OFPBMC_BAD_TAG = 2
160OFPBMC_BAD_DL_ADDR_MASK = 3
161OFPBMC_BAD_NW_ADDR_MASK = 4
162OFPBMC_BAD_WILDCARDS = 5
163OFPBMC_BAD_FIELD = 6
164OFPBMC_BAD_VALUE = 7
165
166ofp_bad_match_code_map = {
167 0: 'OFPBMC_BAD_TYPE',
168 1: 'OFPBMC_BAD_LEN',
169 2: 'OFPBMC_BAD_TAG',
170 3: 'OFPBMC_BAD_DL_ADDR_MASK',
171 4: 'OFPBMC_BAD_NW_ADDR_MASK',
172 5: 'OFPBMC_BAD_WILDCARDS',
173 6: 'OFPBMC_BAD_FIELD',
174 7: 'OFPBMC_BAD_VALUE',
175}
176
177# Identifiers from group ofp_bad_request_code
178OFPBRC_BAD_VERSION = 0
179OFPBRC_BAD_TYPE = 1
180OFPBRC_BAD_STAT = 2
181OFPBRC_BAD_EXPERIMENTER = 3
182OFPBRC_BAD_SUBTYPE = 4
183OFPBRC_EPERM = 5
184OFPBRC_BAD_LEN = 6
185OFPBRC_BUFFER_EMPTY = 7
186OFPBRC_BUFFER_UNKNOWN = 8
187OFPBRC_BAD_TABLE_ID = 9
188
189ofp_bad_request_code_map = {
190 0: 'OFPBRC_BAD_VERSION',
191 1: 'OFPBRC_BAD_TYPE',
192 2: 'OFPBRC_BAD_STAT',
193 3: 'OFPBRC_BAD_EXPERIMENTER',
194 4: 'OFPBRC_BAD_SUBTYPE',
195 5: 'OFPBRC_EPERM',
196 6: 'OFPBRC_BAD_LEN',
197 7: 'OFPBRC_BUFFER_EMPTY',
198 8: 'OFPBRC_BUFFER_UNKNOWN',
199 9: 'OFPBRC_BAD_TABLE_ID',
200}
201
202# Identifiers from group ofp_bsn_vport_l2gre_flags
203OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
204OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
205OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
206OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
207OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
208
209ofp_bsn_vport_l2gre_flags_map = {
210 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
211 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
212 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
213 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
214 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
215}
216
217# Identifiers from group ofp_bsn_vport_q_in_q_untagged
218OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
219
220ofp_bsn_vport_q_in_q_untagged_map = {
221 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
222}
223
224# Identifiers from group ofp_bsn_vport_status
225OF_BSN_VPORT_STATUS_OK = 0
226OF_BSN_VPORT_STATUS_FAILED = 1
227
228ofp_bsn_vport_status_map = {
229 0: 'OF_BSN_VPORT_STATUS_OK',
230 1: 'OF_BSN_VPORT_STATUS_FAILED',
231}
232
233# Identifiers from group ofp_capabilities
234OFPC_FLOW_STATS = 1
235OFPC_TABLE_STATS = 2
236OFPC_PORT_STATS = 4
237OFPC_GROUP_STATS = 8
238OFPC_IP_REASM = 32
239OFPC_QUEUE_STATS = 64
240OFPC_ARP_MATCH_IP = 128
241
242ofp_capabilities_map = {
243 1: 'OFPC_FLOW_STATS',
244 2: 'OFPC_TABLE_STATS',
245 4: 'OFPC_PORT_STATS',
246 8: 'OFPC_GROUP_STATS',
247 32: 'OFPC_IP_REASM',
248 64: 'OFPC_QUEUE_STATS',
249 128: 'OFPC_ARP_MATCH_IP',
250}
251
252# Identifiers from group ofp_config_flags
253OFPC_FRAG_NORMAL = 0
254OFPC_FRAG_DROP = 1
255OFPC_FRAG_REASM = 2
256OFPC_FRAG_MASK = 3
257OFPC_INVALID_TTL_TO_CONTROLLER = 4
258
259ofp_config_flags_map = {
260 0: 'OFPC_FRAG_NORMAL',
261 1: 'OFPC_FRAG_DROP',
262 2: 'OFPC_FRAG_REASM',
263 3: 'OFPC_FRAG_MASK',
264 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
265}
266
267# Identifiers from group ofp_error_type
268OFPET_HELLO_FAILED = 0
269OFPET_BAD_REQUEST = 1
270OFPET_BAD_ACTION = 2
271OFPET_BAD_INSTRUCTION = 3
272OFPET_BAD_MATCH = 4
273OFPET_FLOW_MOD_FAILED = 5
274OFPET_GROUP_MOD_FAILED = 6
275OFPET_PORT_MOD_FAILED = 7
276OFPET_TABLE_MOD_FAILED = 8
277OFPET_QUEUE_OP_FAILED = 9
278OFPET_SWITCH_CONFIG_FAILED = 10
279
280ofp_error_type_map = {
281 0: 'OFPET_HELLO_FAILED',
282 1: 'OFPET_BAD_REQUEST',
283 2: 'OFPET_BAD_ACTION',
284 3: 'OFPET_BAD_INSTRUCTION',
285 4: 'OFPET_BAD_MATCH',
286 5: 'OFPET_FLOW_MOD_FAILED',
287 6: 'OFPET_GROUP_MOD_FAILED',
288 7: 'OFPET_PORT_MOD_FAILED',
289 8: 'OFPET_TABLE_MOD_FAILED',
290 9: 'OFPET_QUEUE_OP_FAILED',
291 10: 'OFPET_SWITCH_CONFIG_FAILED',
292}
293
294# Identifiers from group ofp_flow_mod_command
295OFPFC_ADD = 0
296OFPFC_MODIFY = 1
297OFPFC_MODIFY_STRICT = 2
298OFPFC_DELETE = 3
299OFPFC_DELETE_STRICT = 4
300
301ofp_flow_mod_command_map = {
302 0: 'OFPFC_ADD',
303 1: 'OFPFC_MODIFY',
304 2: 'OFPFC_MODIFY_STRICT',
305 3: 'OFPFC_DELETE',
306 4: 'OFPFC_DELETE_STRICT',
307}
308
309# Identifiers from group ofp_flow_mod_failed_code
310OFPFMFC_UNKNOWN = 0
311OFPFMFC_TABLE_FULL = 1
312OFPFMFC_BAD_TABLE_ID = 2
313OFPFMFC_OVERLAP = 3
314OFPFMFC_EPERM = 4
315OFPFMFC_BAD_TIMEOUT = 5
316OFPFMFC_BAD_COMMAND = 6
317
318ofp_flow_mod_failed_code_map = {
319 0: 'OFPFMFC_UNKNOWN',
320 1: 'OFPFMFC_TABLE_FULL',
321 2: 'OFPFMFC_BAD_TABLE_ID',
322 3: 'OFPFMFC_OVERLAP',
323 4: 'OFPFMFC_EPERM',
324 5: 'OFPFMFC_BAD_TIMEOUT',
325 6: 'OFPFMFC_BAD_COMMAND',
326}
327
328# Identifiers from group ofp_flow_mod_flags
329OFPFF_SEND_FLOW_REM = 1
330OFPFF_CHECK_OVERLAP = 2
331
332ofp_flow_mod_flags_map = {
333 1: 'OFPFF_SEND_FLOW_REM',
334 2: 'OFPFF_CHECK_OVERLAP',
335}
336
337# Identifiers from group ofp_flow_removed_reason
338OFPRR_IDLE_TIMEOUT = 0
339OFPRR_HARD_TIMEOUT = 1
340OFPRR_DELETE = 2
341OFPRR_GROUP_DELETE = 3
342
343ofp_flow_removed_reason_map = {
344 0: 'OFPRR_IDLE_TIMEOUT',
345 1: 'OFPRR_HARD_TIMEOUT',
346 2: 'OFPRR_DELETE',
347 3: 'OFPRR_GROUP_DELETE',
348}
349
350# Identifiers from group ofp_flow_wildcards
351OFPFW_IN_PORT = 1
352OFPFW_DL_VLAN = 2
353OFPFW_DL_VLAN_PCP = 4
354OFPFW_DL_TYPE = 8
355OFPFW_NW_TOS = 16
356OFPFW_NW_PROTO = 32
357OFPFW_TP_SRC = 64
358OFPFW_TP_DST = 128
359OFPFW_MPLS_LABEL = 256
360OFPFW_MPLS_TC = 512
361OFPFW_ALL = 1023
362
363ofp_flow_wildcards_map = {
364 1: 'OFPFW_IN_PORT',
365 2: 'OFPFW_DL_VLAN',
366 4: 'OFPFW_DL_VLAN_PCP',
367 8: 'OFPFW_DL_TYPE',
368 16: 'OFPFW_NW_TOS',
369 32: 'OFPFW_NW_PROTO',
370 64: 'OFPFW_TP_SRC',
371 128: 'OFPFW_TP_DST',
372 256: 'OFPFW_MPLS_LABEL',
373 512: 'OFPFW_MPLS_TC',
374}
375
376# Identifiers from group ofp_group
377OFPG_MAX = 4294967040
378OFPG_ALL = 4294967292
379OFPG_ANY = 4294967295
380
381ofp_group_map = {
382 4294967040: 'OFPG_MAX',
383 4294967292: 'OFPG_ALL',
384 4294967295: 'OFPG_ANY',
385}
386
387# Identifiers from group ofp_group_mod_command
388OFPGC_ADD = 0
389OFPGC_MODIFY = 1
390OFPGC_DELETE = 2
391
392ofp_group_mod_command_map = {
393 0: 'OFPGC_ADD',
394 1: 'OFPGC_MODIFY',
395 2: 'OFPGC_DELETE',
396}
397
398# Identifiers from group ofp_group_mod_failed_code
399OFPGMFC_GROUP_EXISTS = 0
400OFPGMFC_INVALID_GROUP = 1
401OFPGMFC_WEIGHT_UNSUPPORTED = 2
402OFPGMFC_OUT_OF_GROUPS = 3
403OFPGMFC_OUT_OF_BUCKETS = 4
404OFPGMFC_CHAINING_UNSUPPORTED = 5
405OFPGMFC_WATCH_UNSUPPORTED = 6
406OFPGMFC_LOOP = 7
407OFPGMFC_UNKNOWN_GROUP = 8
408
409ofp_group_mod_failed_code_map = {
410 0: 'OFPGMFC_GROUP_EXISTS',
411 1: 'OFPGMFC_INVALID_GROUP',
412 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
413 3: 'OFPGMFC_OUT_OF_GROUPS',
414 4: 'OFPGMFC_OUT_OF_BUCKETS',
415 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
416 6: 'OFPGMFC_WATCH_UNSUPPORTED',
417 7: 'OFPGMFC_LOOP',
418 8: 'OFPGMFC_UNKNOWN_GROUP',
419}
420
421# Identifiers from group ofp_group_type
422OFPGT_ALL = 0
423OFPGT_SELECT = 1
424OFPGT_INDIRECT = 2
425OFPGT_FF = 3
426
427ofp_group_type_map = {
428 0: 'OFPGT_ALL',
429 1: 'OFPGT_SELECT',
430 2: 'OFPGT_INDIRECT',
431 3: 'OFPGT_FF',
432}
433
434# Identifiers from group ofp_hello_failed_code
435OFPHFC_INCOMPATIBLE = 0
436OFPHFC_EPERM = 1
437
438ofp_hello_failed_code_map = {
439 0: 'OFPHFC_INCOMPATIBLE',
440 1: 'OFPHFC_EPERM',
441}
442
443# Identifiers from group ofp_instruction_type
444OFPIT_GOTO_TABLE = 1
445OFPIT_WRITE_METADATA = 2
446OFPIT_WRITE_ACTIONS = 3
447OFPIT_APPLY_ACTIONS = 4
448OFPIT_CLEAR_ACTIONS = 5
449OFPIT_EXPERIMENTER = 65535
450
451ofp_instruction_type_map = {
452 1: 'OFPIT_GOTO_TABLE',
453 2: 'OFPIT_WRITE_METADATA',
454 3: 'OFPIT_WRITE_ACTIONS',
455 4: 'OFPIT_APPLY_ACTIONS',
456 5: 'OFPIT_CLEAR_ACTIONS',
457 65535: 'OFPIT_EXPERIMENTER',
458}
459
460# Identifiers from group ofp_match_type
461OFPMT_STANDARD = 0
462
463ofp_match_type_map = {
464 0: 'OFPMT_STANDARD',
465}
466
467# Identifiers from group ofp_packet_in_reason
468OFPR_NO_MATCH = 0
469OFPR_ACTION = 1
470
471ofp_packet_in_reason_map = {
472 0: 'OFPR_NO_MATCH',
473 1: 'OFPR_ACTION',
474}
475
476# Identifiers from group ofp_port
477OFPP_MAX = 4294967040
478OFPP_IN_PORT = 4294967288
479OFPP_TABLE = 4294967289
480OFPP_NORMAL = 4294967290
481OFPP_FLOOD = 4294967291
482OFPP_ALL = 4294967292
483OFPP_CONTROLLER = 4294967293
484OFPP_LOCAL = 4294967294
485OFPP_ANY = 4294967295
486
487ofp_port_map = {
488 4294967040: 'OFPP_MAX',
489 4294967288: 'OFPP_IN_PORT',
490 4294967289: 'OFPP_TABLE',
491 4294967290: 'OFPP_NORMAL',
492 4294967291: 'OFPP_FLOOD',
493 4294967292: 'OFPP_ALL',
494 4294967293: 'OFPP_CONTROLLER',
495 4294967294: 'OFPP_LOCAL',
496 4294967295: 'OFPP_ANY',
497}
498
499# Identifiers from group ofp_port_config
500OFPPC_PORT_DOWN = 1
501OFPPC_NO_RECV = 4
502OFPPC_NO_FWD = 32
503OFPPC_NO_PACKET_IN = 64
504OFPPC_BSN_MIRROR_DEST = 2147483648
505
506ofp_port_config_map = {
507 1: 'OFPPC_PORT_DOWN',
508 4: 'OFPPC_NO_RECV',
509 32: 'OFPPC_NO_FWD',
510 64: 'OFPPC_NO_PACKET_IN',
511 2147483648: 'OFPPC_BSN_MIRROR_DEST',
512}
513
514# Identifiers from group ofp_port_features
515OFPPF_10MB_HD = 1
516OFPPF_10MB_FD = 2
517OFPPF_100MB_HD = 4
518OFPPF_100MB_FD = 8
519OFPPF_1GB_HD = 16
520OFPPF_1GB_FD = 32
521OFPPF_10GB_FD = 64
522OFPPF_40GB_FD = 128
523OFPPF_100GB_FD = 256
524OFPPF_1TB_FD = 512
525OFPPF_OTHER = 1024
526OFPPF_COPPER = 2048
527OFPPF_FIBER = 4096
528OFPPF_AUTONEG = 8192
529OFPPF_PAUSE = 16384
530OFPPF_PAUSE_ASYM = 32768
531
532ofp_port_features_map = {
533 1: 'OFPPF_10MB_HD',
534 2: 'OFPPF_10MB_FD',
535 4: 'OFPPF_100MB_HD',
536 8: 'OFPPF_100MB_FD',
537 16: 'OFPPF_1GB_HD',
538 32: 'OFPPF_1GB_FD',
539 64: 'OFPPF_10GB_FD',
540 128: 'OFPPF_40GB_FD',
541 256: 'OFPPF_100GB_FD',
542 512: 'OFPPF_1TB_FD',
543 1024: 'OFPPF_OTHER',
544 2048: 'OFPPF_COPPER',
545 4096: 'OFPPF_FIBER',
546 8192: 'OFPPF_AUTONEG',
547 16384: 'OFPPF_PAUSE',
548 32768: 'OFPPF_PAUSE_ASYM',
549}
550
551# Identifiers from group ofp_port_mod_failed_code
552OFPPMFC_BAD_PORT = 0
553OFPPMFC_BAD_HW_ADDR = 1
554OFPPMFC_BAD_CONFIG = 2
555OFPPMFC_BAD_ADVERTISE = 3
556
557ofp_port_mod_failed_code_map = {
558 0: 'OFPPMFC_BAD_PORT',
559 1: 'OFPPMFC_BAD_HW_ADDR',
560 2: 'OFPPMFC_BAD_CONFIG',
561 3: 'OFPPMFC_BAD_ADVERTISE',
562}
563
564# Identifiers from group ofp_port_reason
565OFPPR_ADD = 0
566OFPPR_DELETE = 1
567OFPPR_MODIFY = 2
568
569ofp_port_reason_map = {
570 0: 'OFPPR_ADD',
571 1: 'OFPPR_DELETE',
572 2: 'OFPPR_MODIFY',
573}
574
575# Identifiers from group ofp_port_state
576OFPPS_LINK_DOWN = 1
577OFPPS_BLOCKED = 2
578OFPPS_LIVE = 4
579
580ofp_port_state_map = {
581 1: 'OFPPS_LINK_DOWN',
582 2: 'OFPPS_BLOCKED',
583 4: 'OFPPS_LIVE',
584}
585
586# Identifiers from group ofp_queue_op_failed_code
587OFPQOFC_BAD_PORT = 0
588OFPQOFC_BAD_QUEUE = 1
589OFPQOFC_EPERM = 2
590
591ofp_queue_op_failed_code_map = {
592 0: 'OFPQOFC_BAD_PORT',
593 1: 'OFPQOFC_BAD_QUEUE',
594 2: 'OFPQOFC_EPERM',
595}
596
597# Identifiers from group ofp_queue_properties
598OFPQT_NONE = 0
599OFPQT_MIN_RATE = 1
600
601ofp_queue_properties_map = {
602 0: 'OFPQT_NONE',
603 1: 'OFPQT_MIN_RATE',
604}
605
606# Identifiers from group ofp_stats_reply_flags
607OFPSF_REPLY_MORE = 1
608
609ofp_stats_reply_flags_map = {
610 1: 'OFPSF_REPLY_MORE',
611}
612
613# Identifiers from group ofp_stats_request_flags
614
615ofp_stats_request_flags_map = {
616}
617
618# Identifiers from group ofp_stats_type
619OFPST_DESC = 0
620OFPST_FLOW = 1
621OFPST_AGGREGATE = 2
622OFPST_TABLE = 3
623OFPST_PORT = 4
624OFPST_QUEUE = 5
625OFPST_GROUP = 6
626OFPST_GROUP_DESC = 7
627OFPST_EXPERIMENTER = 65535
628
629ofp_stats_type_map = {
630 0: 'OFPST_DESC',
631 1: 'OFPST_FLOW',
632 2: 'OFPST_AGGREGATE',
633 3: 'OFPST_TABLE',
634 4: 'OFPST_PORT',
635 5: 'OFPST_QUEUE',
636 6: 'OFPST_GROUP',
637 7: 'OFPST_GROUP_DESC',
638 65535: 'OFPST_EXPERIMENTER',
639}
640
641# Identifiers from group ofp_switch_config_failed_code
642OFPSCFC_BAD_FLAGS = 0
643OFPSCFC_BAD_LEN = 1
644
645ofp_switch_config_failed_code_map = {
646 0: 'OFPSCFC_BAD_FLAGS',
647 1: 'OFPSCFC_BAD_LEN',
648}
649
650# Identifiers from group ofp_table_config
651OFPTC_TABLE_MISS_CONTROLLER = 0
652OFPTC_TABLE_MISS_CONTINUE = 1
653OFPTC_TABLE_MISS_DROP = 2
654OFPTC_TABLE_MISS_MASK = 3
655
656ofp_table_config_map = {
657 0: 'OFPTC_TABLE_MISS_CONTROLLER',
658 1: 'OFPTC_TABLE_MISS_CONTINUE',
659 2: 'OFPTC_TABLE_MISS_DROP',
660 3: 'OFPTC_TABLE_MISS_MASK',
661}
662
663# Identifiers from group ofp_table_mod_failed_code
664OFPTMFC_BAD_TABLE = 0
665OFPTMFC_BAD_CONFIG = 1
666
667ofp_table_mod_failed_code_map = {
668 0: 'OFPTMFC_BAD_TABLE',
669 1: 'OFPTMFC_BAD_CONFIG',
670}
671
672# Identifiers from group ofp_type
673OFPT_HELLO = 0
674OFPT_ERROR = 1
675OFPT_ECHO_REQUEST = 2
676OFPT_ECHO_REPLY = 3
677OFPT_EXPERIMENTER = 4
678OFPT_FEATURES_REQUEST = 5
679OFPT_FEATURES_REPLY = 6
680OFPT_GET_CONFIG_REQUEST = 7
681OFPT_GET_CONFIG_REPLY = 8
682OFPT_SET_CONFIG = 9
683OFPT_PACKET_IN = 10
684OFPT_FLOW_REMOVED = 11
685OFPT_PORT_STATUS = 12
686OFPT_PACKET_OUT = 13
687OFPT_FLOW_MOD = 14
688OFPT_GROUP_MOD = 15
689OFPT_PORT_MOD = 16
690OFPT_TABLE_MOD = 17
691OFPT_STATS_REQUEST = 18
692OFPT_STATS_REPLY = 19
693OFPT_BARRIER_REQUEST = 20
694OFPT_BARRIER_REPLY = 21
695OFPT_QUEUE_GET_CONFIG_REQUEST = 22
696OFPT_QUEUE_GET_CONFIG_REPLY = 23
697
698ofp_type_map = {
699 0: 'OFPT_HELLO',
700 1: 'OFPT_ERROR',
701 2: 'OFPT_ECHO_REQUEST',
702 3: 'OFPT_ECHO_REPLY',
703 4: 'OFPT_EXPERIMENTER',
704 5: 'OFPT_FEATURES_REQUEST',
705 6: 'OFPT_FEATURES_REPLY',
706 7: 'OFPT_GET_CONFIG_REQUEST',
707 8: 'OFPT_GET_CONFIG_REPLY',
708 9: 'OFPT_SET_CONFIG',
709 10: 'OFPT_PACKET_IN',
710 11: 'OFPT_FLOW_REMOVED',
711 12: 'OFPT_PORT_STATUS',
712 13: 'OFPT_PACKET_OUT',
713 14: 'OFPT_FLOW_MOD',
714 15: 'OFPT_GROUP_MOD',
715 16: 'OFPT_PORT_MOD',
716 17: 'OFPT_TABLE_MOD',
717 18: 'OFPT_STATS_REQUEST',
718 19: 'OFPT_STATS_REPLY',
719 20: 'OFPT_BARRIER_REQUEST',
720 21: 'OFPT_BARRIER_REPLY',
721 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
722 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
723}
724
725# Identifiers from group ofp_vlan_id
726OFPVID_ANY = 65534
727OFPVID_NONE = 65535
728
729ofp_vlan_id_map = {
730 65534: 'OFPVID_ANY',
731 65535: 'OFPVID_NONE',
732}
733