blob: fa9c93c957419ecdaa3b3105891908f8877fdc15 [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.
4
5# Automatically generated by LOXI from template const.py
6# Do not modify
7
8OFP_VERSION = 3
9
10# Identifiers from group macro_definitions
11OFP_VLAN_NONE = 0
12OFP_FLOW_PERMANENT = 0
13OFP_ETH_ALEN = 6
14OFP_MAX_PORT_NAME_LEN = 16
15OFP_MAX_TABLE_NAME_LEN = 32
16SERIAL_NUM_LEN = 32
17OFP_DEFAULT_MISS_SEND_LEN = 128
18DESC_STR_LEN = 256
19OFP_TCP_PORT = 6633
20OFP_SSL_PORT = 6633
21OFP_DEFAULT_PRIORITY = 32768
22OFPQ_MIN_RATE_UNCFG = 65535
23OFPQ_MAX_RATE_UNCFG = 65535
24OFPQ_ALL = 4294967295
25OFP_NO_BUFFER = 4294967295
26
27# Identifiers from group ofp_action_type
28OFPAT_OUTPUT = 0
29OFPAT_COPY_TTL_OUT = 11
30OFPAT_COPY_TTL_IN = 12
31OFPAT_SET_MPLS_TTL = 15
32OFPAT_DEC_MPLS_TTL = 16
33OFPAT_PUSH_VLAN = 17
34OFPAT_POP_VLAN = 18
35OFPAT_PUSH_MPLS = 19
36OFPAT_POP_MPLS = 20
37OFPAT_SET_QUEUE = 21
38OFPAT_GROUP = 22
39OFPAT_SET_NW_TTL = 23
40OFPAT_DEC_NW_TTL = 24
41OFPAT_SET_FIELD = 25
42OFPAT_EXPERIMENTER = 65535
43
44ofp_action_type_map = {
45 0: 'OFPAT_OUTPUT',
46 11: 'OFPAT_COPY_TTL_OUT',
47 12: 'OFPAT_COPY_TTL_IN',
48 15: 'OFPAT_SET_MPLS_TTL',
49 16: 'OFPAT_DEC_MPLS_TTL',
50 17: 'OFPAT_PUSH_VLAN',
51 18: 'OFPAT_POP_VLAN',
52 19: 'OFPAT_PUSH_MPLS',
53 20: 'OFPAT_POP_MPLS',
54 21: 'OFPAT_SET_QUEUE',
55 22: 'OFPAT_GROUP',
56 23: 'OFPAT_SET_NW_TTL',
57 24: 'OFPAT_DEC_NW_TTL',
58 25: 'OFPAT_SET_FIELD',
59 65535: 'OFPAT_EXPERIMENTER',
60}
61
62# Identifiers from group ofp_bad_action_code
63OFPBAC_BAD_TYPE = 0
64OFPBAC_BAD_LEN = 1
65OFPBAC_BAD_EXPERIMENTER = 2
66OFPBAC_BAD_EXP_TYPE = 3
67OFPBAC_BAD_OUT_PORT = 4
68OFPBAC_BAD_ARGUMENT = 5
69OFPBAC_EPERM = 6
70OFPBAC_TOO_MANY = 7
71OFPBAC_BAD_QUEUE = 8
72OFPBAC_BAD_OUT_GROUP = 9
73OFPBAC_MATCH_INCONSISTENT = 10
74OFPBAC_UNSUPPORTED_ORDER = 11
75OFPBAC_BAD_TAG = 12
76OFPBAC_BAD_SET_TYPE = 13
77OFPBAC_BAD_SET_LEN = 14
78OFPBAC_BAD_SET_ARGUMENT = 15
79
80ofp_bad_action_code_map = {
81 0: 'OFPBAC_BAD_TYPE',
82 1: 'OFPBAC_BAD_LEN',
83 2: 'OFPBAC_BAD_EXPERIMENTER',
84 3: 'OFPBAC_BAD_EXP_TYPE',
85 4: 'OFPBAC_BAD_OUT_PORT',
86 5: 'OFPBAC_BAD_ARGUMENT',
87 6: 'OFPBAC_EPERM',
88 7: 'OFPBAC_TOO_MANY',
89 8: 'OFPBAC_BAD_QUEUE',
90 9: 'OFPBAC_BAD_OUT_GROUP',
91 10: 'OFPBAC_MATCH_INCONSISTENT',
92 11: 'OFPBAC_UNSUPPORTED_ORDER',
93 12: 'OFPBAC_BAD_TAG',
94 13: 'OFPBAC_BAD_SET_TYPE',
95 14: 'OFPBAC_BAD_SET_LEN',
96 15: 'OFPBAC_BAD_SET_ARGUMENT',
97}
98
99# Identifiers from group ofp_bad_instruction_code
100OFPBIC_UNKNOWN_INST = 0
101OFPBIC_UNSUP_INST = 1
102OFPBIC_BAD_TABLE_ID = 2
103OFPBIC_UNSUP_METADATA = 3
104OFPBIC_UNSUP_METADATA_MASK = 4
105OFPBIC_BAD_EXPERIMENTER = 5
106OFPBIC_BAD_EXP_TYPE = 6
107OFPBIC_BAD_LEN = 7
108OFPBIC_EPERM = 8
109
110ofp_bad_instruction_code_map = {
111 0: 'OFPBIC_UNKNOWN_INST',
112 1: 'OFPBIC_UNSUP_INST',
113 2: 'OFPBIC_BAD_TABLE_ID',
114 3: 'OFPBIC_UNSUP_METADATA',
115 4: 'OFPBIC_UNSUP_METADATA_MASK',
116 5: 'OFPBIC_BAD_EXPERIMENTER',
117 6: 'OFPBIC_BAD_EXP_TYPE',
118 7: 'OFPBIC_BAD_LEN',
119 8: 'OFPBIC_EPERM',
120}
121
122# Identifiers from group ofp_bad_match_code
123OFPBMC_BAD_TYPE = 0
124OFPBMC_BAD_LEN = 1
125OFPBMC_BAD_TAG = 2
126OFPBMC_BAD_DL_ADDR_MASK = 3
127OFPBMC_BAD_NW_ADDR_MASK = 4
128OFPBMC_BAD_WILDCARDS = 5
129OFPBMC_BAD_FIELD = 6
130OFPBMC_BAD_VALUE = 7
131OFPBMC_BAD_MASK = 8
132OFPBMC_BAD_PREREQ = 9
133OFPBMC_DUP_FIELD = 10
134OFPBMC_EPERM = 11
135
136ofp_bad_match_code_map = {
137 0: 'OFPBMC_BAD_TYPE',
138 1: 'OFPBMC_BAD_LEN',
139 2: 'OFPBMC_BAD_TAG',
140 3: 'OFPBMC_BAD_DL_ADDR_MASK',
141 4: 'OFPBMC_BAD_NW_ADDR_MASK',
142 5: 'OFPBMC_BAD_WILDCARDS',
143 6: 'OFPBMC_BAD_FIELD',
144 7: 'OFPBMC_BAD_VALUE',
145 8: 'OFPBMC_BAD_MASK',
146 9: 'OFPBMC_BAD_PREREQ',
147 10: 'OFPBMC_DUP_FIELD',
148 11: 'OFPBMC_EPERM',
149}
150
151# Identifiers from group ofp_bad_request_code
152OFPBRC_BAD_VERSION = 0
153OFPBRC_BAD_TYPE = 1
154OFPBRC_BAD_STAT = 2
155OFPBRC_BAD_EXPERIMENTER = 3
156OFPBRC_BAD_EXP_TYPE = 4
157OFPBRC_EPERM = 5
158OFPBRC_BAD_LEN = 6
159OFPBRC_BUFFER_EMPTY = 7
160OFPBRC_BUFFER_UNKNOWN = 8
161OFPBRC_BAD_TABLE_ID = 9
162OFPBRC_IS_SLAVE = 10
163OFPBRC_BAD_PORT = 11
164OFPBRC_BAD_PACKET = 12
165
166ofp_bad_request_code_map = {
167 0: 'OFPBRC_BAD_VERSION',
168 1: 'OFPBRC_BAD_TYPE',
169 2: 'OFPBRC_BAD_STAT',
170 3: 'OFPBRC_BAD_EXPERIMENTER',
171 4: 'OFPBRC_BAD_EXP_TYPE',
172 5: 'OFPBRC_EPERM',
173 6: 'OFPBRC_BAD_LEN',
174 7: 'OFPBRC_BUFFER_EMPTY',
175 8: 'OFPBRC_BUFFER_UNKNOWN',
176 9: 'OFPBRC_BAD_TABLE_ID',
177 10: 'OFPBRC_IS_SLAVE',
178 11: 'OFPBRC_BAD_PORT',
179 12: 'OFPBRC_BAD_PACKET',
180}
181
182# Identifiers from group ofp_capabilities
183OFPC_FLOW_STATS = 1
184OFPC_TABLE_STATS = 2
185OFPC_PORT_STATS = 4
186OFPC_GROUP_STATS = 8
187OFPC_IP_REASM = 32
188OFPC_QUEUE_STATS = 64
189OFPC_PORT_BLOCKED = 256
190
191ofp_capabilities_map = {
192 1: 'OFPC_FLOW_STATS',
193 2: 'OFPC_TABLE_STATS',
194 4: 'OFPC_PORT_STATS',
195 8: 'OFPC_GROUP_STATS',
196 32: 'OFPC_IP_REASM',
197 64: 'OFPC_QUEUE_STATS',
198 256: 'OFPC_PORT_BLOCKED',
199}
200
201# Identifiers from group ofp_config_flags
202OFPC_FRAG_NORMAL = 0
203OFPC_FRAG_DROP = 1
204OFPC_FRAG_REASM = 2
205OFPC_FRAG_MASK = 3
206OFPC_INVALID_TTL_TO_CONTROLLER = 4
207
208ofp_config_flags_map = {
209 0: 'OFPC_FRAG_NORMAL',
210 1: 'OFPC_FRAG_DROP',
211 2: 'OFPC_FRAG_REASM',
212 3: 'OFPC_FRAG_MASK',
213 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
214}
215
216# Identifiers from group ofp_controller_max_len
217OFPCML_MAX = 65509
218OFPCML_NO_BUFFER = 65535
219
220ofp_controller_max_len_map = {
221 65509: 'OFPCML_MAX',
222 65535: 'OFPCML_NO_BUFFER',
223}
224
225# Identifiers from group ofp_controller_role
226OFPCR_ROLE_NOCHANGE = 0
227OFPCR_ROLE_EQUAL = 1
228OFPCR_ROLE_MASTER = 2
229OFPCR_ROLE_SLAVE = 3
230
231ofp_controller_role_map = {
232 0: 'OFPCR_ROLE_NOCHANGE',
233 1: 'OFPCR_ROLE_EQUAL',
234 2: 'OFPCR_ROLE_MASTER',
235 3: 'OFPCR_ROLE_SLAVE',
236}
237
238# Identifiers from group ofp_error_type
239OFPET_HELLO_FAILED = 0
240OFPET_BAD_REQUEST = 1
241OFPET_BAD_ACTION = 2
242OFPET_BAD_INSTRUCTION = 3
243OFPET_BAD_MATCH = 4
244OFPET_FLOW_MOD_FAILED = 5
245OFPET_GROUP_MOD_FAILED = 6
246OFPET_PORT_MOD_FAILED = 7
247OFPET_TABLE_MOD_FAILED = 8
248OFPET_QUEUE_OP_FAILED = 9
249OFPET_SWITCH_CONFIG_FAILED = 10
250OFPET_ROLE_REQUEST_FAILED = 11
251OFPET_EXPERIMENTER = 65535
252
253ofp_error_type_map = {
254 0: 'OFPET_HELLO_FAILED',
255 1: 'OFPET_BAD_REQUEST',
256 2: 'OFPET_BAD_ACTION',
257 3: 'OFPET_BAD_INSTRUCTION',
258 4: 'OFPET_BAD_MATCH',
259 5: 'OFPET_FLOW_MOD_FAILED',
260 6: 'OFPET_GROUP_MOD_FAILED',
261 7: 'OFPET_PORT_MOD_FAILED',
262 8: 'OFPET_TABLE_MOD_FAILED',
263 9: 'OFPET_QUEUE_OP_FAILED',
264 10: 'OFPET_SWITCH_CONFIG_FAILED',
265 11: 'OFPET_ROLE_REQUEST_FAILED',
266 65535: 'OFPET_EXPERIMENTER',
267}
268
269# Identifiers from group ofp_flow_mod_command
270OFPFC_ADD = 0
271OFPFC_MODIFY = 1
272OFPFC_MODIFY_STRICT = 2
273OFPFC_DELETE = 3
274OFPFC_DELETE_STRICT = 4
275
276ofp_flow_mod_command_map = {
277 0: 'OFPFC_ADD',
278 1: 'OFPFC_MODIFY',
279 2: 'OFPFC_MODIFY_STRICT',
280 3: 'OFPFC_DELETE',
281 4: 'OFPFC_DELETE_STRICT',
282}
283
284# Identifiers from group ofp_flow_mod_failed_code
285OFPFMFC_UNKNOWN = 0
286OFPFMFC_TABLE_FULL = 1
287OFPFMFC_BAD_TABLE_ID = 2
288OFPFMFC_OVERLAP = 3
289OFPFMFC_EPERM = 4
290OFPFMFC_BAD_TIMEOUT = 5
291OFPFMFC_BAD_COMMAND = 6
292OFPFMFC_BAD_FLAGS = 7
293
294ofp_flow_mod_failed_code_map = {
295 0: 'OFPFMFC_UNKNOWN',
296 1: 'OFPFMFC_TABLE_FULL',
297 2: 'OFPFMFC_BAD_TABLE_ID',
298 3: 'OFPFMFC_OVERLAP',
299 4: 'OFPFMFC_EPERM',
300 5: 'OFPFMFC_BAD_TIMEOUT',
301 6: 'OFPFMFC_BAD_COMMAND',
302 7: 'OFPFMFC_BAD_FLAGS',
303}
304
305# Identifiers from group ofp_flow_mod_flags
306OFPFF_SEND_FLOW_REM = 1
307OFPFF_CHECK_OVERLAP = 2
308OFPFF_RESET_COUNTS = 4
309
310ofp_flow_mod_flags_map = {
311 1: 'OFPFF_SEND_FLOW_REM',
312 2: 'OFPFF_CHECK_OVERLAP',
313 4: 'OFPFF_RESET_COUNTS',
314}
315
316# Identifiers from group ofp_flow_removed_reason
317OFPRR_IDLE_TIMEOUT = 0
318OFPRR_HARD_TIMEOUT = 1
319OFPRR_DELETE = 2
320OFPRR_GROUP_DELETE = 3
321
322ofp_flow_removed_reason_map = {
323 0: 'OFPRR_IDLE_TIMEOUT',
324 1: 'OFPRR_HARD_TIMEOUT',
325 2: 'OFPRR_DELETE',
326 3: 'OFPRR_GROUP_DELETE',
327}
328
329# Identifiers from group ofp_group
330OFPG_MAX = 4294967040
331OFPG_ALL = 4294967292
332OFPG_ANY = 4294967295
333
334ofp_group_map = {
335 4294967040: 'OFPG_MAX',
336 4294967292: 'OFPG_ALL',
337 4294967295: 'OFPG_ANY',
338}
339
340# Identifiers from group ofp_group_capabilities
341OFPGFC_SELECT_WEIGHT = 1
342OFPGFC_SELECT_LIVENESS = 2
343OFPGFC_CHAINING = 4
344OFPGFC_CHAINING_CHECKS = 8
345
346ofp_group_capabilities_map = {
347 1: 'OFPGFC_SELECT_WEIGHT',
348 2: 'OFPGFC_SELECT_LIVENESS',
349 4: 'OFPGFC_CHAINING',
350 8: 'OFPGFC_CHAINING_CHECKS',
351}
352
353# Identifiers from group ofp_group_mod_command
354OFPGC_ADD = 0
355OFPGC_MODIFY = 1
356OFPGC_DELETE = 2
357
358ofp_group_mod_command_map = {
359 0: 'OFPGC_ADD',
360 1: 'OFPGC_MODIFY',
361 2: 'OFPGC_DELETE',
362}
363
364# Identifiers from group ofp_group_mod_failed_code
365OFPGMFC_GROUP_EXISTS = 0
366OFPGMFC_INVALID_GROUP = 1
367OFPGMFC_WEIGHT_UNSUPPORTED = 2
368OFPGMFC_OUT_OF_GROUPS = 3
369OFPGMFC_OUT_OF_BUCKETS = 4
370OFPGMFC_CHAINING_UNSUPPORTED = 5
371OFPGMFC_WATCH_UNSUPPORTED = 6
372OFPGMFC_LOOP = 7
373OFPGMFC_UNKNOWN_GROUP = 8
374OFPGMFC_CHAINED_GROUP = 9
375OFPGMFC_BAD_TYPE = 10
376OFPGMFC_BAD_COMMAND = 11
377OFPGMFC_BAD_BUCKET = 12
378OFPGMFC_BAD_WATCH = 13
379OFPGMFC_EPERM = 14
380
381ofp_group_mod_failed_code_map = {
382 0: 'OFPGMFC_GROUP_EXISTS',
383 1: 'OFPGMFC_INVALID_GROUP',
384 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
385 3: 'OFPGMFC_OUT_OF_GROUPS',
386 4: 'OFPGMFC_OUT_OF_BUCKETS',
387 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
388 6: 'OFPGMFC_WATCH_UNSUPPORTED',
389 7: 'OFPGMFC_LOOP',
390 8: 'OFPGMFC_UNKNOWN_GROUP',
391 9: 'OFPGMFC_CHAINED_GROUP',
392 10: 'OFPGMFC_BAD_TYPE',
393 11: 'OFPGMFC_BAD_COMMAND',
394 12: 'OFPGMFC_BAD_BUCKET',
395 13: 'OFPGMFC_BAD_WATCH',
396 14: 'OFPGMFC_EPERM',
397}
398
399# Identifiers from group ofp_group_type
400OFPGT_ALL = 0
401OFPGT_SELECT = 1
402OFPGT_INDIRECT = 2
403OFPGT_FF = 3
404
405ofp_group_type_map = {
406 0: 'OFPGT_ALL',
407 1: 'OFPGT_SELECT',
408 2: 'OFPGT_INDIRECT',
409 3: 'OFPGT_FF',
410}
411
412# Identifiers from group ofp_hello_failed_code
413OFPHFC_INCOMPATIBLE = 0
414OFPHFC_EPERM = 1
415
416ofp_hello_failed_code_map = {
417 0: 'OFPHFC_INCOMPATIBLE',
418 1: 'OFPHFC_EPERM',
419}
420
421# Identifiers from group ofp_instruction_type
422OFPIT_GOTO_TABLE = 1
423OFPIT_WRITE_METADATA = 2
424OFPIT_WRITE_ACTIONS = 3
425OFPIT_APPLY_ACTIONS = 4
426OFPIT_CLEAR_ACTIONS = 5
427OFPIT_EXPERIMENTER = 65535
428
429ofp_instruction_type_map = {
430 1: 'OFPIT_GOTO_TABLE',
431 2: 'OFPIT_WRITE_METADATA',
432 3: 'OFPIT_WRITE_ACTIONS',
433 4: 'OFPIT_APPLY_ACTIONS',
434 5: 'OFPIT_CLEAR_ACTIONS',
435 65535: 'OFPIT_EXPERIMENTER',
436}
437
438# Identifiers from group ofp_match_type
439OFPMT_STANDARD = 0
440OFPMT_OXM = 1
441
442ofp_match_type_map = {
443 0: 'OFPMT_STANDARD',
444 1: 'OFPMT_OXM',
445}
446
447# Identifiers from group ofp_oxm_class
448OFPXMC_NXM_0 = 0
449OFPXMC_NXM_1 = 1
450OFPXMC_OPENFLOW_BASIC = 32768
451OFPXMC_EXPERIMENTER = 65535
452
453ofp_oxm_class_map = {
454 0: 'OFPXMC_NXM_0',
455 1: 'OFPXMC_NXM_1',
456 32768: 'OFPXMC_OPENFLOW_BASIC',
457 65535: 'OFPXMC_EXPERIMENTER',
458}
459
460# Identifiers from group ofp_packet_in_reason
461OFPR_NO_MATCH = 0
462OFPR_ACTION = 1
463OFPR_INVALID_TTL = 2
464
465ofp_packet_in_reason_map = {
466 0: 'OFPR_NO_MATCH',
467 1: 'OFPR_ACTION',
468 2: 'OFPR_INVALID_TTL',
469}
470
471# Identifiers from group ofp_port
472OFPP_MAX = 4294967040
473OFPP_IN_PORT = 4294967288
474OFPP_TABLE = 4294967289
475OFPP_NORMAL = 4294967290
476OFPP_FLOOD = 4294967291
477OFPP_ALL = 4294967292
478OFPP_CONTROLLER = 4294967293
479OFPP_LOCAL = 4294967294
480
481ofp_port_map = {
482 4294967040: 'OFPP_MAX',
483 4294967288: 'OFPP_IN_PORT',
484 4294967289: 'OFPP_TABLE',
485 4294967290: 'OFPP_NORMAL',
486 4294967291: 'OFPP_FLOOD',
487 4294967292: 'OFPP_ALL',
488 4294967293: 'OFPP_CONTROLLER',
489 4294967294: 'OFPP_LOCAL',
490}
491
492# Identifiers from group ofp_port_config
493OFPPC_PORT_DOWN = 1
494OFPPC_NO_RECV = 4
495OFPPC_NO_FWD = 32
496OFPPC_NO_PACKET_IN = 64
497
498ofp_port_config_map = {
499 1: 'OFPPC_PORT_DOWN',
500 4: 'OFPPC_NO_RECV',
501 32: 'OFPPC_NO_FWD',
502 64: 'OFPPC_NO_PACKET_IN',
503}
504
505# Identifiers from group ofp_port_features
506OFPPF_10MB_HD = 1
507OFPPF_10MB_FD = 2
508OFPPF_100MB_HD = 4
509OFPPF_100MB_FD = 8
510OFPPF_1GB_HD = 16
511OFPPF_1GB_FD = 32
512OFPPF_10GB_FD = 64
513OFPPF_40GB_FD = 128
514OFPPF_100GB_FD = 256
515OFPPF_1TB_FD = 512
516OFPPF_OTHER = 1024
517OFPPF_COPPER = 2048
518OFPPF_FIBER = 4096
519OFPPF_AUTONEG = 8192
520OFPPF_PAUSE = 16384
521OFPPF_PAUSE_ASYM = 32768
522
523ofp_port_features_map = {
524 1: 'OFPPF_10MB_HD',
525 2: 'OFPPF_10MB_FD',
526 4: 'OFPPF_100MB_HD',
527 8: 'OFPPF_100MB_FD',
528 16: 'OFPPF_1GB_HD',
529 32: 'OFPPF_1GB_FD',
530 64: 'OFPPF_10GB_FD',
531 128: 'OFPPF_40GB_FD',
532 256: 'OFPPF_100GB_FD',
533 512: 'OFPPF_1TB_FD',
534 1024: 'OFPPF_OTHER',
535 2048: 'OFPPF_COPPER',
536 4096: 'OFPPF_FIBER',
537 8192: 'OFPPF_AUTONEG',
538 16384: 'OFPPF_PAUSE',
539 32768: 'OFPPF_PAUSE_ASYM',
540}
541
542# Identifiers from group ofp_port_mod_failed_code
543OFPPMFC_BAD_PORT = 0
544OFPPMFC_BAD_HW_ADDR = 1
545OFPPMFC_BAD_CONFIG = 2
546OFPPMFC_BAD_ADVERTISE = 3
547OFPPMFC_EPERM = 4
548
549ofp_port_mod_failed_code_map = {
550 0: 'OFPPMFC_BAD_PORT',
551 1: 'OFPPMFC_BAD_HW_ADDR',
552 2: 'OFPPMFC_BAD_CONFIG',
553 3: 'OFPPMFC_BAD_ADVERTISE',
554 4: 'OFPPMFC_EPERM',
555}
556
557# Identifiers from group ofp_port_no
558OFPP_ANY = 4294967295
559
560ofp_port_no_map = {
561 4294967295: 'OFPP_ANY',
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_MIN_RATE = 1
599OFPQT_MAX_RATE = 2
600OFPQT_EXPERIMENTER = 65535
601
602ofp_queue_properties_map = {
603 1: 'OFPQT_MIN_RATE',
604 2: 'OFPQT_MAX_RATE',
605 65535: 'OFPQT_EXPERIMENTER',
606}
607
608# Identifiers from group ofp_role_request_failed_code
609OFPRRFC_STALE = 0
610OFPRRFC_UNSUP = 1
611OFPRRFC_BAD_ROLE = 2
612
613ofp_role_request_failed_code_map = {
614 0: 'OFPRRFC_STALE',
615 1: 'OFPRRFC_UNSUP',
616 2: 'OFPRRFC_BAD_ROLE',
617}
618
619# Identifiers from group ofp_stats_reply_flags
620OFPSF_REPLY_MORE = 1
621
622ofp_stats_reply_flags_map = {
623 1: 'OFPSF_REPLY_MORE',
624}
625
626# Identifiers from group ofp_stats_types
627OFPST_DESC = 0
628OFPST_FLOW = 1
629OFPST_AGGREGATE = 2
630OFPST_TABLE = 3
631OFPST_PORT = 4
632OFPST_QUEUE = 5
633OFPST_GROUP = 6
634OFPST_GROUP_DESC = 7
635OFPST_GROUP_FEATURES = 8
636OFPST_EXPERIMENTER = 65535
637
638ofp_stats_types_map = {
639 0: 'OFPST_DESC',
640 1: 'OFPST_FLOW',
641 2: 'OFPST_AGGREGATE',
642 3: 'OFPST_TABLE',
643 4: 'OFPST_PORT',
644 5: 'OFPST_QUEUE',
645 6: 'OFPST_GROUP',
646 7: 'OFPST_GROUP_DESC',
647 8: 'OFPST_GROUP_FEATURES',
648 65535: 'OFPST_EXPERIMENTER',
649}
650
651# Identifiers from group ofp_switch_config_failed_code
652OFPSCFC_BAD_FLAGS = 0
653OFPSCFC_BAD_LEN = 1
654OFPSCFC_EPERM = 2
655
656ofp_switch_config_failed_code_map = {
657 0: 'OFPSCFC_BAD_FLAGS',
658 1: 'OFPSCFC_BAD_LEN',
659 2: 'OFPSCFC_EPERM',
660}
661
662# Identifiers from group ofp_table
663OFPTT_MAX = 254
664OFPTT_ALL = 255
665
666ofp_table_map = {
667 254: 'OFPTT_MAX',
668 255: 'OFPTT_ALL',
669}
670
671# Identifiers from group ofp_table_config
672OFPTC_TABLE_MISS_CONTROLLER = 0
673OFPTC_TABLE_MISS_CONTINUE = 1
674OFPTC_TABLE_MISS_DROP = 2
675OFPTC_TABLE_MISS_MASK = 3
676
677ofp_table_config_map = {
678 0: 'OFPTC_TABLE_MISS_CONTROLLER',
679 1: 'OFPTC_TABLE_MISS_CONTINUE',
680 2: 'OFPTC_TABLE_MISS_DROP',
681 3: 'OFPTC_TABLE_MISS_MASK',
682}
683
684# Identifiers from group ofp_table_mod_failed_code
685OFPTMFC_BAD_TABLE = 0
686OFPTMFC_BAD_CONFIG = 1
687OFPTMFC_EPERM = 2
688
689ofp_table_mod_failed_code_map = {
690 0: 'OFPTMFC_BAD_TABLE',
691 1: 'OFPTMFC_BAD_CONFIG',
692 2: 'OFPTMFC_EPERM',
693}
694
695# Identifiers from group ofp_type
696OFPT_HELLO = 0
697OFPT_ERROR = 1
698OFPT_ECHO_REQUEST = 2
699OFPT_ECHO_REPLY = 3
700OFPT_EXPERIMENTER = 4
701OFPT_FEATURES_REQUEST = 5
702OFPT_FEATURES_REPLY = 6
703OFPT_GET_CONFIG_REQUEST = 7
704OFPT_GET_CONFIG_REPLY = 8
705OFPT_SET_CONFIG = 9
706OFPT_PACKET_IN = 10
707OFPT_FLOW_REMOVED = 11
708OFPT_PORT_STATUS = 12
709OFPT_PACKET_OUT = 13
710OFPT_FLOW_MOD = 14
711OFPT_GROUP_MOD = 15
712OFPT_PORT_MOD = 16
713OFPT_TABLE_MOD = 17
714OFPT_STATS_REQUEST = 18
715OFPT_STATS_REPLY = 19
716OFPT_BARRIER_REQUEST = 20
717OFPT_BARRIER_REPLY = 21
718OFPT_QUEUE_GET_CONFIG_REQUEST = 22
719OFPT_QUEUE_GET_CONFIG_REPLY = 23
720OFPT_ROLE_REQUEST = 24
721OFPT_ROLE_REPLY = 25
722
723ofp_type_map = {
724 0: 'OFPT_HELLO',
725 1: 'OFPT_ERROR',
726 2: 'OFPT_ECHO_REQUEST',
727 3: 'OFPT_ECHO_REPLY',
728 4: 'OFPT_EXPERIMENTER',
729 5: 'OFPT_FEATURES_REQUEST',
730 6: 'OFPT_FEATURES_REPLY',
731 7: 'OFPT_GET_CONFIG_REQUEST',
732 8: 'OFPT_GET_CONFIG_REPLY',
733 9: 'OFPT_SET_CONFIG',
734 10: 'OFPT_PACKET_IN',
735 11: 'OFPT_FLOW_REMOVED',
736 12: 'OFPT_PORT_STATUS',
737 13: 'OFPT_PACKET_OUT',
738 14: 'OFPT_FLOW_MOD',
739 15: 'OFPT_GROUP_MOD',
740 16: 'OFPT_PORT_MOD',
741 17: 'OFPT_TABLE_MOD',
742 18: 'OFPT_STATS_REQUEST',
743 19: 'OFPT_STATS_REPLY',
744 20: 'OFPT_BARRIER_REQUEST',
745 21: 'OFPT_BARRIER_REPLY',
746 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
747 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
748 24: 'OFPT_ROLE_REQUEST',
749 25: 'OFPT_ROLE_REPLY',
750}
751
752# Identifiers from group ofp_vlan_id
753OFPVID_NONE = 0
754OFPVID_PRESENT = 4096
755
756ofp_vlan_id_map = {
757 0: 'OFPVID_NONE',
758 4096: 'OFPVID_PRESENT',
759}
760