blob: 8b2ad1e0fa46bf121d76dbd667d0d3a64008b7f1 [file] [log] [blame]
Rich Lane2e079da2014-10-29 15:30:24 -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.
4# See the file LICENSE.pyloxi which should have been included in the source distribution
5
6# Automatically generated by LOXI from template const.py
7# Do not modify
8
9OFP_VERSION = 5
10
11# Identifiers from group macro_definitions
12OFP_MAX_TABLE_NAME_LEN = 32
13OFP_MAX_PORT_NAME_LEN = 16
14OFP_TCP_PORT = 6653
15OFP_SSL_PORT = 6653
16OFP_ETH_ALEN = 6
17OFP_DEFAULT_MISS_SEND_LEN = 128
18OFP_VLAN_NONE = 0
19OFP_FLOW_PERMANENT = 0
20OFP_DEFAULT_PRIORITY = 32768
21OFP_NO_BUFFER = 4294967295
22DESC_STR_LEN = 256
23SERIAL_NUM_LEN = 32
24OFPQ_ALL = 4294967295
25OFPQ_MAX_RATE_UNCFG = 65535
26OFPQ_MIN_RATE_UNCFG = 65535
27
Rich Laneccd32ed2014-11-10 17:48:24 -080028# Identifiers from group of_bsn_lacp_convergence_status
29LACP_SUCCESS = 0
30LACP_TIMEDOUT = 1
31LACP_OUT_OF_SYNC = 2
32
33of_bsn_lacp_convergence_status_map = {
34 0: 'LACP_SUCCESS',
35 1: 'LACP_TIMEDOUT',
36 2: 'LACP_OUT_OF_SYNC',
37}
38
Rich Lane2e079da2014-10-29 15:30:24 -070039# Identifiers from group of_bsn_pdu_slot_num
40BSN_PDU_SLOT_NUM_ANY = 255
41
42of_bsn_pdu_slot_num_map = {
43 255: 'BSN_PDU_SLOT_NUM_ANY',
44}
45
Rich Laneccd32ed2014-11-10 17:48:24 -080046# Identifiers from group of_bsn_vlan_counter
47OFP_BSN_VLAN_COUNTER_RX_BYTES = 0
48OFP_BSN_VLAN_COUNTER_RX_PACKETS = 1
49OFP_BSN_VLAN_COUNTER_TX_BYTES = 2
50OFP_BSN_VLAN_COUNTER_TX_PACKETS = 3
51
52of_bsn_vlan_counter_map = {
53 0: 'OFP_BSN_VLAN_COUNTER_RX_BYTES',
54 1: 'OFP_BSN_VLAN_COUNTER_RX_PACKETS',
55 2: 'OFP_BSN_VLAN_COUNTER_TX_BYTES',
56 3: 'OFP_BSN_VLAN_COUNTER_TX_PACKETS',
57}
58
59# Identifiers from group of_bsn_vrf_counter
60OFP_BSN_VRF_COUNTER_BYTES = 0
61OFP_BSN_VRF_COUNTER_PACKETS = 1
62
63of_bsn_vrf_counter_map = {
64 0: 'OFP_BSN_VRF_COUNTER_BYTES',
65 1: 'OFP_BSN_VRF_COUNTER_PACKETS',
66}
67
Rich Lane2e079da2014-10-29 15:30:24 -070068# Identifiers from group ofp_action_type
69OFPAT_OUTPUT = 0
70OFPAT_COPY_TTL_OUT = 11
71OFPAT_COPY_TTL_IN = 12
72OFPAT_SET_MPLS_TTL = 15
73OFPAT_DEC_MPLS_TTL = 16
74OFPAT_PUSH_VLAN = 17
75OFPAT_POP_VLAN = 18
76OFPAT_PUSH_MPLS = 19
77OFPAT_POP_MPLS = 20
78OFPAT_SET_QUEUE = 21
79OFPAT_GROUP = 22
80OFPAT_SET_NW_TTL = 23
81OFPAT_DEC_NW_TTL = 24
82OFPAT_SET_FIELD = 25
83OFPAT_PUSH_PBB = 26
84OFPAT_POP_PBB = 27
85OFPAT_EXPERIMENTER = 65535
86
87ofp_action_type_map = {
88 0: 'OFPAT_OUTPUT',
89 11: 'OFPAT_COPY_TTL_OUT',
90 12: 'OFPAT_COPY_TTL_IN',
91 15: 'OFPAT_SET_MPLS_TTL',
92 16: 'OFPAT_DEC_MPLS_TTL',
93 17: 'OFPAT_PUSH_VLAN',
94 18: 'OFPAT_POP_VLAN',
95 19: 'OFPAT_PUSH_MPLS',
96 20: 'OFPAT_POP_MPLS',
97 21: 'OFPAT_SET_QUEUE',
98 22: 'OFPAT_GROUP',
99 23: 'OFPAT_SET_NW_TTL',
100 24: 'OFPAT_DEC_NW_TTL',
101 25: 'OFPAT_SET_FIELD',
102 26: 'OFPAT_PUSH_PBB',
103 27: 'OFPAT_POP_PBB',
104 65535: 'OFPAT_EXPERIMENTER',
105}
106
107# Identifiers from group ofp_async_config_failed_code
108OFPACFC_INVALID = 0
109OFPACFC_UNSUPPORTED = 1
110OFPACFC_EPERM = 2
111
112ofp_async_config_failed_code_map = {
113 0: 'OFPACFC_INVALID',
114 1: 'OFPACFC_UNSUPPORTED',
115 2: 'OFPACFC_EPERM',
116}
117
118# Identifiers from group ofp_bad_action_code
119OFPBAC_BAD_TYPE = 0
120OFPBAC_BAD_LEN = 1
121OFPBAC_BAD_EXPERIMENTER = 2
122OFPBAC_BAD_EXPERIMENTER_TYPE = 3
123OFPBAC_BAD_OUT_PORT = 4
124OFPBAC_BAD_ARGUMENT = 5
125OFPBAC_EPERM = 6
126OFPBAC_TOO_MANY = 7
127OFPBAC_BAD_QUEUE = 8
128OFPBAC_BAD_OUT_GROUP = 9
129OFPBAC_MATCH_INCONSISTENT = 10
130OFPBAC_UNSUPPORTED_ORDER = 11
131OFPBAC_BAD_TAG = 12
132OFPBAC_BAD_SET_TYPE = 13
133OFPBAC_BAD_SET_LEN = 14
134OFPBAC_BAD_SET_ARGUMENT = 15
135
136ofp_bad_action_code_map = {
137 0: 'OFPBAC_BAD_TYPE',
138 1: 'OFPBAC_BAD_LEN',
139 2: 'OFPBAC_BAD_EXPERIMENTER',
140 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
141 4: 'OFPBAC_BAD_OUT_PORT',
142 5: 'OFPBAC_BAD_ARGUMENT',
143 6: 'OFPBAC_EPERM',
144 7: 'OFPBAC_TOO_MANY',
145 8: 'OFPBAC_BAD_QUEUE',
146 9: 'OFPBAC_BAD_OUT_GROUP',
147 10: 'OFPBAC_MATCH_INCONSISTENT',
148 11: 'OFPBAC_UNSUPPORTED_ORDER',
149 12: 'OFPBAC_BAD_TAG',
150 13: 'OFPBAC_BAD_SET_TYPE',
151 14: 'OFPBAC_BAD_SET_LEN',
152 15: 'OFPBAC_BAD_SET_ARGUMENT',
153}
154
155# Identifiers from group ofp_bad_instruction_code
156OFPBIC_UNKNOWN_INST = 0
157OFPBIC_UNSUP_INST = 1
158OFPBIC_BAD_TABLE_ID = 2
159OFPBIC_UNSUP_METADATA = 3
160OFPBIC_UNSUP_METADATA_MASK = 4
161OFPBIC_BAD_EXPERIMENTER = 5
162OFPBIC_BAD_EXPERIMENTER_TYPE = 6
163OFPBIC_BAD_LEN = 7
164OFPBIC_EPERM = 8
165OFPBIC_DUP_INST = 9
166
167ofp_bad_instruction_code_map = {
168 0: 'OFPBIC_UNKNOWN_INST',
169 1: 'OFPBIC_UNSUP_INST',
170 2: 'OFPBIC_BAD_TABLE_ID',
171 3: 'OFPBIC_UNSUP_METADATA',
172 4: 'OFPBIC_UNSUP_METADATA_MASK',
173 5: 'OFPBIC_BAD_EXPERIMENTER',
174 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
175 7: 'OFPBIC_BAD_LEN',
176 8: 'OFPBIC_EPERM',
177 9: 'OFPBIC_DUP_INST',
178}
179
180# Identifiers from group ofp_bad_match_code
181OFPBMC_BAD_TYPE = 0
182OFPBMC_BAD_LEN = 1
183OFPBMC_BAD_TAG = 2
184OFPBMC_BAD_DL_ADDR_MASK = 3
185OFPBMC_BAD_NW_ADDR_MASK = 4
186OFPBMC_BAD_WILDCARDS = 5
187OFPBMC_BAD_FIELD = 6
188OFPBMC_BAD_VALUE = 7
189OFPBMC_BAD_MASK = 8
190OFPBMC_BAD_PREREQ = 9
191OFPBMC_DUP_FIELD = 10
192OFPBMC_EPERM = 11
193
194ofp_bad_match_code_map = {
195 0: 'OFPBMC_BAD_TYPE',
196 1: 'OFPBMC_BAD_LEN',
197 2: 'OFPBMC_BAD_TAG',
198 3: 'OFPBMC_BAD_DL_ADDR_MASK',
199 4: 'OFPBMC_BAD_NW_ADDR_MASK',
200 5: 'OFPBMC_BAD_WILDCARDS',
201 6: 'OFPBMC_BAD_FIELD',
202 7: 'OFPBMC_BAD_VALUE',
203 8: 'OFPBMC_BAD_MASK',
204 9: 'OFPBMC_BAD_PREREQ',
205 10: 'OFPBMC_DUP_FIELD',
206 11: 'OFPBMC_EPERM',
207}
208
209# Identifiers from group ofp_bad_property_code
210OFPBPC_BAD_TYPE = 0
211OFPBPC_BAD_LEN = 1
212OFPBPC_BAD_VALUE = 2
213OFPBPC_TOO_MANY = 3
214OFPBPC_DUP_TYPE = 4
215OFPBPC_BAD_EXPERIMENTER = 5
216OFPBPC_BAD_EXP_TYPE = 6
217OFPBPC_BAD_EXP_VALUE = 7
218OFPBPC_EPERM = 8
219
220ofp_bad_property_code_map = {
221 0: 'OFPBPC_BAD_TYPE',
222 1: 'OFPBPC_BAD_LEN',
223 2: 'OFPBPC_BAD_VALUE',
224 3: 'OFPBPC_TOO_MANY',
225 4: 'OFPBPC_DUP_TYPE',
226 5: 'OFPBPC_BAD_EXPERIMENTER',
227 6: 'OFPBPC_BAD_EXP_TYPE',
228 7: 'OFPBPC_BAD_EXP_VALUE',
229 8: 'OFPBPC_EPERM',
230}
231
232# Identifiers from group ofp_bad_request_code
233OFPBRC_BAD_VERSION = 0
234OFPBRC_BAD_TYPE = 1
235OFPBRC_BAD_STAT = 2
236OFPBRC_BAD_EXPERIMENTER = 3
237OFPBRC_BAD_EXPERIMENTER_TYPE = 4
238OFPBRC_EPERM = 5
239OFPBRC_BAD_LEN = 6
240OFPBRC_BUFFER_EMPTY = 7
241OFPBRC_BUFFER_UNKNOWN = 8
242OFPBRC_BAD_TABLE_ID = 9
243OFPBRC_IS_SLAVE = 10
244OFPBRC_BAD_PORT = 11
245OFPBRC_BAD_PACKET = 12
246OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13
247OFPBRC_MULTIPART_REQUEST_TIMEOUT = 14
248OFPBRC_MULTIPART_REPLY_TIMEOUT = 15
249
250ofp_bad_request_code_map = {
251 0: 'OFPBRC_BAD_VERSION',
252 1: 'OFPBRC_BAD_TYPE',
253 2: 'OFPBRC_BAD_STAT',
254 3: 'OFPBRC_BAD_EXPERIMENTER',
255 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
256 5: 'OFPBRC_EPERM',
257 6: 'OFPBRC_BAD_LEN',
258 7: 'OFPBRC_BUFFER_EMPTY',
259 8: 'OFPBRC_BUFFER_UNKNOWN',
260 9: 'OFPBRC_BAD_TABLE_ID',
261 10: 'OFPBRC_IS_SLAVE',
262 11: 'OFPBRC_BAD_PORT',
263 12: 'OFPBRC_BAD_PACKET',
264 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
265 14: 'OFPBRC_MULTIPART_REQUEST_TIMEOUT',
266 15: 'OFPBRC_MULTIPART_REPLY_TIMEOUT',
267}
268
Rich Laneccd32ed2014-11-10 17:48:24 -0800269# Identifiers from group ofp_bsn_controller_connection_state
270OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED = 0
271OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED = 1
272
273ofp_bsn_controller_connection_state_map = {
274 0: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED',
275 1: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED',
276}
277
278# Identifiers from group ofp_bsn_lacp_state
279OFP_BSN_LACP_STATE_ACTIVITY = 1
280OFP_BSN_LACP_STATE_TIMEOUT = 2
281OFP_BSN_LACP_STATE_AGGREGATION = 4
282OFP_BSN_LACP_STATE_SYNCHRONIZATION = 8
283OFP_BSN_LACP_STATE_COLLECTING = 16
284OFP_BSN_LACP_STATE_DISTRIBUTING = 32
285OFP_BSN_LACP_STATE_DEFAULTED = 64
286OFP_BSN_LACP_STATE_EXPIRED = 128
287
288ofp_bsn_lacp_state_map = {
289 1: 'OFP_BSN_LACP_STATE_ACTIVITY',
290 2: 'OFP_BSN_LACP_STATE_TIMEOUT',
291 4: 'OFP_BSN_LACP_STATE_AGGREGATION',
292 8: 'OFP_BSN_LACP_STATE_SYNCHRONIZATION',
293 16: 'OFP_BSN_LACP_STATE_COLLECTING',
294 32: 'OFP_BSN_LACP_STATE_DISTRIBUTING',
295 64: 'OFP_BSN_LACP_STATE_DEFAULTED',
296 128: 'OFP_BSN_LACP_STATE_EXPIRED',
297}
298
299# Identifiers from group ofp_bsn_loglevel
300OFP_BSN_LOGLEVEL_MSG = 0
301OFP_BSN_LOGLEVEL_ERROR = 1
302OFP_BSN_LOGLEVEL_WARN = 2
303OFP_BSN_LOGLEVEL_INFO = 3
304OFP_BSN_LOGLEVEL_VERBOSE = 4
305OFP_BSN_LOGLEVEL_TRACE = 5
306
307ofp_bsn_loglevel_map = {
308 0: 'OFP_BSN_LOGLEVEL_MSG',
309 1: 'OFP_BSN_LOGLEVEL_ERROR',
310 2: 'OFP_BSN_LOGLEVEL_WARN',
311 3: 'OFP_BSN_LOGLEVEL_INFO',
312 4: 'OFP_BSN_LOGLEVEL_VERBOSE',
313 5: 'OFP_BSN_LOGLEVEL_TRACE',
314}
315
Rich Lane474324f2015-01-14 15:22:56 -0800316# Identifiers from group ofp_bsn_lua_upload_flags
317OFP_BSN_LUA_UPLOAD_MORE = 1
318OFP_BSN_LUA_UPLOAD_FORCE = 2
319
320ofp_bsn_lua_upload_flags_map = {
321 1: 'OFP_BSN_LUA_UPLOAD_MORE',
322 2: 'OFP_BSN_LUA_UPLOAD_FORCE',
323}
324
Rich Laneccd32ed2014-11-10 17:48:24 -0800325# Identifiers from group ofp_bsn_pktin_flag
326OFP_BSN_PKTIN_FLAG_PDU = 1
327OFP_BSN_PKTIN_FLAG_NEW_HOST = 2
328OFP_BSN_PKTIN_FLAG_STATION_MOVE = 4
329OFP_BSN_PKTIN_FLAG_ARP = 8
330OFP_BSN_PKTIN_FLAG_DHCP = 16
331OFP_BSN_PKTIN_FLAG_L2_CPU = 32
332OFP_BSN_PKTIN_FLAG_DEBUG = 64
333OFP_BSN_PKTIN_FLAG_TTL_EXPIRED = 128
334OFP_BSN_PKTIN_FLAG_L3_MISS = 256
335OFP_BSN_PKTIN_FLAG_L3_CPU = 512
336OFP_BSN_PKTIN_FLAG_INGRESS_ACL = 1024
337OFP_BSN_PKTIN_FLAG_SFLOW = 2048
Rich Lane2d1b40e2015-02-11 12:45:33 -0800338OFP_BSN_PKTIN_FLAG_ARP_CACHE = 4096
Rich Lane7b69e792015-03-31 11:12:50 -0700339OFP_BSN_PKTIN_FLAG_ARP_TARGET = 8192
Rich Laneccd32ed2014-11-10 17:48:24 -0800340
341ofp_bsn_pktin_flag_map = {
342 1: 'OFP_BSN_PKTIN_FLAG_PDU',
343 2: 'OFP_BSN_PKTIN_FLAG_NEW_HOST',
344 4: 'OFP_BSN_PKTIN_FLAG_STATION_MOVE',
345 8: 'OFP_BSN_PKTIN_FLAG_ARP',
346 16: 'OFP_BSN_PKTIN_FLAG_DHCP',
347 32: 'OFP_BSN_PKTIN_FLAG_L2_CPU',
348 64: 'OFP_BSN_PKTIN_FLAG_DEBUG',
349 128: 'OFP_BSN_PKTIN_FLAG_TTL_EXPIRED',
350 256: 'OFP_BSN_PKTIN_FLAG_L3_MISS',
351 512: 'OFP_BSN_PKTIN_FLAG_L3_CPU',
352 1024: 'OFP_BSN_PKTIN_FLAG_INGRESS_ACL',
353 2048: 'OFP_BSN_PKTIN_FLAG_SFLOW',
Rich Lane2d1b40e2015-02-11 12:45:33 -0800354 4096: 'OFP_BSN_PKTIN_FLAG_ARP_CACHE',
Rich Lane7b69e792015-03-31 11:12:50 -0700355 8192: 'OFP_BSN_PKTIN_FLAG_ARP_TARGET',
Rich Laneccd32ed2014-11-10 17:48:24 -0800356}
357
358# Identifiers from group ofp_bsn_port_counter
359OFP_BSN_PORT_COUNTER_RX_BYTES = 0
360OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST = 1
361OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST = 2
362OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST = 3
363OFP_BSN_PORT_COUNTER_RX_DROPPED = 4
364OFP_BSN_PORT_COUNTER_RX_ERRORS = 5
365OFP_BSN_PORT_COUNTER_TX_BYTES = 6
366OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST = 7
367OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST = 8
368OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST = 9
369OFP_BSN_PORT_COUNTER_TX_DROPPED = 10
370OFP_BSN_PORT_COUNTER_TX_ERRORS = 11
371OFP_BSN_PORT_COUNTER_RX_RUNTS = 12
372OFP_BSN_PORT_COUNTER_RX_GIANTS = 13
373OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS = 14
374OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS = 15
375OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS = 16
376OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT = 17
377OFP_BSN_PORT_COUNTER_TX_COLLISIONS = 18
378OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS = 19
379OFP_BSN_PORT_COUNTER_TX_DEFERRED = 20
380OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT = 21
381OFP_BSN_PORT_COUNTER_RX_PACKETS = 22
382OFP_BSN_PORT_COUNTER_TX_PACKETS = 23
383OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS = 24
384OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS = 25
385OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS = 26
Rich Lane51168312015-06-25 13:13:54 -0700386OFP_BSN_PORT_COUNTER_RX_PACKETS_BAD_VLAN = 27
Rich Laneccd32ed2014-11-10 17:48:24 -0800387
388ofp_bsn_port_counter_map = {
389 0: 'OFP_BSN_PORT_COUNTER_RX_BYTES',
390 1: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST',
391 2: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST',
392 3: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST',
393 4: 'OFP_BSN_PORT_COUNTER_RX_DROPPED',
394 5: 'OFP_BSN_PORT_COUNTER_RX_ERRORS',
395 6: 'OFP_BSN_PORT_COUNTER_TX_BYTES',
396 7: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST',
397 8: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST',
398 9: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST',
399 10: 'OFP_BSN_PORT_COUNTER_TX_DROPPED',
400 11: 'OFP_BSN_PORT_COUNTER_TX_ERRORS',
401 12: 'OFP_BSN_PORT_COUNTER_RX_RUNTS',
402 13: 'OFP_BSN_PORT_COUNTER_RX_GIANTS',
403 14: 'OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS',
404 15: 'OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS',
405 16: 'OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS',
406 17: 'OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT',
407 18: 'OFP_BSN_PORT_COUNTER_TX_COLLISIONS',
408 19: 'OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS',
409 20: 'OFP_BSN_PORT_COUNTER_TX_DEFERRED',
410 21: 'OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT',
411 22: 'OFP_BSN_PORT_COUNTER_RX_PACKETS',
412 23: 'OFP_BSN_PORT_COUNTER_TX_PACKETS',
413 24: 'OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS',
414 25: 'OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS',
415 26: 'OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS',
Rich Lane51168312015-06-25 13:13:54 -0700416 27: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_BAD_VLAN',
Rich Laneccd32ed2014-11-10 17:48:24 -0800417}
418
419# Identifiers from group ofp_bsn_tcp_flag
420OFP_BSN_TCP_FLAG_FIN = 1
421OFP_BSN_TCP_FLAG_SYN = 2
422OFP_BSN_TCP_FLAG_RST = 4
423OFP_BSN_TCP_FLAG_PSH = 8
424OFP_BSN_TCP_FLAG_ACK = 16
425OFP_BSN_TCP_FLAG_URG = 32
426OFP_BSN_TCP_FLAG_ECE = 64
427OFP_BSN_TCP_FLAG_CWR = 128
428OFP_BSN_TCP_FLAG_NS = 256
429
430ofp_bsn_tcp_flag_map = {
431 1: 'OFP_BSN_TCP_FLAG_FIN',
432 2: 'OFP_BSN_TCP_FLAG_SYN',
433 4: 'OFP_BSN_TCP_FLAG_RST',
434 8: 'OFP_BSN_TCP_FLAG_PSH',
435 16: 'OFP_BSN_TCP_FLAG_ACK',
436 32: 'OFP_BSN_TCP_FLAG_URG',
437 64: 'OFP_BSN_TCP_FLAG_ECE',
438 128: 'OFP_BSN_TCP_FLAG_CWR',
439 256: 'OFP_BSN_TCP_FLAG_NS',
440}
441
442# Identifiers from group ofp_bsn_udf_anchor
443OFP_BSN_UDF_ANCHOR_PACKET_START = 0
444OFP_BSN_UDF_ANCHOR_L3_HEADER_START = 1
445OFP_BSN_UDF_ANCHOR_L4_HEADER_START = 2
446
447ofp_bsn_udf_anchor_map = {
448 0: 'OFP_BSN_UDF_ANCHOR_PACKET_START',
449 1: 'OFP_BSN_UDF_ANCHOR_L3_HEADER_START',
450 2: 'OFP_BSN_UDF_ANCHOR_L4_HEADER_START',
451}
452
453# Identifiers from group ofp_bsn_vlan_counter_constants
454OFP_BSN_VLAN_ALL = 65535
455
456ofp_bsn_vlan_counter_constants_map = {
457 65535: 'OFP_BSN_VLAN_ALL',
458}
459
Rich Lane2e079da2014-10-29 15:30:24 -0700460# Identifiers from group ofp_bsn_vport_l2gre_flags
461OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
462OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
463OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
464OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
465OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
466
467ofp_bsn_vport_l2gre_flags_map = {
468 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
469 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
470 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
471 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
472 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
473}
474
475# Identifiers from group ofp_bsn_vport_q_in_q_untagged
476OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
477
478ofp_bsn_vport_q_in_q_untagged_map = {
479 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
480}
481
482# Identifiers from group ofp_bsn_vport_status
483OF_BSN_VPORT_STATUS_OK = 0
484OF_BSN_VPORT_STATUS_FAILED = 1
485
486ofp_bsn_vport_status_map = {
487 0: 'OF_BSN_VPORT_STATUS_OK',
488 1: 'OF_BSN_VPORT_STATUS_FAILED',
489}
490
Rich Laneccd32ed2014-11-10 17:48:24 -0800491# Identifiers from group ofp_bsn_vrf_counter_constants
492OFP_BSN_VRF_ALL = 4294967295
493
494ofp_bsn_vrf_counter_constants_map = {
495 4294967295: 'OFP_BSN_VRF_ALL',
496}
497
Rich Lane2e079da2014-10-29 15:30:24 -0700498# Identifiers from group ofp_bundle_ctrl_type
499OFPBCT_OPEN_REQUEST = 0
500OFPBCT_OPEN_REPLY = 1
501OFPBCT_CLOSE_REQUEST = 2
502OFPBCT_CLOSE_REPLY = 3
503OFPBCT_COMMIT_REQUEST = 4
504OFPBCT_COMMIT_REPLY = 5
505OFPBCT_DISCARD_REQUEST = 6
506OFPBCT_DISCARD_REPLY = 7
507
508ofp_bundle_ctrl_type_map = {
509 0: 'OFPBCT_OPEN_REQUEST',
510 1: 'OFPBCT_OPEN_REPLY',
511 2: 'OFPBCT_CLOSE_REQUEST',
512 3: 'OFPBCT_CLOSE_REPLY',
513 4: 'OFPBCT_COMMIT_REQUEST',
514 5: 'OFPBCT_COMMIT_REPLY',
515 6: 'OFPBCT_DISCARD_REQUEST',
516 7: 'OFPBCT_DISCARD_REPLY',
517}
518
519# Identifiers from group ofp_bundle_failed_code
520OFPBFC_UNKNOWN = 0
521OFPBFC_EPERM = 1
522OFPBFC_BAD_ID = 2
523OFPBFC_BUNDLE_EXIST = 3
524OFPBFC_BUNDLE_CLOSED = 4
525OFPBFC_OUT_OF_BUNDLES = 5
526OFPBFC_BAD_TYPE = 6
527OFPBFC_BAD_FLAGS = 7
528OFPBFC_MSG_BAD_LEN = 8
529OFPBFC_MSG_BAD_XID = 9
530OFPBFC_MSG_UNSUP = 10
531OFPBFC_MSG_CONFLICT = 11
532OFPBFC_MSG_TOO_MANY = 12
533OFPBFC_MSG_FAILED = 13
534OFPBFC_TIMEOUT = 14
535OFPBFC_BUNDLE_IN_PROGRESS = 15
536
537ofp_bundle_failed_code_map = {
538 0: 'OFPBFC_UNKNOWN',
539 1: 'OFPBFC_EPERM',
540 2: 'OFPBFC_BAD_ID',
541 3: 'OFPBFC_BUNDLE_EXIST',
542 4: 'OFPBFC_BUNDLE_CLOSED',
543 5: 'OFPBFC_OUT_OF_BUNDLES',
544 6: 'OFPBFC_BAD_TYPE',
545 7: 'OFPBFC_BAD_FLAGS',
546 8: 'OFPBFC_MSG_BAD_LEN',
547 9: 'OFPBFC_MSG_BAD_XID',
548 10: 'OFPBFC_MSG_UNSUP',
549 11: 'OFPBFC_MSG_CONFLICT',
550 12: 'OFPBFC_MSG_TOO_MANY',
551 13: 'OFPBFC_MSG_FAILED',
552 14: 'OFPBFC_TIMEOUT',
553 15: 'OFPBFC_BUNDLE_IN_PROGRESS',
554}
555
556# Identifiers from group ofp_bundle_flags
557OFPBF_ATOMIC = 1
558OFPBF_ORDERED = 2
559
560ofp_bundle_flags_map = {
561 1: 'OFPBF_ATOMIC',
562 2: 'OFPBF_ORDERED',
563}
564
565# Identifiers from group ofp_capabilities
566OFPC_FLOW_STATS = 1
567OFPC_TABLE_STATS = 2
568OFPC_PORT_STATS = 4
569OFPC_GROUP_STATS = 8
570OFPC_IP_REASM = 32
571OFPC_QUEUE_STATS = 64
572OFPC_PORT_BLOCKED = 256
573
574ofp_capabilities_map = {
575 1: 'OFPC_FLOW_STATS',
576 2: 'OFPC_TABLE_STATS',
577 4: 'OFPC_PORT_STATS',
578 8: 'OFPC_GROUP_STATS',
579 32: 'OFPC_IP_REASM',
580 64: 'OFPC_QUEUE_STATS',
581 256: 'OFPC_PORT_BLOCKED',
582}
583
584# Identifiers from group ofp_config_flags
585OFPC_FRAG_NORMAL = 0
586OFPC_FRAG_DROP = 1
587OFPC_FRAG_REASM = 2
588OFPC_FRAG_MASK = 3
589
590ofp_config_flags_map = {
591 0: 'OFPC_FRAG_NORMAL',
592 1: 'OFPC_FRAG_DROP',
593 2: 'OFPC_FRAG_REASM',
594 3: 'OFPC_FRAG_MASK',
595}
596
597# Identifiers from group ofp_controller_max_len
598OFPCML_MAX = 65509
599OFPCML_NO_BUFFER = 65535
600
601ofp_controller_max_len_map = {
602 65509: 'OFPCML_MAX',
603 65535: 'OFPCML_NO_BUFFER',
604}
605
606# Identifiers from group ofp_controller_role
607OFPCR_ROLE_NOCHANGE = 0
608OFPCR_ROLE_EQUAL = 1
609OFPCR_ROLE_MASTER = 2
610OFPCR_ROLE_SLAVE = 3
611
612ofp_controller_role_map = {
613 0: 'OFPCR_ROLE_NOCHANGE',
614 1: 'OFPCR_ROLE_EQUAL',
615 2: 'OFPCR_ROLE_MASTER',
616 3: 'OFPCR_ROLE_SLAVE',
617}
618
619# Identifiers from group ofp_controller_role_reason
620OFPCRR_MASTER_REQUEST = 0
621OFPCRR_CONFIG = 1
622OFPCRR_EXPERIMENTER = 2
623
624ofp_controller_role_reason_map = {
625 0: 'OFPCRR_MASTER_REQUEST',
626 1: 'OFPCRR_CONFIG',
627 2: 'OFPCRR_EXPERIMENTER',
628}
629
630# Identifiers from group ofp_error_type
631OFPET_HELLO_FAILED = 0
632OFPET_BAD_REQUEST = 1
633OFPET_BAD_ACTION = 2
634OFPET_BAD_INSTRUCTION = 3
635OFPET_BAD_MATCH = 4
636OFPET_FLOW_MOD_FAILED = 5
637OFPET_GROUP_MOD_FAILED = 6
638OFPET_PORT_MOD_FAILED = 7
639OFPET_TABLE_MOD_FAILED = 8
640OFPET_QUEUE_OP_FAILED = 9
641OFPET_SWITCH_CONFIG_FAILED = 10
642OFPET_ROLE_REQUEST_FAILED = 11
643OFPET_METER_MOD_FAILED = 12
644OFPET_TABLE_FEATURES_FAILED = 13
645OFPET_BAD_PROPERTY = 14
646OFPET_ASYNC_CONFIG_FAILED = 15
647OFPET_FLOW_MONITOR_FAILED = 16
648OFPET_BUNDLE_FAILED = 17
649OFPET_EXPERIMENTER = 65535
650
651ofp_error_type_map = {
652 0: 'OFPET_HELLO_FAILED',
653 1: 'OFPET_BAD_REQUEST',
654 2: 'OFPET_BAD_ACTION',
655 3: 'OFPET_BAD_INSTRUCTION',
656 4: 'OFPET_BAD_MATCH',
657 5: 'OFPET_FLOW_MOD_FAILED',
658 6: 'OFPET_GROUP_MOD_FAILED',
659 7: 'OFPET_PORT_MOD_FAILED',
660 8: 'OFPET_TABLE_MOD_FAILED',
661 9: 'OFPET_QUEUE_OP_FAILED',
662 10: 'OFPET_SWITCH_CONFIG_FAILED',
663 11: 'OFPET_ROLE_REQUEST_FAILED',
664 12: 'OFPET_METER_MOD_FAILED',
665 13: 'OFPET_TABLE_FEATURES_FAILED',
666 14: 'OFPET_BAD_PROPERTY',
667 15: 'OFPET_ASYNC_CONFIG_FAILED',
668 16: 'OFPET_FLOW_MONITOR_FAILED',
669 17: 'OFPET_BUNDLE_FAILED',
670 65535: 'OFPET_EXPERIMENTER',
671}
672
673# Identifiers from group ofp_flow_mod_command
674OFPFC_ADD = 0
675OFPFC_MODIFY = 1
676OFPFC_MODIFY_STRICT = 2
677OFPFC_DELETE = 3
678OFPFC_DELETE_STRICT = 4
679
680ofp_flow_mod_command_map = {
681 0: 'OFPFC_ADD',
682 1: 'OFPFC_MODIFY',
683 2: 'OFPFC_MODIFY_STRICT',
684 3: 'OFPFC_DELETE',
685 4: 'OFPFC_DELETE_STRICT',
686}
687
688# Identifiers from group ofp_flow_mod_failed_code
689OFPFMFC_UNKNOWN = 0
690OFPFMFC_TABLE_FULL = 1
691OFPFMFC_BAD_TABLE_ID = 2
692OFPFMFC_OVERLAP = 3
693OFPFMFC_EPERM = 4
694OFPFMFC_BAD_TIMEOUT = 5
695OFPFMFC_BAD_COMMAND = 6
696OFPFMFC_BAD_FLAGS = 7
697OFPFMFC_CANT_SYNC = 8
698OFPFMFC_BAD_PRIORITY = 9
699
700ofp_flow_mod_failed_code_map = {
701 0: 'OFPFMFC_UNKNOWN',
702 1: 'OFPFMFC_TABLE_FULL',
703 2: 'OFPFMFC_BAD_TABLE_ID',
704 3: 'OFPFMFC_OVERLAP',
705 4: 'OFPFMFC_EPERM',
706 5: 'OFPFMFC_BAD_TIMEOUT',
707 6: 'OFPFMFC_BAD_COMMAND',
708 7: 'OFPFMFC_BAD_FLAGS',
709 8: 'OFPFMFC_CANT_SYNC',
710 9: 'OFPFMFC_BAD_PRIORITY',
711}
712
713# Identifiers from group ofp_flow_mod_flags
714OFPFF_SEND_FLOW_REM = 1
715OFPFF_CHECK_OVERLAP = 2
716OFPFF_RESET_COUNTS = 4
717OFPFF_NO_PKT_COUNTS = 8
718OFPFF_NO_BYT_COUNTS = 16
719OFPFF_BSN_SEND_IDLE = 128
720
721ofp_flow_mod_flags_map = {
722 1: 'OFPFF_SEND_FLOW_REM',
723 2: 'OFPFF_CHECK_OVERLAP',
724 4: 'OFPFF_RESET_COUNTS',
725 8: 'OFPFF_NO_PKT_COUNTS',
726 16: 'OFPFF_NO_BYT_COUNTS',
727 128: 'OFPFF_BSN_SEND_IDLE',
728}
729
730# Identifiers from group ofp_flow_monitor_failed_code
731OFPMOFC_UNKNOWN = 0
732OFPMOFC_MONITOR_EXISTS = 1
733OFPMOFC_INVALID_MONITOR = 2
734OFPMOFC_UNKNOWN_MONITOR = 3
735OFPMOFC_BAD_COMMAND = 4
736OFPMOFC_BAD_FLAGS = 5
737OFPMOFC_BAD_TABLE_ID = 6
738OFPMOFC_BAD_OUT = 7
739
740ofp_flow_monitor_failed_code_map = {
741 0: 'OFPMOFC_UNKNOWN',
742 1: 'OFPMOFC_MONITOR_EXISTS',
743 2: 'OFPMOFC_INVALID_MONITOR',
744 3: 'OFPMOFC_UNKNOWN_MONITOR',
745 4: 'OFPMOFC_BAD_COMMAND',
746 5: 'OFPMOFC_BAD_FLAGS',
747 6: 'OFPMOFC_BAD_TABLE_ID',
748 7: 'OFPMOFC_BAD_OUT',
749}
750
751# Identifiers from group ofp_flow_removed_reason
752OFPRR_IDLE_TIMEOUT = 0
753OFPRR_HARD_TIMEOUT = 1
754OFPRR_DELETE = 2
755OFPRR_GROUP_DELETE = 3
756OFPRR_METER_DELETE = 4
757OFPRR_EVICTION = 5
758
759ofp_flow_removed_reason_map = {
760 0: 'OFPRR_IDLE_TIMEOUT',
761 1: 'OFPRR_HARD_TIMEOUT',
762 2: 'OFPRR_DELETE',
763 3: 'OFPRR_GROUP_DELETE',
764 4: 'OFPRR_METER_DELETE',
765 5: 'OFPRR_EVICTION',
766}
767
768# Identifiers from group ofp_group
769OFPG_MAX = 4294967040
770OFPG_ALL = 4294967292
771OFPG_ANY = 4294967295
772
773ofp_group_map = {
774 4294967040: 'OFPG_MAX',
775 4294967292: 'OFPG_ALL',
776 4294967295: 'OFPG_ANY',
777}
778
779# Identifiers from group ofp_group_capabilities
780OFPGFC_SELECT_WEIGHT = 1
781OFPGFC_SELECT_LIVENESS = 2
782OFPGFC_CHAINING = 4
783OFPGFC_CHAINING_CHECKS = 8
784
785ofp_group_capabilities_map = {
786 1: 'OFPGFC_SELECT_WEIGHT',
787 2: 'OFPGFC_SELECT_LIVENESS',
788 4: 'OFPGFC_CHAINING',
789 8: 'OFPGFC_CHAINING_CHECKS',
790}
791
792# Identifiers from group ofp_group_mod_command
793OFPGC_ADD = 0
794OFPGC_MODIFY = 1
795OFPGC_DELETE = 2
796
797ofp_group_mod_command_map = {
798 0: 'OFPGC_ADD',
799 1: 'OFPGC_MODIFY',
800 2: 'OFPGC_DELETE',
801}
802
803# Identifiers from group ofp_group_mod_failed_code
804OFPGMFC_GROUP_EXISTS = 0
805OFPGMFC_INVALID_GROUP = 1
806OFPGMFC_WEIGHT_UNSUPPORTED = 2
807OFPGMFC_OUT_OF_GROUPS = 3
808OFPGMFC_OUT_OF_BUCKETS = 4
809OFPGMFC_CHAINING_UNSUPPORTED = 5
810OFPGMFC_WATCH_UNSUPPORTED = 6
811OFPGMFC_LOOP = 7
812OFPGMFC_UNKNOWN_GROUP = 8
813OFPGMFC_CHAINED_GROUP = 9
814OFPGMFC_BAD_TYPE = 10
815OFPGMFC_BAD_COMMAND = 11
816OFPGMFC_BAD_BUCKET = 12
817OFPGMFC_BAD_WATCH = 13
818OFPGMFC_EPERM = 14
819
820ofp_group_mod_failed_code_map = {
821 0: 'OFPGMFC_GROUP_EXISTS',
822 1: 'OFPGMFC_INVALID_GROUP',
823 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
824 3: 'OFPGMFC_OUT_OF_GROUPS',
825 4: 'OFPGMFC_OUT_OF_BUCKETS',
826 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
827 6: 'OFPGMFC_WATCH_UNSUPPORTED',
828 7: 'OFPGMFC_LOOP',
829 8: 'OFPGMFC_UNKNOWN_GROUP',
830 9: 'OFPGMFC_CHAINED_GROUP',
831 10: 'OFPGMFC_BAD_TYPE',
832 11: 'OFPGMFC_BAD_COMMAND',
833 12: 'OFPGMFC_BAD_BUCKET',
834 13: 'OFPGMFC_BAD_WATCH',
835 14: 'OFPGMFC_EPERM',
836}
837
838# Identifiers from group ofp_group_type
839OFPGT_ALL = 0
840OFPGT_SELECT = 1
841OFPGT_INDIRECT = 2
842OFPGT_FF = 3
843
844ofp_group_type_map = {
845 0: 'OFPGT_ALL',
846 1: 'OFPGT_SELECT',
847 2: 'OFPGT_INDIRECT',
848 3: 'OFPGT_FF',
849}
850
851# Identifiers from group ofp_hello_elem_type
852OFPHET_VERSIONBITMAP = 1
853
854ofp_hello_elem_type_map = {
855 1: 'OFPHET_VERSIONBITMAP',
856}
857
858# Identifiers from group ofp_hello_failed_code
859OFPHFC_INCOMPATIBLE = 0
860OFPHFC_EPERM = 1
861
862ofp_hello_failed_code_map = {
863 0: 'OFPHFC_INCOMPATIBLE',
864 1: 'OFPHFC_EPERM',
865}
866
867# Identifiers from group ofp_instruction_type
868OFPIT_GOTO_TABLE = 1
869OFPIT_WRITE_METADATA = 2
870OFPIT_WRITE_ACTIONS = 3
871OFPIT_APPLY_ACTIONS = 4
872OFPIT_CLEAR_ACTIONS = 5
873OFPIT_METER = 6
874OFPIT_EXPERIMENTER = 65535
875
876ofp_instruction_type_map = {
877 1: 'OFPIT_GOTO_TABLE',
878 2: 'OFPIT_WRITE_METADATA',
879 3: 'OFPIT_WRITE_ACTIONS',
880 4: 'OFPIT_APPLY_ACTIONS',
881 5: 'OFPIT_CLEAR_ACTIONS',
882 6: 'OFPIT_METER',
883 65535: 'OFPIT_EXPERIMENTER',
884}
885
886# Identifiers from group ofp_ipv6exthdr_flags
887OFPIEH_NONEXT = 1
888OFPIEH_ESP = 2
889OFPIEH_AUTH = 4
890OFPIEH_DEST = 8
891OFPIEH_FRAG = 16
892OFPIEH_ROUTER = 32
893OFPIEH_HOP = 64
894OFPIEH_UNREP = 128
895OFPIEH_UNSEQ = 256
896
897ofp_ipv6exthdr_flags_map = {
898 1: 'OFPIEH_NONEXT',
899 2: 'OFPIEH_ESP',
900 4: 'OFPIEH_AUTH',
901 8: 'OFPIEH_DEST',
902 16: 'OFPIEH_FRAG',
903 32: 'OFPIEH_ROUTER',
904 64: 'OFPIEH_HOP',
905 128: 'OFPIEH_UNREP',
906 256: 'OFPIEH_UNSEQ',
907}
908
909# Identifiers from group ofp_match_type
910OFPMT_STANDARD = 0
911OFPMT_OXM = 1
912
913ofp_match_type_map = {
914 0: 'OFPMT_STANDARD',
915 1: 'OFPMT_OXM',
916}
917
918# Identifiers from group ofp_meter
919OFPM_MAX = 4294901760
920OFPM_SLOWPATH = 4294967293
921OFPM_CONTROLLER = 4294967294
922OFPM_ALL = 4294967295
923
924ofp_meter_map = {
925 4294901760: 'OFPM_MAX',
926 4294967293: 'OFPM_SLOWPATH',
927 4294967294: 'OFPM_CONTROLLER',
928 4294967295: 'OFPM_ALL',
929}
930
931# Identifiers from group ofp_meter_band_type
932OFPMBT_DROP = 1
933OFPMBT_DSCP_REMARK = 2
934OFPMBT_EXPERIMENTER = 65535
935
936ofp_meter_band_type_map = {
937 1: 'OFPMBT_DROP',
938 2: 'OFPMBT_DSCP_REMARK',
939 65535: 'OFPMBT_EXPERIMENTER',
940}
941
942# Identifiers from group ofp_meter_flags
943OFPMF_KBPS = 1
944OFPMF_PKTPS = 2
945OFPMF_BURST = 4
946OFPMF_STATS = 8
947
948ofp_meter_flags_map = {
949 1: 'OFPMF_KBPS',
950 2: 'OFPMF_PKTPS',
951 4: 'OFPMF_BURST',
952 8: 'OFPMF_STATS',
953}
954
955# Identifiers from group ofp_meter_mod_command
956OFPMC_ADD = 0
957OFPMC_MODIFY = 1
958OFPMC_DELETE = 2
959
960ofp_meter_mod_command_map = {
961 0: 'OFPMC_ADD',
962 1: 'OFPMC_MODIFY',
963 2: 'OFPMC_DELETE',
964}
965
966# Identifiers from group ofp_meter_mod_failed_code
967OFPMMFC_UNKNOWN = 0
968OFPMMFC_METER_EXISTS = 1
969OFPMMFC_INVALID_METER = 2
970OFPMMFC_UNKNOWN_METER = 3
971OFPMMFC_BAD_COMMAND = 4
972OFPMMFC_BAD_FLAGS = 5
973OFPMMFC_BAD_RATE = 6
974OFPMMFC_BAD_BURST = 7
975OFPMMFC_BAD_BAND = 8
976OFPMMFC_BAD_BAND_VALUE = 9
977OFPMMFC_OUT_OF_METERS = 10
978OFPMMFC_OUT_OF_BANDS = 11
979
980ofp_meter_mod_failed_code_map = {
981 0: 'OFPMMFC_UNKNOWN',
982 1: 'OFPMMFC_METER_EXISTS',
983 2: 'OFPMMFC_INVALID_METER',
984 3: 'OFPMMFC_UNKNOWN_METER',
985 4: 'OFPMMFC_BAD_COMMAND',
986 5: 'OFPMMFC_BAD_FLAGS',
987 6: 'OFPMMFC_BAD_RATE',
988 7: 'OFPMMFC_BAD_BURST',
989 8: 'OFPMMFC_BAD_BAND',
990 9: 'OFPMMFC_BAD_BAND_VALUE',
991 10: 'OFPMMFC_OUT_OF_METERS',
992 11: 'OFPMMFC_OUT_OF_BANDS',
993}
994
995# Identifiers from group ofp_optical_port_features
996OFPOPF_RX_TUNE = 1
997OFPOPF_TX_TUNE = 2
998OFPOPF_TX_PWR = 4
999OFPOPF_USE_FREQ = 8
1000
1001ofp_optical_port_features_map = {
1002 1: 'OFPOPF_RX_TUNE',
1003 2: 'OFPOPF_TX_TUNE',
1004 4: 'OFPOPF_TX_PWR',
1005 8: 'OFPOPF_USE_FREQ',
1006}
1007
1008# Identifiers from group ofp_oxm_class
1009OFPXMC_NXM_0 = 0
1010OFPXMC_NXM_1 = 1
1011OFPXMC_OPENFLOW_BASIC = 32768
1012OFPXMC_EXPERIMENTER = 65535
1013
1014ofp_oxm_class_map = {
1015 0: 'OFPXMC_NXM_0',
1016 1: 'OFPXMC_NXM_1',
1017 32768: 'OFPXMC_OPENFLOW_BASIC',
1018 65535: 'OFPXMC_EXPERIMENTER',
1019}
1020
1021# Identifiers from group ofp_packet_in_reason
1022OFPR_NO_MATCH = 0
1023OFPR_ACTION = 1
1024OFPR_INVALID_TTL = 2
1025OFPR_ACTION_SET = 3
1026OFPR_GROUP = 4
1027OFPR_PACKET_OUT = 5
1028OFPR_BSN_NEW_HOST = 128
1029OFPR_BSN_STATION_MOVE = 129
1030OFPR_BSN_BAD_VLAN = 130
1031OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131
1032OFPR_BSN_NO_ROUTE = 132
1033OFPR_BSN_ICMP_ECHO_REQUEST = 133
1034OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134
1035OFPR_BSN_DEST_HOST_UNREACHABLE = 135
1036OFPR_BSN_DEST_PORT_UNREACHABLE = 136
1037OFPR_BSN_FRAGMENTATION_REQUIRED = 137
1038OFPR_BSN_ARP = 139
1039OFPR_BSN_DHCP = 140
1040OFPR_BSN_DEBUG = 141
1041OFPR_BSN_PACKET_OF_DEATH = 142
1042
1043ofp_packet_in_reason_map = {
1044 0: 'OFPR_NO_MATCH',
1045 1: 'OFPR_ACTION',
1046 2: 'OFPR_INVALID_TTL',
1047 3: 'OFPR_ACTION_SET',
1048 4: 'OFPR_GROUP',
1049 5: 'OFPR_PACKET_OUT',
1050 128: 'OFPR_BSN_NEW_HOST',
1051 129: 'OFPR_BSN_STATION_MOVE',
1052 130: 'OFPR_BSN_BAD_VLAN',
1053 131: 'OFPR_BSN_DESTINATION_LOOKUP_FAILURE',
1054 132: 'OFPR_BSN_NO_ROUTE',
1055 133: 'OFPR_BSN_ICMP_ECHO_REQUEST',
1056 134: 'OFPR_BSN_DEST_NETWORK_UNREACHABLE',
1057 135: 'OFPR_BSN_DEST_HOST_UNREACHABLE',
1058 136: 'OFPR_BSN_DEST_PORT_UNREACHABLE',
1059 137: 'OFPR_BSN_FRAGMENTATION_REQUIRED',
1060 139: 'OFPR_BSN_ARP',
1061 140: 'OFPR_BSN_DHCP',
1062 141: 'OFPR_BSN_DEBUG',
1063 142: 'OFPR_BSN_PACKET_OF_DEATH',
1064}
1065
1066# Identifiers from group ofp_port
1067OFPP_MAX = 4294967040
1068OFPP_IN_PORT = 4294967288
1069OFPP_TABLE = 4294967289
1070OFPP_NORMAL = 4294967290
1071OFPP_FLOOD = 4294967291
1072OFPP_ALL = 4294967292
1073OFPP_CONTROLLER = 4294967293
1074OFPP_LOCAL = 4294967294
1075OFPP_ANY = 4294967295
1076
1077ofp_port_map = {
1078 4294967040: 'OFPP_MAX',
1079 4294967288: 'OFPP_IN_PORT',
1080 4294967289: 'OFPP_TABLE',
1081 4294967290: 'OFPP_NORMAL',
1082 4294967291: 'OFPP_FLOOD',
1083 4294967292: 'OFPP_ALL',
1084 4294967293: 'OFPP_CONTROLLER',
1085 4294967294: 'OFPP_LOCAL',
1086 4294967295: 'OFPP_ANY',
1087}
1088
1089# Identifiers from group ofp_port_config
1090OFPPC_PORT_DOWN = 1
1091OFPPC_NO_RECV = 4
1092OFPPC_NO_FWD = 32
1093OFPPC_NO_PACKET_IN = 64
1094OFPPC_BSN_MIRROR_DEST = 2147483648
1095
1096ofp_port_config_map = {
1097 1: 'OFPPC_PORT_DOWN',
1098 4: 'OFPPC_NO_RECV',
1099 32: 'OFPPC_NO_FWD',
1100 64: 'OFPPC_NO_PACKET_IN',
1101 2147483648: 'OFPPC_BSN_MIRROR_DEST',
1102}
1103
1104# Identifiers from group ofp_port_features
1105OFPPF_10MB_HD = 1
1106OFPPF_10MB_FD = 2
1107OFPPF_100MB_HD = 4
1108OFPPF_100MB_FD = 8
1109OFPPF_1GB_HD = 16
1110OFPPF_1GB_FD = 32
1111OFPPF_10GB_FD = 64
1112OFPPF_40GB_FD = 128
1113OFPPF_100GB_FD = 256
1114OFPPF_1TB_FD = 512
1115OFPPF_OTHER = 1024
1116OFPPF_COPPER = 2048
1117OFPPF_FIBER = 4096
1118OFPPF_AUTONEG = 8192
1119OFPPF_PAUSE = 16384
1120OFPPF_PAUSE_ASYM = 32768
Rich Lanecb18dbd2014-12-18 10:02:29 -08001121OFPPF_BSN_BREAKOUT_CAPABLE = 2147483648
Rich Lane2e079da2014-10-29 15:30:24 -07001122
1123ofp_port_features_map = {
1124 1: 'OFPPF_10MB_HD',
1125 2: 'OFPPF_10MB_FD',
1126 4: 'OFPPF_100MB_HD',
1127 8: 'OFPPF_100MB_FD',
1128 16: 'OFPPF_1GB_HD',
1129 32: 'OFPPF_1GB_FD',
1130 64: 'OFPPF_10GB_FD',
1131 128: 'OFPPF_40GB_FD',
1132 256: 'OFPPF_100GB_FD',
1133 512: 'OFPPF_1TB_FD',
1134 1024: 'OFPPF_OTHER',
1135 2048: 'OFPPF_COPPER',
1136 4096: 'OFPPF_FIBER',
1137 8192: 'OFPPF_AUTONEG',
1138 16384: 'OFPPF_PAUSE',
1139 32768: 'OFPPF_PAUSE_ASYM',
Rich Lanecb18dbd2014-12-18 10:02:29 -08001140 2147483648: 'OFPPF_BSN_BREAKOUT_CAPABLE',
Rich Lane2e079da2014-10-29 15:30:24 -07001141}
1142
1143# Identifiers from group ofp_port_mod_failed_code
1144OFPPMFC_BAD_PORT = 0
1145OFPPMFC_BAD_HW_ADDR = 1
1146OFPPMFC_BAD_CONFIG = 2
1147OFPPMFC_BAD_ADVERTISE = 3
1148OFPPMFC_EPERM = 4
1149
1150ofp_port_mod_failed_code_map = {
1151 0: 'OFPPMFC_BAD_PORT',
1152 1: 'OFPPMFC_BAD_HW_ADDR',
1153 2: 'OFPPMFC_BAD_CONFIG',
1154 3: 'OFPPMFC_BAD_ADVERTISE',
1155 4: 'OFPPMFC_EPERM',
1156}
1157
1158# Identifiers from group ofp_port_reason
1159OFPPR_ADD = 0
1160OFPPR_DELETE = 1
1161OFPPR_MODIFY = 2
1162
1163ofp_port_reason_map = {
1164 0: 'OFPPR_ADD',
1165 1: 'OFPPR_DELETE',
1166 2: 'OFPPR_MODIFY',
1167}
1168
1169# Identifiers from group ofp_port_state
1170OFPPS_LINK_DOWN = 1
1171OFPPS_BLOCKED = 2
1172OFPPS_LIVE = 4
1173
1174ofp_port_state_map = {
1175 1: 'OFPPS_LINK_DOWN',
1176 2: 'OFPPS_BLOCKED',
1177 4: 'OFPPS_LIVE',
1178}
1179
1180# Identifiers from group ofp_port_stats_optical_flags
1181OFPOSF_RX_TUNE = 1
1182OFPOSF_TX_TUNE = 2
1183OFPOSF_TX_PWR = 4
1184OFPOSF_RX_PWR = 16
1185OFPOSF_TX_BIAS = 32
1186OFPOSF_TX_TEMP = 64
1187
1188ofp_port_stats_optical_flags_map = {
1189 1: 'OFPOSF_RX_TUNE',
1190 2: 'OFPOSF_TX_TUNE',
1191 4: 'OFPOSF_TX_PWR',
1192 16: 'OFPOSF_RX_PWR',
1193 32: 'OFPOSF_TX_BIAS',
1194 64: 'OFPOSF_TX_TEMP',
1195}
1196
1197# Identifiers from group ofp_port_stats_prop_type
1198OFPPSPT_ETHERNET = 0
1199OFPPSPT_OPTICAL = 1
1200OFPPSPT_EXPERIMENTER = 65535
1201
1202ofp_port_stats_prop_type_map = {
1203 0: 'OFPPSPT_ETHERNET',
1204 1: 'OFPPSPT_OPTICAL',
1205 65535: 'OFPPSPT_EXPERIMENTER',
1206}
1207
1208# Identifiers from group ofp_queue_op_failed_code
1209OFPQOFC_BAD_PORT = 0
1210OFPQOFC_BAD_QUEUE = 1
1211OFPQOFC_EPERM = 2
1212
1213ofp_queue_op_failed_code_map = {
1214 0: 'OFPQOFC_BAD_PORT',
1215 1: 'OFPQOFC_BAD_QUEUE',
1216 2: 'OFPQOFC_EPERM',
1217}
1218
1219# Identifiers from group ofp_requestforward_reason
1220OFPRFR_GROUP_MOD = 0
1221OFPRFR_METER_MOD = 1
1222
1223ofp_requestforward_reason_map = {
1224 0: 'OFPRFR_GROUP_MOD',
1225 1: 'OFPRFR_METER_MOD',
1226}
1227
1228# Identifiers from group ofp_role_request_failed_code
1229OFPRRFC_STALE = 0
1230OFPRRFC_UNSUP = 1
1231OFPRRFC_BAD_ROLE = 2
1232
1233ofp_role_request_failed_code_map = {
1234 0: 'OFPRRFC_STALE',
1235 1: 'OFPRRFC_UNSUP',
1236 2: 'OFPRRFC_BAD_ROLE',
1237}
1238
1239# Identifiers from group ofp_stats_reply_flags
1240OFPSF_REPLY_MORE = 1
1241
1242ofp_stats_reply_flags_map = {
1243 1: 'OFPSF_REPLY_MORE',
1244}
1245
1246# Identifiers from group ofp_stats_request_flags
1247OFPSF_REQ_MORE = 1
1248
1249ofp_stats_request_flags_map = {
1250 1: 'OFPSF_REQ_MORE',
1251}
1252
1253# Identifiers from group ofp_stats_type
1254OFPST_DESC = 0
1255OFPST_FLOW = 1
1256OFPST_AGGREGATE = 2
1257OFPST_TABLE = 3
1258OFPST_PORT = 4
1259OFPST_QUEUE = 5
1260OFPST_GROUP = 6
1261OFPST_GROUP_DESC = 7
1262OFPST_GROUP_FEATURES = 8
1263OFPST_METER = 9
1264OFPST_METER_CONFIG = 10
1265OFPST_METER_FEATURES = 11
1266OFPST_TABLE_FEATURES = 12
1267OFPST_PORT_DESC = 13
1268OFPMP_TABLE_DESC = 14
1269OFPMP_QUEUE_DESC = 15
1270OFPMP_FLOW_MONITOR = 16
1271OFPST_EXPERIMENTER = 65535
1272
1273ofp_stats_type_map = {
1274 0: 'OFPST_DESC',
1275 1: 'OFPST_FLOW',
1276 2: 'OFPST_AGGREGATE',
1277 3: 'OFPST_TABLE',
1278 4: 'OFPST_PORT',
1279 5: 'OFPST_QUEUE',
1280 6: 'OFPST_GROUP',
1281 7: 'OFPST_GROUP_DESC',
1282 8: 'OFPST_GROUP_FEATURES',
1283 9: 'OFPST_METER',
1284 10: 'OFPST_METER_CONFIG',
1285 11: 'OFPST_METER_FEATURES',
1286 12: 'OFPST_TABLE_FEATURES',
1287 13: 'OFPST_PORT_DESC',
1288 14: 'OFPMP_TABLE_DESC',
1289 15: 'OFPMP_QUEUE_DESC',
1290 16: 'OFPMP_FLOW_MONITOR',
1291 65535: 'OFPST_EXPERIMENTER',
1292}
1293
1294# Identifiers from group ofp_switch_config_failed_code
1295OFPSCFC_BAD_FLAGS = 0
1296OFPSCFC_BAD_LEN = 1
1297OFPSCFC_EPERM = 2
1298
1299ofp_switch_config_failed_code_map = {
1300 0: 'OFPSCFC_BAD_FLAGS',
1301 1: 'OFPSCFC_BAD_LEN',
1302 2: 'OFPSCFC_EPERM',
1303}
1304
1305# Identifiers from group ofp_table
1306OFPTT_MAX = 254
1307OFPTT_ALL = 255
1308
1309ofp_table_map = {
1310 254: 'OFPTT_MAX',
1311 255: 'OFPTT_ALL',
1312}
1313
1314# Identifiers from group ofp_table_config
1315OFPTC_DEPRECATED_MASK = 3
1316OFPTC_EVICTION = 4
1317OFPTC_VACANCY_EVENTS = 8
1318
1319ofp_table_config_map = {
1320 3: 'OFPTC_DEPRECATED_MASK',
1321 4: 'OFPTC_EVICTION',
1322 8: 'OFPTC_VACANCY_EVENTS',
1323}
1324
1325# Identifiers from group ofp_table_feature_prop_type
1326OFPTFPT_INSTRUCTIONS = 0
1327OFPTFPT_INSTRUCTIONS_MISS = 1
1328OFPTFPT_NEXT_TABLES = 2
1329OFPTFPT_NEXT_TABLES_MISS = 3
1330OFPTFPT_WRITE_ACTIONS = 4
1331OFPTFPT_WRITE_ACTIONS_MISS = 5
1332OFPTFPT_APPLY_ACTIONS = 6
1333OFPTFPT_APPLY_ACTIONS_MISS = 7
1334OFPTFPT_MATCH = 8
1335OFPTFPT_WILDCARDS = 10
1336OFPTFPT_WRITE_SETFIELD = 12
1337OFPTFPT_WRITE_SETFIELD_MISS = 13
1338OFPTFPT_APPLY_SETFIELD = 14
1339OFPTFPT_APPLY_SETFIELD_MISS = 15
1340OFPTFPT_TABLE_SYNC_FROM = 16
1341OFPTFPT_EXPERIMENTER = 65534
1342OFPTFPT_EXPERIMENTER_MISS = 65535
1343
1344ofp_table_feature_prop_type_map = {
1345 0: 'OFPTFPT_INSTRUCTIONS',
1346 1: 'OFPTFPT_INSTRUCTIONS_MISS',
1347 2: 'OFPTFPT_NEXT_TABLES',
1348 3: 'OFPTFPT_NEXT_TABLES_MISS',
1349 4: 'OFPTFPT_WRITE_ACTIONS',
1350 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
1351 6: 'OFPTFPT_APPLY_ACTIONS',
1352 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
1353 8: 'OFPTFPT_MATCH',
1354 10: 'OFPTFPT_WILDCARDS',
1355 12: 'OFPTFPT_WRITE_SETFIELD',
1356 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
1357 14: 'OFPTFPT_APPLY_SETFIELD',
1358 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
1359 16: 'OFPTFPT_TABLE_SYNC_FROM',
1360 65534: 'OFPTFPT_EXPERIMENTER',
1361 65535: 'OFPTFPT_EXPERIMENTER_MISS',
1362}
1363
1364# Identifiers from group ofp_table_features_failed_code
1365OFPTFFC_BAD_TABLE = 0
1366OFPTFFC_BAD_METADATA = 1
1367OFPTFFC_EPERM = 5
1368
1369ofp_table_features_failed_code_map = {
1370 0: 'OFPTFFC_BAD_TABLE',
1371 1: 'OFPTFFC_BAD_METADATA',
1372 5: 'OFPTFFC_EPERM',
1373}
1374
1375# Identifiers from group ofp_table_mod_failed_code
1376OFPTMFC_BAD_TABLE = 0
1377OFPTMFC_BAD_CONFIG = 1
1378OFPTMFC_EPERM = 2
1379
1380ofp_table_mod_failed_code_map = {
1381 0: 'OFPTMFC_BAD_TABLE',
1382 1: 'OFPTMFC_BAD_CONFIG',
1383 2: 'OFPTMFC_EPERM',
1384}
1385
1386# Identifiers from group ofp_table_mod_prop_eviction_flag
1387OFPTMPEF_OTHER = 1
1388OFPTMPEF_IMPORTANCE = 2
1389OFPTMPEF_LIFETIME = 4
1390
1391ofp_table_mod_prop_eviction_flag_map = {
1392 1: 'OFPTMPEF_OTHER',
1393 2: 'OFPTMPEF_IMPORTANCE',
1394 4: 'OFPTMPEF_LIFETIME',
1395}
1396
1397# Identifiers from group ofp_table_reason
1398OFPTR_VACANCY_DOWN = 3
1399OFPTR_VACANCY_UP = 4
1400
1401ofp_table_reason_map = {
1402 3: 'OFPTR_VACANCY_DOWN',
1403 4: 'OFPTR_VACANCY_UP',
1404}
1405
1406# Identifiers from group ofp_type
1407OFPT_HELLO = 0
1408OFPT_ERROR = 1
1409OFPT_ECHO_REQUEST = 2
1410OFPT_ECHO_REPLY = 3
1411OFPT_EXPERIMENTER = 4
1412OFPT_FEATURES_REQUEST = 5
1413OFPT_FEATURES_REPLY = 6
1414OFPT_GET_CONFIG_REQUEST = 7
1415OFPT_GET_CONFIG_REPLY = 8
1416OFPT_SET_CONFIG = 9
1417OFPT_PACKET_IN = 10
1418OFPT_FLOW_REMOVED = 11
1419OFPT_PORT_STATUS = 12
1420OFPT_PACKET_OUT = 13
1421OFPT_FLOW_MOD = 14
1422OFPT_GROUP_MOD = 15
1423OFPT_PORT_MOD = 16
1424OFPT_TABLE_MOD = 17
1425OFPT_STATS_REQUEST = 18
1426OFPT_STATS_REPLY = 19
1427OFPT_BARRIER_REQUEST = 20
1428OFPT_BARRIER_REPLY = 21
1429OFPT_ROLE_REQUEST = 24
1430OFPT_ROLE_REPLY = 25
1431OFPT_GET_ASYNC_REQUEST = 26
1432OFPT_GET_ASYNC_REPLY = 27
1433OFPT_SET_ASYNC = 28
1434OFPT_METER_MOD = 29
1435OFPT_ROLE_STATUS = 30
1436OFPT_TABLE_STATUS = 31
1437OFPT_REQUESTFORWARD = 32
1438OFPT_BUNDLE_CONTROL = 33
1439OFPT_BUNDLE_ADD_MESSAGE = 34
1440
1441ofp_type_map = {
1442 0: 'OFPT_HELLO',
1443 1: 'OFPT_ERROR',
1444 2: 'OFPT_ECHO_REQUEST',
1445 3: 'OFPT_ECHO_REPLY',
1446 4: 'OFPT_EXPERIMENTER',
1447 5: 'OFPT_FEATURES_REQUEST',
1448 6: 'OFPT_FEATURES_REPLY',
1449 7: 'OFPT_GET_CONFIG_REQUEST',
1450 8: 'OFPT_GET_CONFIG_REPLY',
1451 9: 'OFPT_SET_CONFIG',
1452 10: 'OFPT_PACKET_IN',
1453 11: 'OFPT_FLOW_REMOVED',
1454 12: 'OFPT_PORT_STATUS',
1455 13: 'OFPT_PACKET_OUT',
1456 14: 'OFPT_FLOW_MOD',
1457 15: 'OFPT_GROUP_MOD',
1458 16: 'OFPT_PORT_MOD',
1459 17: 'OFPT_TABLE_MOD',
1460 18: 'OFPT_STATS_REQUEST',
1461 19: 'OFPT_STATS_REPLY',
1462 20: 'OFPT_BARRIER_REQUEST',
1463 21: 'OFPT_BARRIER_REPLY',
1464 24: 'OFPT_ROLE_REQUEST',
1465 25: 'OFPT_ROLE_REPLY',
1466 26: 'OFPT_GET_ASYNC_REQUEST',
1467 27: 'OFPT_GET_ASYNC_REPLY',
1468 28: 'OFPT_SET_ASYNC',
1469 29: 'OFPT_METER_MOD',
1470 30: 'OFPT_ROLE_STATUS',
1471 31: 'OFPT_TABLE_STATUS',
1472 32: 'OFPT_REQUESTFORWARD',
1473 33: 'OFPT_BUNDLE_CONTROL',
1474 34: 'OFPT_BUNDLE_ADD_MESSAGE',
1475}
1476
1477# Identifiers from group ofp_vlan_id
1478OFPVID_NONE = 0
1479OFPVID_PRESENT = 4096
1480
1481ofp_vlan_id_map = {
1482 0: 'OFPVID_NONE',
1483 4096: 'OFPVID_PRESENT',
1484}
1485