blob: 01404ee69b533a7c83c3094afe93aebbf8424737 [file] [log] [blame]
Zack Williams9731cdc2019-11-22 15:42:30 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
15# Copyright (c) 2011, 2012 Open Networking Foundation
16# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
17# See the file LICENSE.pyloxi which should have been included in the source distribution
18
19# Automatically generated by LOXI from template const.py
20# Do not modify
21
22OFP_VERSION = 1
23
24# Identifiers from group macro_definitions
25OFP_MAX_TABLE_NAME_LEN = 32
26OFP_MAX_PORT_NAME_LEN = 16
27OFP_TCP_PORT = 6653
28OFP_SSL_PORT = 6653
29OFP_ETH_ALEN = 6
30OFP_DEFAULT_MISS_SEND_LEN = 128
31OFP_VLAN_NONE = 65535
32OFPFW_ICMP_TYPE = 64
33OFPFW_ICMP_CODE = 128
34OFP_DL_TYPE_ETH2_CUTOFF = 1536
35OFP_DL_TYPE_NOT_ETH_TYPE = 1535
36OFP_FLOW_PERMANENT = 0
37OFP_DEFAULT_PRIORITY = 32768
38DESC_STR_LEN = 256
39SERIAL_NUM_LEN = 32
40OFPQ_ALL = 4294967295
41OFPQ_MIN_RATE_UNCFG = 65535
42
43# Identifiers from group of_bsn_pdu_slot_num
44BSN_PDU_SLOT_NUM_ANY = 255
45
46of_bsn_pdu_slot_num_map = {
47 255: 'BSN_PDU_SLOT_NUM_ANY',
48}
49
50# Identifiers from group ofp_action_type
51OFPAT_OUTPUT = 0
52OFPAT_SET_VLAN_VID = 1
53OFPAT_SET_VLAN_PCP = 2
54OFPAT_STRIP_VLAN = 3
55OFPAT_SET_DL_SRC = 4
56OFPAT_SET_DL_DST = 5
57OFPAT_SET_NW_SRC = 6
58OFPAT_SET_NW_DST = 7
59OFPAT_SET_NW_TOS = 8
60OFPAT_SET_TP_SRC = 9
61OFPAT_SET_TP_DST = 10
62OFPAT_ENQUEUE = 11
63OFPAT_EXPERIMENTER = 65535
64
65ofp_action_type_map = {
66 0: 'OFPAT_OUTPUT',
67 1: 'OFPAT_SET_VLAN_VID',
68 2: 'OFPAT_SET_VLAN_PCP',
69 3: 'OFPAT_STRIP_VLAN',
70 4: 'OFPAT_SET_DL_SRC',
71 5: 'OFPAT_SET_DL_DST',
72 6: 'OFPAT_SET_NW_SRC',
73 7: 'OFPAT_SET_NW_DST',
74 8: 'OFPAT_SET_NW_TOS',
75 9: 'OFPAT_SET_TP_SRC',
76 10: 'OFPAT_SET_TP_DST',
77 11: 'OFPAT_ENQUEUE',
78 65535: 'OFPAT_EXPERIMENTER',
79}
80
81# Identifiers from group ofp_bad_action_code
82OFPBAC_BAD_TYPE = 0
83OFPBAC_BAD_LEN = 1
84OFPBAC_BAD_EXPERIMENTER = 2
85OFPBAC_BAD_EXPERIMENTER_TYPE = 3
86OFPBAC_BAD_OUT_PORT = 4
87OFPBAC_BAD_ARGUMENT = 5
88OFPBAC_EPERM = 6
89OFPBAC_TOO_MANY = 7
90OFPBAC_BAD_QUEUE = 8
91
92ofp_bad_action_code_map = {
93 0: 'OFPBAC_BAD_TYPE',
94 1: 'OFPBAC_BAD_LEN',
95 2: 'OFPBAC_BAD_EXPERIMENTER',
96 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
97 4: 'OFPBAC_BAD_OUT_PORT',
98 5: 'OFPBAC_BAD_ARGUMENT',
99 6: 'OFPBAC_EPERM',
100 7: 'OFPBAC_TOO_MANY',
101 8: 'OFPBAC_BAD_QUEUE',
102}
103
104# Identifiers from group ofp_bad_request_code
105OFPBRC_BAD_VERSION = 0
106OFPBRC_BAD_TYPE = 1
107OFPBRC_BAD_STAT = 2
108OFPBRC_BAD_EXPERIMENTER = 3
109OFPBRC_BAD_SUBTYPE = 4
110OFPBRC_EPERM = 5
111OFPBRC_BAD_LEN = 6
112OFPBRC_BUFFER_EMPTY = 7
113OFPBRC_BUFFER_UNKNOWN = 8
114
115ofp_bad_request_code_map = {
116 0: 'OFPBRC_BAD_VERSION',
117 1: 'OFPBRC_BAD_TYPE',
118 2: 'OFPBRC_BAD_STAT',
119 3: 'OFPBRC_BAD_EXPERIMENTER',
120 4: 'OFPBRC_BAD_SUBTYPE',
121 5: 'OFPBRC_EPERM',
122 6: 'OFPBRC_BAD_LEN',
123 7: 'OFPBRC_BUFFER_EMPTY',
124 8: 'OFPBRC_BUFFER_UNKNOWN',
125}
126
127# Identifiers from group ofp_bsn_vport_l2gre_flags
128OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
129OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
130OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
131OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
132OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
133
134ofp_bsn_vport_l2gre_flags_map = {
135 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
136 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
137 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
138 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
139 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
140}
141
142# Identifiers from group ofp_bsn_vport_q_in_q_untagged
143OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
144
145ofp_bsn_vport_q_in_q_untagged_map = {
146 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
147}
148
149# Identifiers from group ofp_bsn_vport_status
150OF_BSN_VPORT_STATUS_OK = 0
151OF_BSN_VPORT_STATUS_FAILED = 1
152
153ofp_bsn_vport_status_map = {
154 0: 'OF_BSN_VPORT_STATUS_OK',
155 1: 'OF_BSN_VPORT_STATUS_FAILED',
156}
157
158# Identifiers from group ofp_capabilities
159OFPC_FLOW_STATS = 1
160OFPC_TABLE_STATS = 2
161OFPC_PORT_STATS = 4
162OFPC_STP = 8
163OFPC_RESERVED = 16
164OFPC_IP_REASM = 32
165OFPC_QUEUE_STATS = 64
166OFPC_ARP_MATCH_IP = 128
167
168ofp_capabilities_map = {
169 1: 'OFPC_FLOW_STATS',
170 2: 'OFPC_TABLE_STATS',
171 4: 'OFPC_PORT_STATS',
172 8: 'OFPC_STP',
173 16: 'OFPC_RESERVED',
174 32: 'OFPC_IP_REASM',
175 64: 'OFPC_QUEUE_STATS',
176 128: 'OFPC_ARP_MATCH_IP',
177}
178
179# Identifiers from group ofp_config_flags
180OFPC_FRAG_NORMAL = 0
181OFPC_FRAG_DROP = 1
182OFPC_FRAG_REASM = 2
183OFPC_FRAG_MASK = 3
184
185ofp_config_flags_map = {
186 0: 'OFPC_FRAG_NORMAL',
187 1: 'OFPC_FRAG_DROP',
188 2: 'OFPC_FRAG_REASM',
189 3: 'OFPC_FRAG_MASK',
190}
191
192# Identifiers from group ofp_error_type
193OFPET_HELLO_FAILED = 0
194OFPET_BAD_REQUEST = 1
195OFPET_BAD_ACTION = 2
196OFPET_FLOW_MOD_FAILED = 3
197OFPET_PORT_MOD_FAILED = 4
198OFPET_QUEUE_OP_FAILED = 5
199
200ofp_error_type_map = {
201 0: 'OFPET_HELLO_FAILED',
202 1: 'OFPET_BAD_REQUEST',
203 2: 'OFPET_BAD_ACTION',
204 3: 'OFPET_FLOW_MOD_FAILED',
205 4: 'OFPET_PORT_MOD_FAILED',
206 5: 'OFPET_QUEUE_OP_FAILED',
207}
208
209# Identifiers from group ofp_flow_mod_command
210OFPFC_ADD = 0
211OFPFC_MODIFY = 1
212OFPFC_MODIFY_STRICT = 2
213OFPFC_DELETE = 3
214OFPFC_DELETE_STRICT = 4
215
216ofp_flow_mod_command_map = {
217 0: 'OFPFC_ADD',
218 1: 'OFPFC_MODIFY',
219 2: 'OFPFC_MODIFY_STRICT',
220 3: 'OFPFC_DELETE',
221 4: 'OFPFC_DELETE_STRICT',
222}
223
224# Identifiers from group ofp_flow_mod_failed_code
225OFPFMFC_ALL_TABLES_FULL = 0
226OFPFMFC_OVERLAP = 1
227OFPFMFC_EPERM = 2
228OFPFMFC_BAD_EMERG_TIMEOUT = 3
229OFPFMFC_BAD_COMMAND = 4
230OFPFMFC_UNSUPPORTED = 5
231
232ofp_flow_mod_failed_code_map = {
233 0: 'OFPFMFC_ALL_TABLES_FULL',
234 1: 'OFPFMFC_OVERLAP',
235 2: 'OFPFMFC_EPERM',
236 3: 'OFPFMFC_BAD_EMERG_TIMEOUT',
237 4: 'OFPFMFC_BAD_COMMAND',
238 5: 'OFPFMFC_UNSUPPORTED',
239}
240
241# Identifiers from group ofp_flow_mod_flags
242OFPFF_SEND_FLOW_REM = 1
243OFPFF_CHECK_OVERLAP = 2
244OFPFF_EMERG = 4
245
246ofp_flow_mod_flags_map = {
247 1: 'OFPFF_SEND_FLOW_REM',
248 2: 'OFPFF_CHECK_OVERLAP',
249 4: 'OFPFF_EMERG',
250}
251
252# Identifiers from group ofp_flow_removed_reason
253OFPRR_IDLE_TIMEOUT = 0
254OFPRR_HARD_TIMEOUT = 1
255OFPRR_DELETE = 2
256
257ofp_flow_removed_reason_map = {
258 0: 'OFPRR_IDLE_TIMEOUT',
259 1: 'OFPRR_HARD_TIMEOUT',
260 2: 'OFPRR_DELETE',
261}
262
263# Identifiers from group ofp_flow_wildcards
264OFPFW_IN_PORT = 1
265OFPFW_DL_VLAN = 2
266OFPFW_DL_SRC = 4
267OFPFW_NW_DST_BITS = 6
268OFPFW_NW_SRC_BITS = 6
269OFPFW_NW_SRC_SHIFT = 8
270OFPFW_DL_DST = 8
271OFPFW_NW_DST_SHIFT = 14
272OFPFW_DL_TYPE = 16
273OFPFW_NW_PROTO = 32
274OFPFW_TP_SRC = 64
275OFPFW_TP_DST = 128
276OFPFW_NW_SRC_ALL = 8192
277OFPFW_NW_SRC_MASK = 16128
278OFPFW_NW_DST_ALL = 524288
279OFPFW_NW_DST_MASK = 1032192
280OFPFW_DL_VLAN_PCP = 1048576
281OFPFW_NW_TOS = 2097152
282OFPFW_ALL = 4194303
283
284ofp_flow_wildcards_map = {
285 1: 'OFPFW_IN_PORT',
286 2: 'OFPFW_DL_VLAN',
287 4: 'OFPFW_DL_SRC',
288 8: 'OFPFW_DL_DST',
289 16: 'OFPFW_DL_TYPE',
290 32: 'OFPFW_NW_PROTO',
291 64: 'OFPFW_TP_SRC',
292 128: 'OFPFW_TP_DST',
293 1048576: 'OFPFW_DL_VLAN_PCP',
294 2097152: 'OFPFW_NW_TOS',
295}
296
297# Identifiers from group ofp_hello_failed_code
298OFPHFC_INCOMPATIBLE = 0
299OFPHFC_EPERM = 1
300
301ofp_hello_failed_code_map = {
302 0: 'OFPHFC_INCOMPATIBLE',
303 1: 'OFPHFC_EPERM',
304}
305
306# Identifiers from group ofp_nicira_controller_role
307NX_ROLE_OTHER = 0
308NX_ROLE_MASTER = 1
309NX_ROLE_SLAVE = 2
310
311ofp_nicira_controller_role_map = {
312 0: 'NX_ROLE_OTHER',
313 1: 'NX_ROLE_MASTER',
314 2: 'NX_ROLE_SLAVE',
315}
316
317# Identifiers from group ofp_packet_in_reason
318OFPR_NO_MATCH = 0
319OFPR_ACTION = 1
320
321ofp_packet_in_reason_map = {
322 0: 'OFPR_NO_MATCH',
323 1: 'OFPR_ACTION',
324}
325
326# Identifiers from group ofp_port
327OFPP_MAX = 0xff00
328OFPP_IN_PORT = 0xfff8
329OFPP_TABLE = 0xfff9
330OFPP_NORMAL = 0xfffa
331OFPP_FLOOD = 0xfffb
332OFPP_ALL = 0xfffc
333OFPP_CONTROLLER = 0xfffd
334OFPP_LOCAL = 0xfffe
335OFPP_NONE = 0xffff
336
337ofp_port_map = {
338 0xff00: 'OFPP_MAX',
339 0xfff8: 'OFPP_IN_PORT',
340 0xfff9: 'OFPP_TABLE',
341 0xfffa: 'OFPP_NORMAL',
342 0xfffb: 'OFPP_FLOOD',
343 0xfffc: 'OFPP_ALL',
344 0xfffd: 'OFPP_CONTROLLER',
345 0xfffe: 'OFPP_LOCAL',
346 0xffff: 'OFPP_NONE',
347}
348
349# Identifiers from group ofp_port_config
350OFPPC_PORT_DOWN = 1
351OFPPC_NO_STP = 2
352OFPPC_NO_RECV = 4
353OFPPC_NO_RECV_STP = 8
354OFPPC_NO_FLOOD = 16
355OFPPC_NO_FWD = 32
356OFPPC_NO_PACKET_IN = 64
357OFPPC_BSN_MIRROR_DEST = 2147483648
358
359ofp_port_config_map = {
360 1: 'OFPPC_PORT_DOWN',
361 2: 'OFPPC_NO_STP',
362 4: 'OFPPC_NO_RECV',
363 8: 'OFPPC_NO_RECV_STP',
364 16: 'OFPPC_NO_FLOOD',
365 32: 'OFPPC_NO_FWD',
366 64: 'OFPPC_NO_PACKET_IN',
367 2147483648: 'OFPPC_BSN_MIRROR_DEST',
368}
369
370# Identifiers from group ofp_port_features
371OFPPF_10MB_HD = 1
372OFPPF_10MB_FD = 2
373OFPPF_100MB_HD = 4
374OFPPF_100MB_FD = 8
375OFPPF_1GB_HD = 16
376OFPPF_1GB_FD = 32
377OFPPF_10GB_FD = 64
378OFPPF_COPPER = 128
379OFPPF_FIBER = 256
380OFPPF_AUTONEG = 512
381OFPPF_PAUSE = 1024
382OFPPF_PAUSE_ASYM = 2048
383
384ofp_port_features_map = {
385 1: 'OFPPF_10MB_HD',
386 2: 'OFPPF_10MB_FD',
387 4: 'OFPPF_100MB_HD',
388 8: 'OFPPF_100MB_FD',
389 16: 'OFPPF_1GB_HD',
390 32: 'OFPPF_1GB_FD',
391 64: 'OFPPF_10GB_FD',
392 128: 'OFPPF_COPPER',
393 256: 'OFPPF_FIBER',
394 512: 'OFPPF_AUTONEG',
395 1024: 'OFPPF_PAUSE',
396 2048: 'OFPPF_PAUSE_ASYM',
397}
398
399# Identifiers from group ofp_port_mod_failed_code
400OFPPMFC_BAD_PORT = 0
401OFPPMFC_BAD_HW_ADDR = 1
402
403ofp_port_mod_failed_code_map = {
404 0: 'OFPPMFC_BAD_PORT',
405 1: 'OFPPMFC_BAD_HW_ADDR',
406}
407
408# Identifiers from group ofp_port_reason
409OFPPR_ADD = 0
410OFPPR_DELETE = 1
411OFPPR_MODIFY = 2
412
413ofp_port_reason_map = {
414 0: 'OFPPR_ADD',
415 1: 'OFPPR_DELETE',
416 2: 'OFPPR_MODIFY',
417}
418
419# Identifiers from group ofp_port_state
420OFPPS_LINK_DOWN = 1
421OFPPS_STP_LISTEN = 0
422OFPPS_STP_LEARN = 256
423OFPPS_STP_FORWARD = 512
424OFPPS_STP_BLOCK = 768
425OFPPS_STP_MASK = 768
426
427ofp_port_state_map = {
428 1: 'OFPPS_LINK_DOWN',
429 0: 'OFPPS_STP_LISTEN',
430 256: 'OFPPS_STP_LEARN',
431 512: 'OFPPS_STP_FORWARD',
432 768: 'OFPPS_STP_BLOCK',
433 768: 'OFPPS_STP_MASK',
434}
435
436# Identifiers from group ofp_queue_op_failed_code
437OFPQOFC_BAD_PORT = 0
438OFPQOFC_BAD_QUEUE = 1
439OFPQOFC_EPERM = 2
440
441ofp_queue_op_failed_code_map = {
442 0: 'OFPQOFC_BAD_PORT',
443 1: 'OFPQOFC_BAD_QUEUE',
444 2: 'OFPQOFC_EPERM',
445}
446
447# Identifiers from group ofp_queue_properties
448OFPQT_NONE = 0
449OFPQT_MIN_RATE = 1
450
451ofp_queue_properties_map = {
452 0: 'OFPQT_NONE',
453 1: 'OFPQT_MIN_RATE',
454}
455
456# Identifiers from group ofp_stats_reply_flags
457OFPSF_REPLY_MORE = 1
458
459ofp_stats_reply_flags_map = {
460 1: 'OFPSF_REPLY_MORE',
461}
462
463# Identifiers from group ofp_stats_request_flags
464
465ofp_stats_request_flags_map = {
466}
467
468# Identifiers from group ofp_stats_type
469OFPST_DESC = 0
470OFPST_FLOW = 1
471OFPST_AGGREGATE = 2
472OFPST_TABLE = 3
473OFPST_PORT = 4
474OFPST_QUEUE = 5
475OFPST_EXPERIMENTER = 65535
476
477ofp_stats_type_map = {
478 0: 'OFPST_DESC',
479 1: 'OFPST_FLOW',
480 2: 'OFPST_AGGREGATE',
481 3: 'OFPST_TABLE',
482 4: 'OFPST_PORT',
483 5: 'OFPST_QUEUE',
484 65535: 'OFPST_EXPERIMENTER',
485}
486
487# Identifiers from group ofp_type
488OFPT_HELLO = 0
489OFPT_ERROR = 1
490OFPT_ECHO_REQUEST = 2
491OFPT_ECHO_REPLY = 3
492OFPT_EXPERIMENTER = 4
493OFPT_FEATURES_REQUEST = 5
494OFPT_FEATURES_REPLY = 6
495OFPT_GET_CONFIG_REQUEST = 7
496OFPT_GET_CONFIG_REPLY = 8
497OFPT_SET_CONFIG = 9
498OFPT_PACKET_IN = 10
499OFPT_FLOW_REMOVED = 11
500OFPT_PORT_STATUS = 12
501OFPT_PACKET_OUT = 13
502OFPT_FLOW_MOD = 14
503OFPT_PORT_MOD = 15
504OFPT_STATS_REQUEST = 16
505OFPT_STATS_REPLY = 17
506OFPT_BARRIER_REQUEST = 18
507OFPT_BARRIER_REPLY = 19
508OFPT_QUEUE_GET_CONFIG_REQUEST = 20
509OFPT_QUEUE_GET_CONFIG_REPLY = 21
510
511ofp_type_map = {
512 0: 'OFPT_HELLO',
513 1: 'OFPT_ERROR',
514 2: 'OFPT_ECHO_REQUEST',
515 3: 'OFPT_ECHO_REPLY',
516 4: 'OFPT_EXPERIMENTER',
517 5: 'OFPT_FEATURES_REQUEST',
518 6: 'OFPT_FEATURES_REPLY',
519 7: 'OFPT_GET_CONFIG_REQUEST',
520 8: 'OFPT_GET_CONFIG_REPLY',
521 9: 'OFPT_SET_CONFIG',
522 10: 'OFPT_PACKET_IN',
523 11: 'OFPT_FLOW_REMOVED',
524 12: 'OFPT_PORT_STATUS',
525 13: 'OFPT_PACKET_OUT',
526 14: 'OFPT_FLOW_MOD',
527 15: 'OFPT_PORT_MOD',
528 16: 'OFPT_STATS_REQUEST',
529 17: 'OFPT_STATS_REPLY',
530 18: 'OFPT_BARRIER_REQUEST',
531 19: 'OFPT_BARRIER_REPLY',
532 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
533 21: 'OFPT_QUEUE_GET_CONFIG_REPLY',
534}
535