blob: 0273c7a41c8ee91e93ae6ca7c701d1090cd8e2e5 [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
Dan Talaycof6202252013-07-02 01:00:29 -0700238OFPFW_SRC_META_ID = 4194304
239OFPFW_DST_META_ID = 8388608
Rich Lanec2ee4b82013-04-24 17:12:38 -0700240OFPFW_ALL = 4194303
Rich Laneb658ddd2013-03-12 10:15:10 -0700241
242ofp_flow_wildcards_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700243 1: 'OFPFW_IN_PORT',
244 2: 'OFPFW_DL_VLAN',
245 4: 'OFPFW_DL_SRC',
246 8: 'OFPFW_DL_DST',
247 16: 'OFPFW_DL_TYPE',
248 32: 'OFPFW_NW_PROTO',
249 64: 'OFPFW_TP_SRC',
250 128: 'OFPFW_TP_DST',
251 1048576: 'OFPFW_DL_VLAN_PCP',
252 2097152: 'OFPFW_NW_TOS',
Dan Talaycof6202252013-07-02 01:00:29 -0700253 4194304: 'OFPFW_SRC_META_ID',
254 8388608: 'OFPFW_DST_META_ID',
Rich Laneb658ddd2013-03-12 10:15:10 -0700255}
256
257# Identifiers from group ofp_hello_failed_code
258OFPHFC_INCOMPATIBLE = 0
259OFPHFC_EPERM = 1
260
261ofp_hello_failed_code_map = {
262 0: 'OFPHFC_INCOMPATIBLE',
263 1: 'OFPHFC_EPERM',
264}
265
Rich Lanec2ee4b82013-04-24 17:12:38 -0700266# Identifiers from group ofp_nicira_controller_role
267NX_ROLE_OTHER = 0
268NX_ROLE_MASTER = 1
269NX_ROLE_SLAVE = 2
270
271ofp_nicira_controller_role_map = {
272 0: 'NX_ROLE_OTHER',
273 1: 'NX_ROLE_MASTER',
274 2: 'NX_ROLE_SLAVE',
275}
276
Rich Laneb658ddd2013-03-12 10:15:10 -0700277# Identifiers from group ofp_packet_in_reason
278OFPR_NO_MATCH = 0
279OFPR_ACTION = 1
280
281ofp_packet_in_reason_map = {
282 0: 'OFPR_NO_MATCH',
283 1: 'OFPR_ACTION',
284}
285
286# Identifiers from group ofp_port
287OFPP_MAX = 0xff00
288OFPP_IN_PORT = 0xfff8
289OFPP_TABLE = 0xfff9
290OFPP_NORMAL = 0xfffa
291OFPP_FLOOD = 0xfffb
292OFPP_ALL = 0xfffc
293OFPP_CONTROLLER = 0xfffd
294OFPP_LOCAL = 0xfffe
295OFPP_NONE = 0xffff
296
297ofp_port_map = {
298 0xff00: 'OFPP_MAX',
299 0xfff8: 'OFPP_IN_PORT',
300 0xfff9: 'OFPP_TABLE',
301 0xfffa: 'OFPP_NORMAL',
302 0xfffb: 'OFPP_FLOOD',
303 0xfffc: 'OFPP_ALL',
304 0xfffd: 'OFPP_CONTROLLER',
305 0xfffe: 'OFPP_LOCAL',
306 0xffff: 'OFPP_NONE',
307}
308
309# Identifiers from group ofp_port_config
Rich Lanec2ee4b82013-04-24 17:12:38 -0700310OFPPC_PORT_DOWN = 1
311OFPPC_NO_STP = 2
312OFPPC_NO_RECV = 4
313OFPPC_NO_RECV_STP = 8
314OFPPC_NO_FLOOD = 16
315OFPPC_NO_FWD = 32
316OFPPC_NO_PACKET_IN = 64
Rich Laneb658ddd2013-03-12 10:15:10 -0700317
318ofp_port_config_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700319 1: 'OFPPC_PORT_DOWN',
320 2: 'OFPPC_NO_STP',
321 4: 'OFPPC_NO_RECV',
322 8: 'OFPPC_NO_RECV_STP',
323 16: 'OFPPC_NO_FLOOD',
324 32: 'OFPPC_NO_FWD',
325 64: 'OFPPC_NO_PACKET_IN',
Rich Laneb658ddd2013-03-12 10:15:10 -0700326}
327
328# Identifiers from group ofp_port_features
Rich Lanec2ee4b82013-04-24 17:12:38 -0700329OFPPF_10MB_HD = 1
330OFPPF_10MB_FD = 2
331OFPPF_100MB_HD = 4
332OFPPF_100MB_FD = 8
333OFPPF_1GB_HD = 16
334OFPPF_1GB_FD = 32
335OFPPF_10GB_FD = 64
336OFPPF_COPPER = 128
337OFPPF_FIBER = 256
338OFPPF_AUTONEG = 512
339OFPPF_PAUSE = 1024
340OFPPF_PAUSE_ASYM = 2048
Rich Laneb658ddd2013-03-12 10:15:10 -0700341
342ofp_port_features_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700343 1: 'OFPPF_10MB_HD',
344 2: 'OFPPF_10MB_FD',
345 4: 'OFPPF_100MB_HD',
346 8: 'OFPPF_100MB_FD',
347 16: 'OFPPF_1GB_HD',
348 32: 'OFPPF_1GB_FD',
349 64: 'OFPPF_10GB_FD',
350 128: 'OFPPF_COPPER',
351 256: 'OFPPF_FIBER',
352 512: 'OFPPF_AUTONEG',
353 1024: 'OFPPF_PAUSE',
354 2048: 'OFPPF_PAUSE_ASYM',
Rich Laneb658ddd2013-03-12 10:15:10 -0700355}
356
357# Identifiers from group ofp_port_mod_failed_code
358OFPPMFC_BAD_PORT = 0
359OFPPMFC_BAD_HW_ADDR = 1
360
361ofp_port_mod_failed_code_map = {
362 0: 'OFPPMFC_BAD_PORT',
363 1: 'OFPPMFC_BAD_HW_ADDR',
364}
365
366# Identifiers from group ofp_port_reason
367OFPPR_ADD = 0
368OFPPR_DELETE = 1
369OFPPR_MODIFY = 2
370
371ofp_port_reason_map = {
372 0: 'OFPPR_ADD',
373 1: 'OFPPR_DELETE',
374 2: 'OFPPR_MODIFY',
375}
376
377# Identifiers from group ofp_port_state
Rich Lanec2ee4b82013-04-24 17:12:38 -0700378OFPPS_STP_LISTEN = 0
379OFPPS_LINK_DOWN = 1
380OFPPS_STP_LEARN = 256
381OFPPS_STP_FORWARD = 512
382OFPPS_STP_BLOCK = 768
383OFPPS_STP_MASK = 768
Rich Laneb658ddd2013-03-12 10:15:10 -0700384
385ofp_port_state_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700386 0: 'OFPPS_STP_LISTEN',
387 1: 'OFPPS_LINK_DOWN',
388 256: 'OFPPS_STP_LEARN',
389 512: 'OFPPS_STP_FORWARD',
390 768: 'OFPPS_STP_BLOCK',
391 768: 'OFPPS_STP_MASK',
Rich Laneb658ddd2013-03-12 10:15:10 -0700392}
393
394# Identifiers from group ofp_queue_op_failed_code
395OFPQOFC_BAD_PORT = 0
396OFPQOFC_BAD_QUEUE = 1
397OFPQOFC_EPERM = 2
398
399ofp_queue_op_failed_code_map = {
400 0: 'OFPQOFC_BAD_PORT',
401 1: 'OFPQOFC_BAD_QUEUE',
402 2: 'OFPQOFC_EPERM',
403}
404
405# Identifiers from group ofp_queue_properties
406OFPQT_NONE = 0
407OFPQT_MIN_RATE = 1
408
409ofp_queue_properties_map = {
410 0: 'OFPQT_NONE',
411 1: 'OFPQT_MIN_RATE',
412}
413
414# Identifiers from group ofp_stats_reply_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700415OFPSF_REPLY_MORE = 1
Rich Laneb658ddd2013-03-12 10:15:10 -0700416
417ofp_stats_reply_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700418 1: 'OFPSF_REPLY_MORE',
Rich Laneb658ddd2013-03-12 10:15:10 -0700419}
420
421# Identifiers from group ofp_stats_types
422OFPST_DESC = 0
423OFPST_FLOW = 1
424OFPST_AGGREGATE = 2
425OFPST_TABLE = 3
426OFPST_PORT = 4
427OFPST_QUEUE = 5
Rich Lanec2ee4b82013-04-24 17:12:38 -0700428OFPST_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -0700429
430ofp_stats_types_map = {
431 0: 'OFPST_DESC',
432 1: 'OFPST_FLOW',
433 2: 'OFPST_AGGREGATE',
434 3: 'OFPST_TABLE',
435 4: 'OFPST_PORT',
436 5: 'OFPST_QUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700437 65535: 'OFPST_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -0700438}
439
440# Identifiers from group ofp_type
441OFPT_HELLO = 0
442OFPT_ERROR = 1
443OFPT_ECHO_REQUEST = 2
444OFPT_ECHO_REPLY = 3
445OFPT_VENDOR = 4
446OFPT_FEATURES_REQUEST = 5
447OFPT_FEATURES_REPLY = 6
448OFPT_GET_CONFIG_REQUEST = 7
449OFPT_GET_CONFIG_REPLY = 8
450OFPT_SET_CONFIG = 9
451OFPT_PACKET_IN = 10
452OFPT_FLOW_REMOVED = 11
453OFPT_PORT_STATUS = 12
454OFPT_PACKET_OUT = 13
455OFPT_FLOW_MOD = 14
456OFPT_PORT_MOD = 15
457OFPT_STATS_REQUEST = 16
458OFPT_STATS_REPLY = 17
459OFPT_BARRIER_REQUEST = 18
460OFPT_BARRIER_REPLY = 19
461OFPT_QUEUE_GET_CONFIG_REQUEST = 20
462OFPT_QUEUE_GET_CONFIG_REPLY = 21
463
464ofp_type_map = {
465 0: 'OFPT_HELLO',
466 1: 'OFPT_ERROR',
467 2: 'OFPT_ECHO_REQUEST',
468 3: 'OFPT_ECHO_REPLY',
469 4: 'OFPT_VENDOR',
470 5: 'OFPT_FEATURES_REQUEST',
471 6: 'OFPT_FEATURES_REPLY',
472 7: 'OFPT_GET_CONFIG_REQUEST',
473 8: 'OFPT_GET_CONFIG_REPLY',
474 9: 'OFPT_SET_CONFIG',
475 10: 'OFPT_PACKET_IN',
476 11: 'OFPT_FLOW_REMOVED',
477 12: 'OFPT_PORT_STATUS',
478 13: 'OFPT_PACKET_OUT',
479 14: 'OFPT_FLOW_MOD',
480 15: 'OFPT_PORT_MOD',
481 16: 'OFPT_STATS_REQUEST',
482 17: 'OFPT_STATS_REPLY',
483 18: 'OFPT_BARRIER_REQUEST',
484 19: 'OFPT_BARRIER_REPLY',
485 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
486 21: 'OFPT_QUEUE_GET_CONFIG_REPLY',
487}
488