blob: 1d29975e9ed4e8ef39cdc8da2d3595fbf0391d98 [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 Laneb658ddd2013-03-12 10:15:10 -0700114# Identifiers from group ofp_capabilities
Rich Lanec2ee4b82013-04-24 17:12:38 -0700115OFPC_FLOW_STATS = 1
116OFPC_TABLE_STATS = 2
117OFPC_PORT_STATS = 4
118OFPC_STP = 8
119OFPC_RESERVED = 16
120OFPC_IP_REASM = 32
121OFPC_QUEUE_STATS = 64
122OFPC_ARP_MATCH_IP = 128
Rich Laneb658ddd2013-03-12 10:15:10 -0700123
124ofp_capabilities_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700125 1: 'OFPC_FLOW_STATS',
126 2: 'OFPC_TABLE_STATS',
127 4: 'OFPC_PORT_STATS',
128 8: 'OFPC_STP',
129 16: 'OFPC_RESERVED',
130 32: 'OFPC_IP_REASM',
131 64: 'OFPC_QUEUE_STATS',
132 128: 'OFPC_ARP_MATCH_IP',
Rich Laneb658ddd2013-03-12 10:15:10 -0700133}
134
135# Identifiers from group ofp_config_flags
136OFPC_FRAG_NORMAL = 0
137OFPC_FRAG_DROP = 1
138OFPC_FRAG_REASM = 2
139OFPC_FRAG_MASK = 3
140
141ofp_config_flags_map = {
142 0: 'OFPC_FRAG_NORMAL',
143 1: 'OFPC_FRAG_DROP',
144 2: 'OFPC_FRAG_REASM',
145 3: 'OFPC_FRAG_MASK',
146}
147
148# Identifiers from group ofp_error_type
149OFPET_HELLO_FAILED = 0
150OFPET_BAD_REQUEST = 1
151OFPET_BAD_ACTION = 2
152OFPET_FLOW_MOD_FAILED = 3
153OFPET_PORT_MOD_FAILED = 4
154OFPET_QUEUE_OP_FAILED = 5
155
156ofp_error_type_map = {
157 0: 'OFPET_HELLO_FAILED',
158 1: 'OFPET_BAD_REQUEST',
159 2: 'OFPET_BAD_ACTION',
160 3: 'OFPET_FLOW_MOD_FAILED',
161 4: 'OFPET_PORT_MOD_FAILED',
162 5: 'OFPET_QUEUE_OP_FAILED',
163}
164
165# Identifiers from group ofp_flow_mod_command
166OFPFC_ADD = 0
167OFPFC_MODIFY = 1
168OFPFC_MODIFY_STRICT = 2
169OFPFC_DELETE = 3
170OFPFC_DELETE_STRICT = 4
171
172ofp_flow_mod_command_map = {
173 0: 'OFPFC_ADD',
174 1: 'OFPFC_MODIFY',
175 2: 'OFPFC_MODIFY_STRICT',
176 3: 'OFPFC_DELETE',
177 4: 'OFPFC_DELETE_STRICT',
178}
179
180# Identifiers from group ofp_flow_mod_failed_code
181OFPFMFC_ALL_TABLES_FULL = 0
182OFPFMFC_OVERLAP = 1
183OFPFMFC_EPERM = 2
184OFPFMFC_BAD_EMERG_TIMEOUT = 3
185OFPFMFC_BAD_COMMAND = 4
186OFPFMFC_UNSUPPORTED = 5
187
188ofp_flow_mod_failed_code_map = {
189 0: 'OFPFMFC_ALL_TABLES_FULL',
190 1: 'OFPFMFC_OVERLAP',
191 2: 'OFPFMFC_EPERM',
192 3: 'OFPFMFC_BAD_EMERG_TIMEOUT',
193 4: 'OFPFMFC_BAD_COMMAND',
194 5: 'OFPFMFC_UNSUPPORTED',
195}
196
197# Identifiers from group ofp_flow_mod_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700198OFPFF_SEND_FLOW_REM = 1
199OFPFF_CHECK_OVERLAP = 2
200OFPFF_EMERG = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700201
202ofp_flow_mod_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700203 1: 'OFPFF_SEND_FLOW_REM',
204 2: 'OFPFF_CHECK_OVERLAP',
205 4: 'OFPFF_EMERG',
Rich Laneb658ddd2013-03-12 10:15:10 -0700206}
207
208# Identifiers from group ofp_flow_removed_reason
209OFPRR_IDLE_TIMEOUT = 0
210OFPRR_HARD_TIMEOUT = 1
211OFPRR_DELETE = 2
212
213ofp_flow_removed_reason_map = {
214 0: 'OFPRR_IDLE_TIMEOUT',
215 1: 'OFPRR_HARD_TIMEOUT',
216 2: 'OFPRR_DELETE',
217}
218
219# Identifiers from group ofp_flow_wildcards
Rich Lanec2ee4b82013-04-24 17:12:38 -0700220OFPFW_IN_PORT = 1
221OFPFW_DL_VLAN = 2
222OFPFW_DL_SRC = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700223OFPFW_NW_DST_BITS = 6
224OFPFW_NW_SRC_BITS = 6
225OFPFW_NW_SRC_SHIFT = 8
Rich Lanec2ee4b82013-04-24 17:12:38 -0700226OFPFW_DL_DST = 8
Rich Laneb658ddd2013-03-12 10:15:10 -0700227OFPFW_NW_DST_SHIFT = 14
Rich Lanec2ee4b82013-04-24 17:12:38 -0700228OFPFW_DL_TYPE = 16
229OFPFW_NW_PROTO = 32
230OFPFW_TP_SRC = 64
231OFPFW_TP_DST = 128
232OFPFW_NW_SRC_ALL = 8192
233OFPFW_NW_SRC_MASK = 16128
234OFPFW_NW_DST_ALL = 524288
235OFPFW_NW_DST_MASK = 1032192
236OFPFW_DL_VLAN_PCP = 1048576
237OFPFW_NW_TOS = 2097152
238OFPFW_ALL = 4194303
Rich Laneb658ddd2013-03-12 10:15:10 -0700239
240ofp_flow_wildcards_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700241 1: 'OFPFW_IN_PORT',
242 2: 'OFPFW_DL_VLAN',
243 4: 'OFPFW_DL_SRC',
244 8: 'OFPFW_DL_DST',
245 16: 'OFPFW_DL_TYPE',
246 32: 'OFPFW_NW_PROTO',
247 64: 'OFPFW_TP_SRC',
248 128: 'OFPFW_TP_DST',
249 1048576: 'OFPFW_DL_VLAN_PCP',
250 2097152: 'OFPFW_NW_TOS',
Rich Laneb658ddd2013-03-12 10:15:10 -0700251}
252
253# Identifiers from group ofp_hello_failed_code
254OFPHFC_INCOMPATIBLE = 0
255OFPHFC_EPERM = 1
256
257ofp_hello_failed_code_map = {
258 0: 'OFPHFC_INCOMPATIBLE',
259 1: 'OFPHFC_EPERM',
260}
261
Rich Lanec2ee4b82013-04-24 17:12:38 -0700262# Identifiers from group ofp_nicira_controller_role
263NX_ROLE_OTHER = 0
264NX_ROLE_MASTER = 1
265NX_ROLE_SLAVE = 2
266
267ofp_nicira_controller_role_map = {
268 0: 'NX_ROLE_OTHER',
269 1: 'NX_ROLE_MASTER',
270 2: 'NX_ROLE_SLAVE',
271}
272
Rich Laneb658ddd2013-03-12 10:15:10 -0700273# Identifiers from group ofp_packet_in_reason
274OFPR_NO_MATCH = 0
275OFPR_ACTION = 1
276
277ofp_packet_in_reason_map = {
278 0: 'OFPR_NO_MATCH',
279 1: 'OFPR_ACTION',
280}
281
282# Identifiers from group ofp_port
283OFPP_MAX = 0xff00
284OFPP_IN_PORT = 0xfff8
285OFPP_TABLE = 0xfff9
286OFPP_NORMAL = 0xfffa
287OFPP_FLOOD = 0xfffb
288OFPP_ALL = 0xfffc
289OFPP_CONTROLLER = 0xfffd
290OFPP_LOCAL = 0xfffe
291OFPP_NONE = 0xffff
292
293ofp_port_map = {
294 0xff00: 'OFPP_MAX',
295 0xfff8: 'OFPP_IN_PORT',
296 0xfff9: 'OFPP_TABLE',
297 0xfffa: 'OFPP_NORMAL',
298 0xfffb: 'OFPP_FLOOD',
299 0xfffc: 'OFPP_ALL',
300 0xfffd: 'OFPP_CONTROLLER',
301 0xfffe: 'OFPP_LOCAL',
302 0xffff: 'OFPP_NONE',
303}
304
305# Identifiers from group ofp_port_config
Rich Lanec2ee4b82013-04-24 17:12:38 -0700306OFPPC_PORT_DOWN = 1
307OFPPC_NO_STP = 2
308OFPPC_NO_RECV = 4
309OFPPC_NO_RECV_STP = 8
310OFPPC_NO_FLOOD = 16
311OFPPC_NO_FWD = 32
312OFPPC_NO_PACKET_IN = 64
Rich Laneb658ddd2013-03-12 10:15:10 -0700313
314ofp_port_config_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700315 1: 'OFPPC_PORT_DOWN',
316 2: 'OFPPC_NO_STP',
317 4: 'OFPPC_NO_RECV',
318 8: 'OFPPC_NO_RECV_STP',
319 16: 'OFPPC_NO_FLOOD',
320 32: 'OFPPC_NO_FWD',
321 64: 'OFPPC_NO_PACKET_IN',
Rich Laneb658ddd2013-03-12 10:15:10 -0700322}
323
324# Identifiers from group ofp_port_features
Rich Lanec2ee4b82013-04-24 17:12:38 -0700325OFPPF_10MB_HD = 1
326OFPPF_10MB_FD = 2
327OFPPF_100MB_HD = 4
328OFPPF_100MB_FD = 8
329OFPPF_1GB_HD = 16
330OFPPF_1GB_FD = 32
331OFPPF_10GB_FD = 64
332OFPPF_COPPER = 128
333OFPPF_FIBER = 256
334OFPPF_AUTONEG = 512
335OFPPF_PAUSE = 1024
336OFPPF_PAUSE_ASYM = 2048
Rich Laneb658ddd2013-03-12 10:15:10 -0700337
338ofp_port_features_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700339 1: 'OFPPF_10MB_HD',
340 2: 'OFPPF_10MB_FD',
341 4: 'OFPPF_100MB_HD',
342 8: 'OFPPF_100MB_FD',
343 16: 'OFPPF_1GB_HD',
344 32: 'OFPPF_1GB_FD',
345 64: 'OFPPF_10GB_FD',
346 128: 'OFPPF_COPPER',
347 256: 'OFPPF_FIBER',
348 512: 'OFPPF_AUTONEG',
349 1024: 'OFPPF_PAUSE',
350 2048: 'OFPPF_PAUSE_ASYM',
Rich Laneb658ddd2013-03-12 10:15:10 -0700351}
352
353# Identifiers from group ofp_port_mod_failed_code
354OFPPMFC_BAD_PORT = 0
355OFPPMFC_BAD_HW_ADDR = 1
356
357ofp_port_mod_failed_code_map = {
358 0: 'OFPPMFC_BAD_PORT',
359 1: 'OFPPMFC_BAD_HW_ADDR',
360}
361
362# Identifiers from group ofp_port_reason
363OFPPR_ADD = 0
364OFPPR_DELETE = 1
365OFPPR_MODIFY = 2
366
367ofp_port_reason_map = {
368 0: 'OFPPR_ADD',
369 1: 'OFPPR_DELETE',
370 2: 'OFPPR_MODIFY',
371}
372
373# Identifiers from group ofp_port_state
Rich Lanec2ee4b82013-04-24 17:12:38 -0700374OFPPS_STP_LISTEN = 0
375OFPPS_LINK_DOWN = 1
376OFPPS_STP_LEARN = 256
377OFPPS_STP_FORWARD = 512
378OFPPS_STP_BLOCK = 768
379OFPPS_STP_MASK = 768
Rich Laneb658ddd2013-03-12 10:15:10 -0700380
381ofp_port_state_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700382 0: 'OFPPS_STP_LISTEN',
383 1: 'OFPPS_LINK_DOWN',
384 256: 'OFPPS_STP_LEARN',
385 512: 'OFPPS_STP_FORWARD',
386 768: 'OFPPS_STP_BLOCK',
387 768: 'OFPPS_STP_MASK',
Rich Laneb658ddd2013-03-12 10:15:10 -0700388}
389
390# Identifiers from group ofp_queue_op_failed_code
391OFPQOFC_BAD_PORT = 0
392OFPQOFC_BAD_QUEUE = 1
393OFPQOFC_EPERM = 2
394
395ofp_queue_op_failed_code_map = {
396 0: 'OFPQOFC_BAD_PORT',
397 1: 'OFPQOFC_BAD_QUEUE',
398 2: 'OFPQOFC_EPERM',
399}
400
401# Identifiers from group ofp_queue_properties
402OFPQT_NONE = 0
403OFPQT_MIN_RATE = 1
404
405ofp_queue_properties_map = {
406 0: 'OFPQT_NONE',
407 1: 'OFPQT_MIN_RATE',
408}
409
410# Identifiers from group ofp_stats_reply_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700411OFPSF_REPLY_MORE = 1
Rich Laneb658ddd2013-03-12 10:15:10 -0700412
413ofp_stats_reply_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700414 1: 'OFPSF_REPLY_MORE',
Rich Laneb658ddd2013-03-12 10:15:10 -0700415}
416
417# Identifiers from group ofp_stats_types
418OFPST_DESC = 0
419OFPST_FLOW = 1
420OFPST_AGGREGATE = 2
421OFPST_TABLE = 3
422OFPST_PORT = 4
423OFPST_QUEUE = 5
Rich Lanec2ee4b82013-04-24 17:12:38 -0700424OFPST_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -0700425
426ofp_stats_types_map = {
427 0: 'OFPST_DESC',
428 1: 'OFPST_FLOW',
429 2: 'OFPST_AGGREGATE',
430 3: 'OFPST_TABLE',
431 4: 'OFPST_PORT',
432 5: 'OFPST_QUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700433 65535: 'OFPST_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -0700434}
435
436# Identifiers from group ofp_type
437OFPT_HELLO = 0
438OFPT_ERROR = 1
439OFPT_ECHO_REQUEST = 2
440OFPT_ECHO_REPLY = 3
441OFPT_VENDOR = 4
442OFPT_FEATURES_REQUEST = 5
443OFPT_FEATURES_REPLY = 6
444OFPT_GET_CONFIG_REQUEST = 7
445OFPT_GET_CONFIG_REPLY = 8
446OFPT_SET_CONFIG = 9
447OFPT_PACKET_IN = 10
448OFPT_FLOW_REMOVED = 11
449OFPT_PORT_STATUS = 12
450OFPT_PACKET_OUT = 13
451OFPT_FLOW_MOD = 14
452OFPT_PORT_MOD = 15
453OFPT_STATS_REQUEST = 16
454OFPT_STATS_REPLY = 17
455OFPT_BARRIER_REQUEST = 18
456OFPT_BARRIER_REPLY = 19
457OFPT_QUEUE_GET_CONFIG_REQUEST = 20
458OFPT_QUEUE_GET_CONFIG_REPLY = 21
459
460ofp_type_map = {
461 0: 'OFPT_HELLO',
462 1: 'OFPT_ERROR',
463 2: 'OFPT_ECHO_REQUEST',
464 3: 'OFPT_ECHO_REPLY',
465 4: 'OFPT_VENDOR',
466 5: 'OFPT_FEATURES_REQUEST',
467 6: 'OFPT_FEATURES_REPLY',
468 7: 'OFPT_GET_CONFIG_REQUEST',
469 8: 'OFPT_GET_CONFIG_REPLY',
470 9: 'OFPT_SET_CONFIG',
471 10: 'OFPT_PACKET_IN',
472 11: 'OFPT_FLOW_REMOVED',
473 12: 'OFPT_PORT_STATUS',
474 13: 'OFPT_PACKET_OUT',
475 14: 'OFPT_FLOW_MOD',
476 15: 'OFPT_PORT_MOD',
477 16: 'OFPT_STATS_REQUEST',
478 17: 'OFPT_STATS_REPLY',
479 18: 'OFPT_BARRIER_REQUEST',
480 19: 'OFPT_BARRIER_REPLY',
481 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
482 21: 'OFPT_QUEUE_GET_CONFIG_REPLY',
483}
484