blob: 3b9a177f1f9cf8cdd9188c825e0c05f4a617606e [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.
Rich Laneb658ddd2013-03-12 10:15:10 -07004
5# Automatically generated by LOXI from template const.py
6# Do not modify
7
8OFP_VERSION = 1
9
10# Identifiers from group macro_definitions
11OFP_FLOW_PERMANENT = 0
12OFP_ETH_ALEN = 6
13OFP_MAX_PORT_NAME_LEN = 16
14OFP_MAX_TABLE_NAME_LEN = 32
15SERIAL_NUM_LEN = 32
Rich Lanec2ee4b82013-04-24 17:12:38 -070016OFPFW_ICMP_TYPE = 64
Rich Laneb658ddd2013-03-12 10:15:10 -070017OFP_DEFAULT_MISS_SEND_LEN = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -070018OFPFW_ICMP_CODE = 128
Rich Laneb658ddd2013-03-12 10:15:10 -070019DESC_STR_LEN = 256
Rich Lanec2ee4b82013-04-24 17:12:38 -070020OFP_DL_TYPE_NOT_ETH_TYPE = 1535
21OFP_DL_TYPE_ETH2_CUTOFF = 1536
Rich Laneb658ddd2013-03-12 10:15:10 -070022OFP_TCP_PORT = 6633
23OFP_SSL_PORT = 6633
Rich Lanec2ee4b82013-04-24 17:12:38 -070024OFP_DEFAULT_PRIORITY = 32768
25OFP_VLAN_NONE = 65535
26OFPQ_MIN_RATE_UNCFG = 65535
27OFPQ_ALL = 4294967295
Rich Laneb658ddd2013-03-12 10:15:10 -070028
29# Identifiers from group ofp_action_type
30OFPAT_OUTPUT = 0
31OFPAT_SET_VLAN_VID = 1
32OFPAT_SET_VLAN_PCP = 2
33OFPAT_STRIP_VLAN = 3
34OFPAT_SET_DL_SRC = 4
35OFPAT_SET_DL_DST = 5
36OFPAT_SET_NW_SRC = 6
37OFPAT_SET_NW_DST = 7
38OFPAT_SET_NW_TOS = 8
39OFPAT_SET_TP_SRC = 9
40OFPAT_SET_TP_DST = 10
41OFPAT_ENQUEUE = 11
Rich Lanec2ee4b82013-04-24 17:12:38 -070042OFPAT_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -070043
44ofp_action_type_map = {
45 0: 'OFPAT_OUTPUT',
46 1: 'OFPAT_SET_VLAN_VID',
47 2: 'OFPAT_SET_VLAN_PCP',
48 3: 'OFPAT_STRIP_VLAN',
49 4: 'OFPAT_SET_DL_SRC',
50 5: 'OFPAT_SET_DL_DST',
51 6: 'OFPAT_SET_NW_SRC',
52 7: 'OFPAT_SET_NW_DST',
53 8: 'OFPAT_SET_NW_TOS',
54 9: 'OFPAT_SET_TP_SRC',
55 10: 'OFPAT_SET_TP_DST',
56 11: 'OFPAT_ENQUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -070057 65535: 'OFPAT_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -070058}
59
60# Identifiers from group ofp_bad_action_code
61OFPBAC_BAD_TYPE = 0
62OFPBAC_BAD_LEN = 1
63OFPBAC_BAD_VENDOR = 2
64OFPBAC_BAD_VENDOR_TYPE = 3
65OFPBAC_BAD_OUT_PORT = 4
66OFPBAC_BAD_ARGUMENT = 5
67OFPBAC_EPERM = 6
68OFPBAC_TOO_MANY = 7
69OFPBAC_BAD_QUEUE = 8
70
71ofp_bad_action_code_map = {
72 0: 'OFPBAC_BAD_TYPE',
73 1: 'OFPBAC_BAD_LEN',
74 2: 'OFPBAC_BAD_VENDOR',
75 3: 'OFPBAC_BAD_VENDOR_TYPE',
76 4: 'OFPBAC_BAD_OUT_PORT',
77 5: 'OFPBAC_BAD_ARGUMENT',
78 6: 'OFPBAC_EPERM',
79 7: 'OFPBAC_TOO_MANY',
80 8: 'OFPBAC_BAD_QUEUE',
81}
82
83# Identifiers from group ofp_bad_request_code
84OFPBRC_BAD_VERSION = 0
85OFPBRC_BAD_TYPE = 1
86OFPBRC_BAD_STAT = 2
87OFPBRC_BAD_VENDOR = 3
88OFPBRC_BAD_SUBTYPE = 4
89OFPBRC_EPERM = 5
90OFPBRC_BAD_LEN = 6
91OFPBRC_BUFFER_EMPTY = 7
92OFPBRC_BUFFER_UNKNOWN = 8
93
94ofp_bad_request_code_map = {
95 0: 'OFPBRC_BAD_VERSION',
96 1: 'OFPBRC_BAD_TYPE',
97 2: 'OFPBRC_BAD_STAT',
98 3: 'OFPBRC_BAD_VENDOR',
99 4: 'OFPBRC_BAD_SUBTYPE',
100 5: 'OFPBRC_EPERM',
101 6: 'OFPBRC_BAD_LEN',
102 7: 'OFPBRC_BUFFER_EMPTY',
103 8: 'OFPBRC_BUFFER_UNKNOWN',
104}
105
106# Identifiers from group ofp_capabilities
Rich Lanec2ee4b82013-04-24 17:12:38 -0700107OFPC_FLOW_STATS = 1
108OFPC_TABLE_STATS = 2
109OFPC_PORT_STATS = 4
110OFPC_STP = 8
111OFPC_RESERVED = 16
112OFPC_IP_REASM = 32
113OFPC_QUEUE_STATS = 64
114OFPC_ARP_MATCH_IP = 128
Rich Laneb658ddd2013-03-12 10:15:10 -0700115
116ofp_capabilities_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700117 1: 'OFPC_FLOW_STATS',
118 2: 'OFPC_TABLE_STATS',
119 4: 'OFPC_PORT_STATS',
120 8: 'OFPC_STP',
121 16: 'OFPC_RESERVED',
122 32: 'OFPC_IP_REASM',
123 64: 'OFPC_QUEUE_STATS',
124 128: 'OFPC_ARP_MATCH_IP',
Rich Laneb658ddd2013-03-12 10:15:10 -0700125}
126
127# Identifiers from group ofp_config_flags
128OFPC_FRAG_NORMAL = 0
129OFPC_FRAG_DROP = 1
130OFPC_FRAG_REASM = 2
131OFPC_FRAG_MASK = 3
132
133ofp_config_flags_map = {
134 0: 'OFPC_FRAG_NORMAL',
135 1: 'OFPC_FRAG_DROP',
136 2: 'OFPC_FRAG_REASM',
137 3: 'OFPC_FRAG_MASK',
138}
139
140# Identifiers from group ofp_error_type
141OFPET_HELLO_FAILED = 0
142OFPET_BAD_REQUEST = 1
143OFPET_BAD_ACTION = 2
144OFPET_FLOW_MOD_FAILED = 3
145OFPET_PORT_MOD_FAILED = 4
146OFPET_QUEUE_OP_FAILED = 5
147
148ofp_error_type_map = {
149 0: 'OFPET_HELLO_FAILED',
150 1: 'OFPET_BAD_REQUEST',
151 2: 'OFPET_BAD_ACTION',
152 3: 'OFPET_FLOW_MOD_FAILED',
153 4: 'OFPET_PORT_MOD_FAILED',
154 5: 'OFPET_QUEUE_OP_FAILED',
155}
156
157# Identifiers from group ofp_flow_mod_command
158OFPFC_ADD = 0
159OFPFC_MODIFY = 1
160OFPFC_MODIFY_STRICT = 2
161OFPFC_DELETE = 3
162OFPFC_DELETE_STRICT = 4
163
164ofp_flow_mod_command_map = {
165 0: 'OFPFC_ADD',
166 1: 'OFPFC_MODIFY',
167 2: 'OFPFC_MODIFY_STRICT',
168 3: 'OFPFC_DELETE',
169 4: 'OFPFC_DELETE_STRICT',
170}
171
172# Identifiers from group ofp_flow_mod_failed_code
173OFPFMFC_ALL_TABLES_FULL = 0
174OFPFMFC_OVERLAP = 1
175OFPFMFC_EPERM = 2
176OFPFMFC_BAD_EMERG_TIMEOUT = 3
177OFPFMFC_BAD_COMMAND = 4
178OFPFMFC_UNSUPPORTED = 5
179
180ofp_flow_mod_failed_code_map = {
181 0: 'OFPFMFC_ALL_TABLES_FULL',
182 1: 'OFPFMFC_OVERLAP',
183 2: 'OFPFMFC_EPERM',
184 3: 'OFPFMFC_BAD_EMERG_TIMEOUT',
185 4: 'OFPFMFC_BAD_COMMAND',
186 5: 'OFPFMFC_UNSUPPORTED',
187}
188
189# Identifiers from group ofp_flow_mod_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700190OFPFF_SEND_FLOW_REM = 1
191OFPFF_CHECK_OVERLAP = 2
192OFPFF_EMERG = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700193
194ofp_flow_mod_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700195 1: 'OFPFF_SEND_FLOW_REM',
196 2: 'OFPFF_CHECK_OVERLAP',
197 4: 'OFPFF_EMERG',
Rich Laneb658ddd2013-03-12 10:15:10 -0700198}
199
200# Identifiers from group ofp_flow_removed_reason
201OFPRR_IDLE_TIMEOUT = 0
202OFPRR_HARD_TIMEOUT = 1
203OFPRR_DELETE = 2
204
205ofp_flow_removed_reason_map = {
206 0: 'OFPRR_IDLE_TIMEOUT',
207 1: 'OFPRR_HARD_TIMEOUT',
208 2: 'OFPRR_DELETE',
209}
210
211# Identifiers from group ofp_flow_wildcards
Rich Lanec2ee4b82013-04-24 17:12:38 -0700212OFPFW_IN_PORT = 1
213OFPFW_DL_VLAN = 2
214OFPFW_DL_SRC = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700215OFPFW_NW_DST_BITS = 6
216OFPFW_NW_SRC_BITS = 6
217OFPFW_NW_SRC_SHIFT = 8
Rich Lanec2ee4b82013-04-24 17:12:38 -0700218OFPFW_DL_DST = 8
Rich Laneb658ddd2013-03-12 10:15:10 -0700219OFPFW_NW_DST_SHIFT = 14
Rich Lanec2ee4b82013-04-24 17:12:38 -0700220OFPFW_DL_TYPE = 16
221OFPFW_NW_PROTO = 32
222OFPFW_TP_SRC = 64
223OFPFW_TP_DST = 128
224OFPFW_NW_SRC_ALL = 8192
225OFPFW_NW_SRC_MASK = 16128
226OFPFW_NW_DST_ALL = 524288
227OFPFW_NW_DST_MASK = 1032192
228OFPFW_DL_VLAN_PCP = 1048576
229OFPFW_NW_TOS = 2097152
230OFPFW_ALL = 4194303
Rich Laneb658ddd2013-03-12 10:15:10 -0700231
232ofp_flow_wildcards_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700233 1: 'OFPFW_IN_PORT',
234 2: 'OFPFW_DL_VLAN',
235 4: 'OFPFW_DL_SRC',
236 8: 'OFPFW_DL_DST',
237 16: 'OFPFW_DL_TYPE',
238 32: 'OFPFW_NW_PROTO',
239 64: 'OFPFW_TP_SRC',
240 128: 'OFPFW_TP_DST',
241 1048576: 'OFPFW_DL_VLAN_PCP',
242 2097152: 'OFPFW_NW_TOS',
Rich Laneb658ddd2013-03-12 10:15:10 -0700243}
244
245# Identifiers from group ofp_hello_failed_code
246OFPHFC_INCOMPATIBLE = 0
247OFPHFC_EPERM = 1
248
249ofp_hello_failed_code_map = {
250 0: 'OFPHFC_INCOMPATIBLE',
251 1: 'OFPHFC_EPERM',
252}
253
Rich Lanec2ee4b82013-04-24 17:12:38 -0700254# Identifiers from group ofp_nicira_controller_role
255NX_ROLE_OTHER = 0
256NX_ROLE_MASTER = 1
257NX_ROLE_SLAVE = 2
258
259ofp_nicira_controller_role_map = {
260 0: 'NX_ROLE_OTHER',
261 1: 'NX_ROLE_MASTER',
262 2: 'NX_ROLE_SLAVE',
263}
264
Rich Laneb658ddd2013-03-12 10:15:10 -0700265# Identifiers from group ofp_packet_in_reason
266OFPR_NO_MATCH = 0
267OFPR_ACTION = 1
268
269ofp_packet_in_reason_map = {
270 0: 'OFPR_NO_MATCH',
271 1: 'OFPR_ACTION',
272}
273
274# Identifiers from group ofp_port
275OFPP_MAX = 0xff00
276OFPP_IN_PORT = 0xfff8
277OFPP_TABLE = 0xfff9
278OFPP_NORMAL = 0xfffa
279OFPP_FLOOD = 0xfffb
280OFPP_ALL = 0xfffc
281OFPP_CONTROLLER = 0xfffd
282OFPP_LOCAL = 0xfffe
283OFPP_NONE = 0xffff
284
285ofp_port_map = {
286 0xff00: 'OFPP_MAX',
287 0xfff8: 'OFPP_IN_PORT',
288 0xfff9: 'OFPP_TABLE',
289 0xfffa: 'OFPP_NORMAL',
290 0xfffb: 'OFPP_FLOOD',
291 0xfffc: 'OFPP_ALL',
292 0xfffd: 'OFPP_CONTROLLER',
293 0xfffe: 'OFPP_LOCAL',
294 0xffff: 'OFPP_NONE',
295}
296
297# Identifiers from group ofp_port_config
Rich Lanec2ee4b82013-04-24 17:12:38 -0700298OFPPC_PORT_DOWN = 1
299OFPPC_NO_STP = 2
300OFPPC_NO_RECV = 4
301OFPPC_NO_RECV_STP = 8
302OFPPC_NO_FLOOD = 16
303OFPPC_NO_FWD = 32
304OFPPC_NO_PACKET_IN = 64
Rich Laneb658ddd2013-03-12 10:15:10 -0700305
306ofp_port_config_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700307 1: 'OFPPC_PORT_DOWN',
308 2: 'OFPPC_NO_STP',
309 4: 'OFPPC_NO_RECV',
310 8: 'OFPPC_NO_RECV_STP',
311 16: 'OFPPC_NO_FLOOD',
312 32: 'OFPPC_NO_FWD',
313 64: 'OFPPC_NO_PACKET_IN',
Rich Laneb658ddd2013-03-12 10:15:10 -0700314}
315
316# Identifiers from group ofp_port_features
Rich Lanec2ee4b82013-04-24 17:12:38 -0700317OFPPF_10MB_HD = 1
318OFPPF_10MB_FD = 2
319OFPPF_100MB_HD = 4
320OFPPF_100MB_FD = 8
321OFPPF_1GB_HD = 16
322OFPPF_1GB_FD = 32
323OFPPF_10GB_FD = 64
324OFPPF_COPPER = 128
325OFPPF_FIBER = 256
326OFPPF_AUTONEG = 512
327OFPPF_PAUSE = 1024
328OFPPF_PAUSE_ASYM = 2048
Rich Laneb658ddd2013-03-12 10:15:10 -0700329
330ofp_port_features_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700331 1: 'OFPPF_10MB_HD',
332 2: 'OFPPF_10MB_FD',
333 4: 'OFPPF_100MB_HD',
334 8: 'OFPPF_100MB_FD',
335 16: 'OFPPF_1GB_HD',
336 32: 'OFPPF_1GB_FD',
337 64: 'OFPPF_10GB_FD',
338 128: 'OFPPF_COPPER',
339 256: 'OFPPF_FIBER',
340 512: 'OFPPF_AUTONEG',
341 1024: 'OFPPF_PAUSE',
342 2048: 'OFPPF_PAUSE_ASYM',
Rich Laneb658ddd2013-03-12 10:15:10 -0700343}
344
345# Identifiers from group ofp_port_mod_failed_code
346OFPPMFC_BAD_PORT = 0
347OFPPMFC_BAD_HW_ADDR = 1
348
349ofp_port_mod_failed_code_map = {
350 0: 'OFPPMFC_BAD_PORT',
351 1: 'OFPPMFC_BAD_HW_ADDR',
352}
353
354# Identifiers from group ofp_port_reason
355OFPPR_ADD = 0
356OFPPR_DELETE = 1
357OFPPR_MODIFY = 2
358
359ofp_port_reason_map = {
360 0: 'OFPPR_ADD',
361 1: 'OFPPR_DELETE',
362 2: 'OFPPR_MODIFY',
363}
364
365# Identifiers from group ofp_port_state
Rich Lanec2ee4b82013-04-24 17:12:38 -0700366OFPPS_STP_LISTEN = 0
367OFPPS_LINK_DOWN = 1
368OFPPS_STP_LEARN = 256
369OFPPS_STP_FORWARD = 512
370OFPPS_STP_BLOCK = 768
371OFPPS_STP_MASK = 768
Rich Laneb658ddd2013-03-12 10:15:10 -0700372
373ofp_port_state_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700374 0: 'OFPPS_STP_LISTEN',
375 1: 'OFPPS_LINK_DOWN',
376 256: 'OFPPS_STP_LEARN',
377 512: 'OFPPS_STP_FORWARD',
378 768: 'OFPPS_STP_BLOCK',
379 768: 'OFPPS_STP_MASK',
Rich Laneb658ddd2013-03-12 10:15:10 -0700380}
381
382# Identifiers from group ofp_queue_op_failed_code
383OFPQOFC_BAD_PORT = 0
384OFPQOFC_BAD_QUEUE = 1
385OFPQOFC_EPERM = 2
386
387ofp_queue_op_failed_code_map = {
388 0: 'OFPQOFC_BAD_PORT',
389 1: 'OFPQOFC_BAD_QUEUE',
390 2: 'OFPQOFC_EPERM',
391}
392
393# Identifiers from group ofp_queue_properties
394OFPQT_NONE = 0
395OFPQT_MIN_RATE = 1
396
397ofp_queue_properties_map = {
398 0: 'OFPQT_NONE',
399 1: 'OFPQT_MIN_RATE',
400}
401
402# Identifiers from group ofp_stats_reply_flags
Rich Lanec2ee4b82013-04-24 17:12:38 -0700403OFPSF_REPLY_MORE = 1
Rich Laneb658ddd2013-03-12 10:15:10 -0700404
405ofp_stats_reply_flags_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700406 1: 'OFPSF_REPLY_MORE',
Rich Laneb658ddd2013-03-12 10:15:10 -0700407}
408
409# Identifiers from group ofp_stats_types
410OFPST_DESC = 0
411OFPST_FLOW = 1
412OFPST_AGGREGATE = 2
413OFPST_TABLE = 3
414OFPST_PORT = 4
415OFPST_QUEUE = 5
Rich Lanec2ee4b82013-04-24 17:12:38 -0700416OFPST_VENDOR = 65535
Rich Laneb658ddd2013-03-12 10:15:10 -0700417
418ofp_stats_types_map = {
419 0: 'OFPST_DESC',
420 1: 'OFPST_FLOW',
421 2: 'OFPST_AGGREGATE',
422 3: 'OFPST_TABLE',
423 4: 'OFPST_PORT',
424 5: 'OFPST_QUEUE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700425 65535: 'OFPST_VENDOR',
Rich Laneb658ddd2013-03-12 10:15:10 -0700426}
427
428# Identifiers from group ofp_type
429OFPT_HELLO = 0
430OFPT_ERROR = 1
431OFPT_ECHO_REQUEST = 2
432OFPT_ECHO_REPLY = 3
433OFPT_VENDOR = 4
434OFPT_FEATURES_REQUEST = 5
435OFPT_FEATURES_REPLY = 6
436OFPT_GET_CONFIG_REQUEST = 7
437OFPT_GET_CONFIG_REPLY = 8
438OFPT_SET_CONFIG = 9
439OFPT_PACKET_IN = 10
440OFPT_FLOW_REMOVED = 11
441OFPT_PORT_STATUS = 12
442OFPT_PACKET_OUT = 13
443OFPT_FLOW_MOD = 14
444OFPT_PORT_MOD = 15
445OFPT_STATS_REQUEST = 16
446OFPT_STATS_REPLY = 17
447OFPT_BARRIER_REQUEST = 18
448OFPT_BARRIER_REPLY = 19
449OFPT_QUEUE_GET_CONFIG_REQUEST = 20
450OFPT_QUEUE_GET_CONFIG_REPLY = 21
451
452ofp_type_map = {
453 0: 'OFPT_HELLO',
454 1: 'OFPT_ERROR',
455 2: 'OFPT_ECHO_REQUEST',
456 3: 'OFPT_ECHO_REPLY',
457 4: 'OFPT_VENDOR',
458 5: 'OFPT_FEATURES_REQUEST',
459 6: 'OFPT_FEATURES_REPLY',
460 7: 'OFPT_GET_CONFIG_REQUEST',
461 8: 'OFPT_GET_CONFIG_REPLY',
462 9: 'OFPT_SET_CONFIG',
463 10: 'OFPT_PACKET_IN',
464 11: 'OFPT_FLOW_REMOVED',
465 12: 'OFPT_PORT_STATUS',
466 13: 'OFPT_PACKET_OUT',
467 14: 'OFPT_FLOW_MOD',
468 15: 'OFPT_PORT_MOD',
469 16: 'OFPT_STATS_REQUEST',
470 17: 'OFPT_STATS_REPLY',
471 18: 'OFPT_BARRIER_REQUEST',
472 19: 'OFPT_BARRIER_REPLY',
473 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
474 21: 'OFPT_QUEUE_GET_CONFIG_REPLY',
475}
476