blob: e26907166e0bc1d88e1808b47b5c233ac9b9d929 [file] [log] [blame]
Rich Laneb658ddd2013-03-12 10:15:10 -07001#
2# Copyright 2012, 2013, Big Switch Networks, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16# Automatically generated by LOXI from template const.py
17# Do not modify
18
19OFP_VERSION = 1
20
21# Identifiers from group macro_definitions
22OFP_FLOW_PERMANENT = 0
23OFP_ETH_ALEN = 6
24OFP_MAX_PORT_NAME_LEN = 16
25OFP_MAX_TABLE_NAME_LEN = 32
26SERIAL_NUM_LEN = 32
27OFPFW_ICMP_TYPE = (1 << 6)
28OFPFW_ICMP_CODE = (1 << 7)
29OFP_DEFAULT_MISS_SEND_LEN = 128
30DESC_STR_LEN = 256
31OFP_DL_TYPE_NOT_ETH_TYPE = 0x05ff
32OFP_DL_TYPE_ETH2_CUTOFF = 0x0600
33OFP_TCP_PORT = 6633
34OFP_SSL_PORT = 6633
35OFP_DEFAULT_PRIORITY = 0x8000
36OFPQ_MIN_RATE_UNCFG = 0xffff
37OFP_VLAN_NONE = 0xffff
38OFPQ_ALL = 0xffffffff
39
40# Identifiers from group ofp_action_type
41OFPAT_OUTPUT = 0
42OFPAT_SET_VLAN_VID = 1
43OFPAT_SET_VLAN_PCP = 2
44OFPAT_STRIP_VLAN = 3
45OFPAT_SET_DL_SRC = 4
46OFPAT_SET_DL_DST = 5
47OFPAT_SET_NW_SRC = 6
48OFPAT_SET_NW_DST = 7
49OFPAT_SET_NW_TOS = 8
50OFPAT_SET_TP_SRC = 9
51OFPAT_SET_TP_DST = 10
52OFPAT_ENQUEUE = 11
53OFPAT_VENDOR = 0xffff
54
55ofp_action_type_map = {
56 0: 'OFPAT_OUTPUT',
57 1: 'OFPAT_SET_VLAN_VID',
58 2: 'OFPAT_SET_VLAN_PCP',
59 3: 'OFPAT_STRIP_VLAN',
60 4: 'OFPAT_SET_DL_SRC',
61 5: 'OFPAT_SET_DL_DST',
62 6: 'OFPAT_SET_NW_SRC',
63 7: 'OFPAT_SET_NW_DST',
64 8: 'OFPAT_SET_NW_TOS',
65 9: 'OFPAT_SET_TP_SRC',
66 10: 'OFPAT_SET_TP_DST',
67 11: 'OFPAT_ENQUEUE',
68 0xffff: 'OFPAT_VENDOR',
69}
70
71# Identifiers from group ofp_bad_action_code
72OFPBAC_BAD_TYPE = 0
73OFPBAC_BAD_LEN = 1
74OFPBAC_BAD_VENDOR = 2
75OFPBAC_BAD_VENDOR_TYPE = 3
76OFPBAC_BAD_OUT_PORT = 4
77OFPBAC_BAD_ARGUMENT = 5
78OFPBAC_EPERM = 6
79OFPBAC_TOO_MANY = 7
80OFPBAC_BAD_QUEUE = 8
81
82ofp_bad_action_code_map = {
83 0: 'OFPBAC_BAD_TYPE',
84 1: 'OFPBAC_BAD_LEN',
85 2: 'OFPBAC_BAD_VENDOR',
86 3: 'OFPBAC_BAD_VENDOR_TYPE',
87 4: 'OFPBAC_BAD_OUT_PORT',
88 5: 'OFPBAC_BAD_ARGUMENT',
89 6: 'OFPBAC_EPERM',
90 7: 'OFPBAC_TOO_MANY',
91 8: 'OFPBAC_BAD_QUEUE',
92}
93
94# Identifiers from group ofp_bad_request_code
95OFPBRC_BAD_VERSION = 0
96OFPBRC_BAD_TYPE = 1
97OFPBRC_BAD_STAT = 2
98OFPBRC_BAD_VENDOR = 3
99OFPBRC_BAD_SUBTYPE = 4
100OFPBRC_EPERM = 5
101OFPBRC_BAD_LEN = 6
102OFPBRC_BUFFER_EMPTY = 7
103OFPBRC_BUFFER_UNKNOWN = 8
104
105ofp_bad_request_code_map = {
106 0: 'OFPBRC_BAD_VERSION',
107 1: 'OFPBRC_BAD_TYPE',
108 2: 'OFPBRC_BAD_STAT',
109 3: 'OFPBRC_BAD_VENDOR',
110 4: 'OFPBRC_BAD_SUBTYPE',
111 5: 'OFPBRC_EPERM',
112 6: 'OFPBRC_BAD_LEN',
113 7: 'OFPBRC_BUFFER_EMPTY',
114 8: 'OFPBRC_BUFFER_UNKNOWN',
115}
116
117# Identifiers from group ofp_capabilities
118OFPC_FLOW_STATS = 1 << 0
119OFPC_TABLE_STATS = 1 << 1
120OFPC_PORT_STATS = 1 << 2
121OFPC_STP = 1 << 3
122OFPC_RESERVED = 1 << 4
123OFPC_IP_REASM = 1 << 5
124OFPC_QUEUE_STATS = 1 << 6
125OFPC_ARP_MATCH_IP = 1 << 7
126
127ofp_capabilities_map = {
128 1 << 0: 'OFPC_FLOW_STATS',
129 1 << 1: 'OFPC_TABLE_STATS',
130 1 << 2: 'OFPC_PORT_STATS',
131 1 << 3: 'OFPC_STP',
132 1 << 4: 'OFPC_RESERVED',
133 1 << 5: 'OFPC_IP_REASM',
134 1 << 6: 'OFPC_QUEUE_STATS',
135 1 << 7: 'OFPC_ARP_MATCH_IP',
136}
137
138# Identifiers from group ofp_config_flags
139OFPC_FRAG_NORMAL = 0
140OFPC_FRAG_DROP = 1
141OFPC_FRAG_REASM = 2
142OFPC_FRAG_MASK = 3
143
144ofp_config_flags_map = {
145 0: 'OFPC_FRAG_NORMAL',
146 1: 'OFPC_FRAG_DROP',
147 2: 'OFPC_FRAG_REASM',
148 3: 'OFPC_FRAG_MASK',
149}
150
151# Identifiers from group ofp_error_type
152OFPET_HELLO_FAILED = 0
153OFPET_BAD_REQUEST = 1
154OFPET_BAD_ACTION = 2
155OFPET_FLOW_MOD_FAILED = 3
156OFPET_PORT_MOD_FAILED = 4
157OFPET_QUEUE_OP_FAILED = 5
158
159ofp_error_type_map = {
160 0: 'OFPET_HELLO_FAILED',
161 1: 'OFPET_BAD_REQUEST',
162 2: 'OFPET_BAD_ACTION',
163 3: 'OFPET_FLOW_MOD_FAILED',
164 4: 'OFPET_PORT_MOD_FAILED',
165 5: 'OFPET_QUEUE_OP_FAILED',
166}
167
168# Identifiers from group ofp_flow_mod_command
169OFPFC_ADD = 0
170OFPFC_MODIFY = 1
171OFPFC_MODIFY_STRICT = 2
172OFPFC_DELETE = 3
173OFPFC_DELETE_STRICT = 4
174
175ofp_flow_mod_command_map = {
176 0: 'OFPFC_ADD',
177 1: 'OFPFC_MODIFY',
178 2: 'OFPFC_MODIFY_STRICT',
179 3: 'OFPFC_DELETE',
180 4: 'OFPFC_DELETE_STRICT',
181}
182
183# Identifiers from group ofp_flow_mod_failed_code
184OFPFMFC_ALL_TABLES_FULL = 0
185OFPFMFC_OVERLAP = 1
186OFPFMFC_EPERM = 2
187OFPFMFC_BAD_EMERG_TIMEOUT = 3
188OFPFMFC_BAD_COMMAND = 4
189OFPFMFC_UNSUPPORTED = 5
190
191ofp_flow_mod_failed_code_map = {
192 0: 'OFPFMFC_ALL_TABLES_FULL',
193 1: 'OFPFMFC_OVERLAP',
194 2: 'OFPFMFC_EPERM',
195 3: 'OFPFMFC_BAD_EMERG_TIMEOUT',
196 4: 'OFPFMFC_BAD_COMMAND',
197 5: 'OFPFMFC_UNSUPPORTED',
198}
199
200# Identifiers from group ofp_flow_mod_flags
201OFPFF_SEND_FLOW_REM = 1 << 0
202OFPFF_CHECK_OVERLAP = 1 << 1
203OFPFF_EMERG = 1 << 2
204
205ofp_flow_mod_flags_map = {
206 1 << 0: 'OFPFF_SEND_FLOW_REM',
207 1 << 1: 'OFPFF_CHECK_OVERLAP',
208 1 << 2: 'OFPFF_EMERG',
209}
210
211# Identifiers from group ofp_flow_removed_reason
212OFPRR_IDLE_TIMEOUT = 0
213OFPRR_HARD_TIMEOUT = 1
214OFPRR_DELETE = 2
215
216ofp_flow_removed_reason_map = {
217 0: 'OFPRR_IDLE_TIMEOUT',
218 1: 'OFPRR_HARD_TIMEOUT',
219 2: 'OFPRR_DELETE',
220}
221
222# Identifiers from group ofp_flow_wildcards
223OFPFW_IN_PORT = 1 << 0
224OFPFW_DL_VLAN = 1 << 1
225OFPFW_DL_SRC = 1 << 2
226OFPFW_NW_DST_BITS = 6
227OFPFW_NW_SRC_BITS = 6
228OFPFW_NW_SRC_SHIFT = 8
229OFPFW_DL_DST = 1 << 3
230OFPFW_NW_DST_SHIFT = 14
231OFPFW_DL_TYPE = 1 << 4
232OFPFW_NW_PROTO = 1 << 5
233OFPFW_TP_SRC = 1 << 6
234OFPFW_TP_DST = 1 << 7
235OFPFW_NW_SRC_ALL = 32 << (8)
236OFPFW_NW_SRC_MASK = ((1 << (6)) - 1) << (8)
237OFPFW_NW_DST_ALL = 32 << (14)
238OFPFW_NW_DST_MASK = ((1 << (6)) - 1) << (14)
239OFPFW_DL_VLAN_PCP = 1 << 20
240OFPFW_NW_TOS = 1 << 21
241OFPFW_ALL = ((1 << 22) - 1)
242
243ofp_flow_wildcards_map = {
244 1 << 0: 'OFPFW_IN_PORT',
245 1 << 1: 'OFPFW_DL_VLAN',
246 1 << 2: 'OFPFW_DL_SRC',
247 1 << 3: 'OFPFW_DL_DST',
248 1 << 4: 'OFPFW_DL_TYPE',
249 1 << 5: 'OFPFW_NW_PROTO',
250 1 << 6: 'OFPFW_TP_SRC',
251 1 << 7: 'OFPFW_TP_DST',
252 1 << 20: 'OFPFW_DL_VLAN_PCP',
253 1 << 21: 'OFPFW_NW_TOS',
254}
255
256# Identifiers from group ofp_hello_failed_code
257OFPHFC_INCOMPATIBLE = 0
258OFPHFC_EPERM = 1
259
260ofp_hello_failed_code_map = {
261 0: 'OFPHFC_INCOMPATIBLE',
262 1: 'OFPHFC_EPERM',
263}
264
265# 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
298OFPPC_PORT_DOWN = 1 << 0
299OFPPC_NO_STP = 1 << 1
300OFPPC_NO_RECV = 1 << 2
301OFPPC_NO_RECV_STP = 1 << 3
302OFPPC_NO_FLOOD = 1 << 4
303OFPPC_NO_FWD = 1 << 5
304OFPPC_NO_PACKET_IN = 1 << 6
305
306ofp_port_config_map = {
307 1 << 0: 'OFPPC_PORT_DOWN',
308 1 << 1: 'OFPPC_NO_STP',
309 1 << 2: 'OFPPC_NO_RECV',
310 1 << 3: 'OFPPC_NO_RECV_STP',
311 1 << 4: 'OFPPC_NO_FLOOD',
312 1 << 5: 'OFPPC_NO_FWD',
313 1 << 6: 'OFPPC_NO_PACKET_IN',
314}
315
316# Identifiers from group ofp_port_features
317OFPPF_10MB_HD = 1 << 0
318OFPPF_10MB_FD = 1 << 1
319OFPPF_100MB_HD = 1 << 2
320OFPPF_100MB_FD = 1 << 3
321OFPPF_1GB_HD = 1 << 4
322OFPPF_1GB_FD = 1 << 5
323OFPPF_10GB_FD = 1 << 6
324OFPPF_COPPER = 1 << 7
325OFPPF_FIBER = 1 << 8
326OFPPF_AUTONEG = 1 << 9
327OFPPF_PAUSE = 1 << 10
328OFPPF_PAUSE_ASYM = 1 << 11
329
330ofp_port_features_map = {
331 1 << 0: 'OFPPF_10MB_HD',
332 1 << 1: 'OFPPF_10MB_FD',
333 1 << 2: 'OFPPF_100MB_HD',
334 1 << 3: 'OFPPF_100MB_FD',
335 1 << 4: 'OFPPF_1GB_HD',
336 1 << 5: 'OFPPF_1GB_FD',
337 1 << 6: 'OFPPF_10GB_FD',
338 1 << 7: 'OFPPF_COPPER',
339 1 << 8: 'OFPPF_FIBER',
340 1 << 9: 'OFPPF_AUTONEG',
341 1 << 10: 'OFPPF_PAUSE',
342 1 << 11: 'OFPPF_PAUSE_ASYM',
343}
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
366OFPPS_STP_LISTEN = 0 << 8
367OFPPS_LINK_DOWN = 1 << 0
368OFPPS_STP_LEARN = 1 << 8
369OFPPS_STP_FORWARD = 2 << 8
370OFPPS_STP_BLOCK = 3 << 8
371OFPPS_STP_MASK = 3 << 8
372
373ofp_port_state_map = {
374 0 << 8: 'OFPPS_STP_LISTEN',
375 1 << 0: 'OFPPS_LINK_DOWN',
376 1 << 8: 'OFPPS_STP_LEARN',
377 2 << 8: 'OFPPS_STP_FORWARD',
378 3 << 8: 'OFPPS_STP_BLOCK',
379 3 << 8: 'OFPPS_STP_MASK',
380}
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
403OFPSF_REPLY_MORE = 1 << 0
404
405ofp_stats_reply_flags_map = {
406 1 << 0: 'OFPSF_REPLY_MORE',
407}
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
416OFPST_VENDOR = 0xffff
417
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',
425 0xffff: 'OFPST_VENDOR',
426}
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