blob: dc768c642402d765bd4e8dc1d45fd61fc4cc7daa [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 Laneb658ddd2013-03-12 10:15:10 -07005
6# Automatically generated by LOXI from template const.py
7# Do not modify
8
9OFP_VERSION = 1
10
11# Identifiers from group macro_definitions
Rich Laneb658ddd2013-03-12 10:15:10 -070012OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070013OFP_MAX_PORT_NAME_LEN = 16
Rich Laneb658ddd2013-03-12 10:15:10 -070014OFP_TCP_PORT = 6633
15OFP_SSL_PORT = 6633
Dan Talaycof6202252013-07-02 01:00:29 -070016OFP_ETH_ALEN = 6
17OFP_DEFAULT_MISS_SEND_LEN = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -070018OFP_VLAN_NONE = 65535
Dan Talaycof6202252013-07-02 01:00:29 -070019OFPFW_ICMP_TYPE = 64
20OFPFW_ICMP_CODE = 128
21OFP_DL_TYPE_ETH2_CUTOFF = 1536
22OFP_DL_TYPE_NOT_ETH_TYPE = 1535
23OFP_FLOW_PERMANENT = 0
24OFP_DEFAULT_PRIORITY = 32768
25DESC_STR_LEN = 256
26SERIAL_NUM_LEN = 32
Rich Lanec2ee4b82013-04-24 17:12:38 -070027OFPQ_ALL = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070028OFPQ_MIN_RATE_UNCFG = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -070029
30# Identifiers from group ofp_action_type
31OFPAT_OUTPUT = 0
32OFPAT_SET_VLAN_VID = 1
33OFPAT_SET_VLAN_PCP = 2
34OFPAT_STRIP_VLAN = 3
35OFPAT_SET_DL_SRC = 4
36OFPAT_SET_DL_DST = 5
37OFPAT_SET_NW_SRC = 6
38OFPAT_SET_NW_DST = 7
39OFPAT_SET_NW_TOS = 8
40OFPAT_SET_TP_SRC = 9
41OFPAT_SET_TP_DST = 10
42OFPAT_ENQUEUE = 11
Rich Lanec2ee4b82013-04-24 17:12:38 -070043OFPAT_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -070044
45ofp_action_type_map = {
46 0: 'OFPAT_OUTPUT',
47 1: 'OFPAT_SET_VLAN_VID',
48 2: 'OFPAT_SET_VLAN_PCP',
49 3: 'OFPAT_STRIP_VLAN',
50 4: 'OFPAT_SET_DL_SRC',
51 5: 'OFPAT_SET_DL_DST',
52 6: 'OFPAT_SET_NW_SRC',
53 7: 'OFPAT_SET_NW_DST',
54 8: 'OFPAT_SET_NW_TOS',
55 9: 'OFPAT_SET_TP_SRC',
56 10: 'OFPAT_SET_TP_DST',
57 11: 'OFPAT_ENQUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -070058 65535: 'OFPAT_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -070059}
60
61# Identifiers from group ofp_bad_action_code
62OFPBAC_BAD_TYPE = 0
63OFPBAC_BAD_LEN = 1
64OFPBAC_BAD_VENDOR = 2
65OFPBAC_BAD_VENDOR_TYPE = 3
66OFPBAC_BAD_OUT_PORT = 4
67OFPBAC_BAD_ARGUMENT = 5
68OFPBAC_EPERM = 6
69OFPBAC_TOO_MANY = 7
70OFPBAC_BAD_QUEUE = 8
71
72ofp_bad_action_code_map = {
73 0: 'OFPBAC_BAD_TYPE',
74 1: 'OFPBAC_BAD_LEN',
75 2: 'OFPBAC_BAD_VENDOR',
76 3: 'OFPBAC_BAD_VENDOR_TYPE',
77 4: 'OFPBAC_BAD_OUT_PORT',
78 5: 'OFPBAC_BAD_ARGUMENT',
79 6: 'OFPBAC_EPERM',
80 7: 'OFPBAC_TOO_MANY',
81 8: 'OFPBAC_BAD_QUEUE',
82}
83
84# Identifiers from group ofp_bad_request_code
85OFPBRC_BAD_VERSION = 0
86OFPBRC_BAD_TYPE = 1
87OFPBRC_BAD_STAT = 2
88OFPBRC_BAD_VENDOR = 3
89OFPBRC_BAD_SUBTYPE = 4
90OFPBRC_EPERM = 5
91OFPBRC_BAD_LEN = 6
92OFPBRC_BUFFER_EMPTY = 7
93OFPBRC_BUFFER_UNKNOWN = 8
94
95ofp_bad_request_code_map = {
96 0: 'OFPBRC_BAD_VERSION',
97 1: 'OFPBRC_BAD_TYPE',
98 2: 'OFPBRC_BAD_STAT',
99 3: 'OFPBRC_BAD_VENDOR',
100 4: 'OFPBRC_BAD_SUBTYPE',
101 5: 'OFPBRC_EPERM',
102 6: 'OFPBRC_BAD_LEN',
103 7: 'OFPBRC_BUFFER_EMPTY',
104 8: 'OFPBRC_BUFFER_UNKNOWN',
105}
106
Dan Talaycof6202252013-07-02 01:00:29 -0700107# Identifiers from group ofp_bsn_vport_q_in_q_untagged
108OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
109
110ofp_bsn_vport_q_in_q_untagged_map = {
111 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
112}
113
Rich Laned53156a2013-08-05 17:17:33 -0700114# Identifiers from group ofp_bsn_vport_status
115OF_BSN_VPORT_STATUS_OK = 0
116OF_BSN_VPORT_STATUS_FAILED = 1
117
118ofp_bsn_vport_status_map = {
119 0: 'OF_BSN_VPORT_STATUS_OK',
120 1: 'OF_BSN_VPORT_STATUS_FAILED',
121}
122
Rich Laneb658ddd2013-03-12 10:15:10 -0700123# Identifiers from group ofp_capabilities
Rich Lanec2ee4b82013-04-24 17:12:38 -0700124OFPC_FLOW_STATS = 1
125OFPC_TABLE_STATS = 2
126OFPC_PORT_STATS = 4
127OFPC_STP = 8
128OFPC_RESERVED = 16
129OFPC_IP_REASM = 32
130OFPC_QUEUE_STATS = 64
131OFPC_ARP_MATCH_IP = 128
Rich Laneb658ddd2013-03-12 10:15:10 -0700132
133ofp_capabilities_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700134 1: 'OFPC_FLOW_STATS',
135 2: 'OFPC_TABLE_STATS',
136 4: 'OFPC_PORT_STATS',
137 8: 'OFPC_STP',
138 16: 'OFPC_RESERVED',
139 32: 'OFPC_IP_REASM',
140 64: 'OFPC_QUEUE_STATS',
141 128: 'OFPC_ARP_MATCH_IP',
Rich Laneb658ddd2013-03-12 10:15:10 -0700142}
143
144# Identifiers from group ofp_config_flags
145OFPC_FRAG_NORMAL = 0
146OFPC_FRAG_DROP = 1
147OFPC_FRAG_REASM = 2
148OFPC_FRAG_MASK = 3
149
150ofp_config_flags_map = {
151 0: 'OFPC_FRAG_NORMAL',
152 1: 'OFPC_FRAG_DROP',
153 2: 'OFPC_FRAG_REASM',
154 3: 'OFPC_FRAG_MASK',
155}
156
157# Identifiers from group ofp_error_type
158OFPET_HELLO_FAILED = 0
159OFPET_BAD_REQUEST = 1
160OFPET_BAD_ACTION = 2
161OFPET_FLOW_MOD_FAILED = 3
162OFPET_PORT_MOD_FAILED = 4
163OFPET_QUEUE_OP_FAILED = 5
164
165ofp_error_type_map = {
166 0: 'OFPET_HELLO_FAILED',
167 1: 'OFPET_BAD_REQUEST',
168 2: 'OFPET_BAD_ACTION',
169 3: 'OFPET_FLOW_MOD_FAILED',
170 4: 'OFPET_PORT_MOD_FAILED',
171 5: 'OFPET_QUEUE_OP_FAILED',
172}
173
174# Identifiers from group ofp_flow_mod_command
175OFPFC_ADD = 0
176OFPFC_MODIFY = 1
177OFPFC_MODIFY_STRICT = 2
178OFPFC_DELETE = 3
179OFPFC_DELETE_STRICT = 4
180
181ofp_flow_mod_command_map = {
182 0: 'OFPFC_ADD',
183 1: 'OFPFC_MODIFY',
184 2: 'OFPFC_MODIFY_STRICT',
185 3: 'OFPFC_DELETE',
186 4: 'OFPFC_DELETE_STRICT',
187}
188
189# Identifiers from group ofp_flow_mod_failed_code
190OFPFMFC_ALL_TABLES_FULL = 0
191OFPFMFC_OVERLAP = 1
192OFPFMFC_EPERM = 2
193OFPFMFC_BAD_EMERG_TIMEOUT = 3
194OFPFMFC_BAD_COMMAND = 4
195OFPFMFC_UNSUPPORTED = 5
196
197ofp_flow_mod_failed_code_map = {
198 0: 'OFPFMFC_ALL_TABLES_FULL',
199 1: 'OFPFMFC_OVERLAP',
200 2: 'OFPFMFC_EPERM',
201 3: 'OFPFMFC_BAD_EMERG_TIMEOUT',
202 4: 'OFPFMFC_BAD_COMMAND',
203 5: 'OFPFMFC_UNSUPPORTED',
204}
205
206# Identifiers from group ofp_flow_mod_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700207OFPFF_SEND_FLOW_REM = 1
208OFPFF_CHECK_OVERLAP = 2
209OFPFF_EMERG = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700210
211ofp_flow_mod_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700212 1: 'OFPFF_SEND_FLOW_REM',
213 2: 'OFPFF_CHECK_OVERLAP',
214 4: 'OFPFF_EMERG',
Rich Laneb658ddd2013-03-12 10:15:10 -0700215}
216
217# Identifiers from group ofp_flow_removed_reason
218OFPRR_IDLE_TIMEOUT = 0
219OFPRR_HARD_TIMEOUT = 1
220OFPRR_DELETE = 2
221
222ofp_flow_removed_reason_map = {
223 0: 'OFPRR_IDLE_TIMEOUT',
224 1: 'OFPRR_HARD_TIMEOUT',
225 2: 'OFPRR_DELETE',
226}
227
228# Identifiers from group ofp_flow_wildcards
Rich Lanec2ee4b82013-04-24 17:12:38 -0700229OFPFW_IN_PORT = 1
230OFPFW_DL_VLAN = 2
231OFPFW_DL_SRC = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700232OFPFW_NW_DST_BITS = 6
233OFPFW_NW_SRC_BITS = 6
234OFPFW_NW_SRC_SHIFT = 8
Rich Lanec2ee4b82013-04-24 17:12:38 -0700235OFPFW_DL_DST = 8
Rich Laneb658ddd2013-03-12 10:15:10 -0700236OFPFW_NW_DST_SHIFT = 14
Rich Lanec2ee4b82013-04-24 17:12:38 -0700237OFPFW_DL_TYPE = 16
238OFPFW_NW_PROTO = 32
239OFPFW_TP_SRC = 64
240OFPFW_TP_DST = 128
241OFPFW_NW_SRC_ALL = 8192
242OFPFW_NW_SRC_MASK = 16128
243OFPFW_NW_DST_ALL = 524288
244OFPFW_NW_DST_MASK = 1032192
245OFPFW_DL_VLAN_PCP = 1048576
246OFPFW_NW_TOS = 2097152
247OFPFW_ALL = 4194303
Rich Laneb658ddd2013-03-12 10:15:10 -0700248
249ofp_flow_wildcards_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700250 1: 'OFPFW_IN_PORT',
251 2: 'OFPFW_DL_VLAN',
252 4: 'OFPFW_DL_SRC',
253 8: 'OFPFW_DL_DST',
254 16: 'OFPFW_DL_TYPE',
255 32: 'OFPFW_NW_PROTO',
256 64: 'OFPFW_TP_SRC',
257 128: 'OFPFW_TP_DST',
258 1048576: 'OFPFW_DL_VLAN_PCP',
259 2097152: 'OFPFW_NW_TOS',
Rich Laneb658ddd2013-03-12 10:15:10 -0700260}
261
262# Identifiers from group ofp_hello_failed_code
263OFPHFC_INCOMPATIBLE = 0
264OFPHFC_EPERM = 1
265
266ofp_hello_failed_code_map = {
267 0: 'OFPHFC_INCOMPATIBLE',
268 1: 'OFPHFC_EPERM',
269}
270
Rich Lanec2ee4b82013-04-24 17:12:38 -0700271# Identifiers from group ofp_nicira_controller_role
272NX_ROLE_OTHER = 0
273NX_ROLE_MASTER = 1
274NX_ROLE_SLAVE = 2
275
276ofp_nicira_controller_role_map = {
277 0: 'NX_ROLE_OTHER',
278 1: 'NX_ROLE_MASTER',
279 2: 'NX_ROLE_SLAVE',
280}
281
Rich Laneb658ddd2013-03-12 10:15:10 -0700282# Identifiers from group ofp_packet_in_reason
283OFPR_NO_MATCH = 0
284OFPR_ACTION = 1
285
286ofp_packet_in_reason_map = {
287 0: 'OFPR_NO_MATCH',
288 1: 'OFPR_ACTION',
289}
290
291# Identifiers from group ofp_port
292OFPP_MAX = 0xff00
293OFPP_IN_PORT = 0xfff8
294OFPP_TABLE = 0xfff9
295OFPP_NORMAL = 0xfffa
296OFPP_FLOOD = 0xfffb
297OFPP_ALL = 0xfffc
298OFPP_CONTROLLER = 0xfffd
299OFPP_LOCAL = 0xfffe
300OFPP_NONE = 0xffff
301
302ofp_port_map = {
303 0xff00: 'OFPP_MAX',
304 0xfff8: 'OFPP_IN_PORT',
305 0xfff9: 'OFPP_TABLE',
306 0xfffa: 'OFPP_NORMAL',
307 0xfffb: 'OFPP_FLOOD',
308 0xfffc: 'OFPP_ALL',
309 0xfffd: 'OFPP_CONTROLLER',
310 0xfffe: 'OFPP_LOCAL',
311 0xffff: 'OFPP_NONE',
312}
313
314# Identifiers from group ofp_port_config
Rich Lanec2ee4b82013-04-24 17:12:38 -0700315OFPPC_PORT_DOWN = 1
316OFPPC_NO_STP = 2
317OFPPC_NO_RECV = 4
318OFPPC_NO_RECV_STP = 8
319OFPPC_NO_FLOOD = 16
320OFPPC_NO_FWD = 32
321OFPPC_NO_PACKET_IN = 64
Rich Laneb658ddd2013-03-12 10:15:10 -0700322
323ofp_port_config_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700324 1: 'OFPPC_PORT_DOWN',
325 2: 'OFPPC_NO_STP',
326 4: 'OFPPC_NO_RECV',
327 8: 'OFPPC_NO_RECV_STP',
328 16: 'OFPPC_NO_FLOOD',
329 32: 'OFPPC_NO_FWD',
330 64: 'OFPPC_NO_PACKET_IN',
Rich Laneb658ddd2013-03-12 10:15:10 -0700331}
332
333# Identifiers from group ofp_port_features
Rich Lanec2ee4b82013-04-24 17:12:38 -0700334OFPPF_10MB_HD = 1
335OFPPF_10MB_FD = 2
336OFPPF_100MB_HD = 4
337OFPPF_100MB_FD = 8
338OFPPF_1GB_HD = 16
339OFPPF_1GB_FD = 32
340OFPPF_10GB_FD = 64
341OFPPF_COPPER = 128
342OFPPF_FIBER = 256
343OFPPF_AUTONEG = 512
344OFPPF_PAUSE = 1024
345OFPPF_PAUSE_ASYM = 2048
Rich Laneb658ddd2013-03-12 10:15:10 -0700346
347ofp_port_features_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700348 1: 'OFPPF_10MB_HD',
349 2: 'OFPPF_10MB_FD',
350 4: 'OFPPF_100MB_HD',
351 8: 'OFPPF_100MB_FD',
352 16: 'OFPPF_1GB_HD',
353 32: 'OFPPF_1GB_FD',
354 64: 'OFPPF_10GB_FD',
355 128: 'OFPPF_COPPER',
356 256: 'OFPPF_FIBER',
357 512: 'OFPPF_AUTONEG',
358 1024: 'OFPPF_PAUSE',
359 2048: 'OFPPF_PAUSE_ASYM',
Rich Laneb658ddd2013-03-12 10:15:10 -0700360}
361
362# Identifiers from group ofp_port_mod_failed_code
363OFPPMFC_BAD_PORT = 0
364OFPPMFC_BAD_HW_ADDR = 1
365
366ofp_port_mod_failed_code_map = {
367 0: 'OFPPMFC_BAD_PORT',
368 1: 'OFPPMFC_BAD_HW_ADDR',
369}
370
371# Identifiers from group ofp_port_reason
372OFPPR_ADD = 0
373OFPPR_DELETE = 1
374OFPPR_MODIFY = 2
375
376ofp_port_reason_map = {
377 0: 'OFPPR_ADD',
378 1: 'OFPPR_DELETE',
379 2: 'OFPPR_MODIFY',
380}
381
382# Identifiers from group ofp_port_state
Rich Lanec2ee4b82013-04-24 17:12:38 -0700383OFPPS_STP_LISTEN = 0
384OFPPS_LINK_DOWN = 1
385OFPPS_STP_LEARN = 256
386OFPPS_STP_FORWARD = 512
387OFPPS_STP_BLOCK = 768
388OFPPS_STP_MASK = 768
Rich Laneb658ddd2013-03-12 10:15:10 -0700389
390ofp_port_state_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700391 0: 'OFPPS_STP_LISTEN',
392 1: 'OFPPS_LINK_DOWN',
393 256: 'OFPPS_STP_LEARN',
394 512: 'OFPPS_STP_FORWARD',
395 768: 'OFPPS_STP_BLOCK',
396 768: 'OFPPS_STP_MASK',
Rich Laneb658ddd2013-03-12 10:15:10 -0700397}
398
399# Identifiers from group ofp_queue_op_failed_code
400OFPQOFC_BAD_PORT = 0
401OFPQOFC_BAD_QUEUE = 1
402OFPQOFC_EPERM = 2
403
404ofp_queue_op_failed_code_map = {
405 0: 'OFPQOFC_BAD_PORT',
406 1: 'OFPQOFC_BAD_QUEUE',
407 2: 'OFPQOFC_EPERM',
408}
409
410# Identifiers from group ofp_queue_properties
411OFPQT_NONE = 0
412OFPQT_MIN_RATE = 1
413
414ofp_queue_properties_map = {
415 0: 'OFPQT_NONE',
416 1: 'OFPQT_MIN_RATE',
417}
418
419# Identifiers from group ofp_stats_reply_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700420OFPSF_REPLY_MORE = 1
Rich Laneb658ddd2013-03-12 10:15:10 -0700421
422ofp_stats_reply_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700423 1: 'OFPSF_REPLY_MORE',
Rich Laneb658ddd2013-03-12 10:15:10 -0700424}
425
426# Identifiers from group ofp_stats_types
427OFPST_DESC = 0
428OFPST_FLOW = 1
429OFPST_AGGREGATE = 2
430OFPST_TABLE = 3
431OFPST_PORT = 4
432OFPST_QUEUE = 5
Rich Lanec2ee4b82013-04-24 17:12:38 -0700433OFPST_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -0700434
435ofp_stats_types_map = {
436 0: 'OFPST_DESC',
437 1: 'OFPST_FLOW',
438 2: 'OFPST_AGGREGATE',
439 3: 'OFPST_TABLE',
440 4: 'OFPST_PORT',
441 5: 'OFPST_QUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700442 65535: 'OFPST_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -0700443}
444
445# Identifiers from group ofp_type
446OFPT_HELLO = 0
447OFPT_ERROR = 1
448OFPT_ECHO_REQUEST = 2
449OFPT_ECHO_REPLY = 3
450OFPT_VENDOR = 4
451OFPT_FEATURES_REQUEST = 5
452OFPT_FEATURES_REPLY = 6
453OFPT_GET_CONFIG_REQUEST = 7
454OFPT_GET_CONFIG_REPLY = 8
455OFPT_SET_CONFIG = 9
456OFPT_PACKET_IN = 10
457OFPT_FLOW_REMOVED = 11
458OFPT_PORT_STATUS = 12
459OFPT_PACKET_OUT = 13
460OFPT_FLOW_MOD = 14
461OFPT_PORT_MOD = 15
462OFPT_STATS_REQUEST = 16
463OFPT_STATS_REPLY = 17
464OFPT_BARRIER_REQUEST = 18
465OFPT_BARRIER_REPLY = 19
466OFPT_QUEUE_GET_CONFIG_REQUEST = 20
467OFPT_QUEUE_GET_CONFIG_REPLY = 21
468
469ofp_type_map = {
470 0: 'OFPT_HELLO',
471 1: 'OFPT_ERROR',
472 2: 'OFPT_ECHO_REQUEST',
473 3: 'OFPT_ECHO_REPLY',
474 4: 'OFPT_VENDOR',
475 5: 'OFPT_FEATURES_REQUEST',
476 6: 'OFPT_FEATURES_REPLY',
477 7: 'OFPT_GET_CONFIG_REQUEST',
478 8: 'OFPT_GET_CONFIG_REPLY',
479 9: 'OFPT_SET_CONFIG',
480 10: 'OFPT_PACKET_IN',
481 11: 'OFPT_FLOW_REMOVED',
482 12: 'OFPT_PORT_STATUS',
483 13: 'OFPT_PACKET_OUT',
484 14: 'OFPT_FLOW_MOD',
485 15: 'OFPT_PORT_MOD',
486 16: 'OFPT_STATS_REQUEST',
487 17: 'OFPT_STATS_REPLY',
488 18: 'OFPT_BARRIER_REQUEST',
489 19: 'OFPT_BARRIER_REPLY',
490 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
491 21: 'OFPT_QUEUE_GET_CONFIG_REPLY',
492}
493