blob: f6a68eb2c21bed839410a43ce2da5dbd3df845e6 [file] [log] [blame]
Matteo Scandoloa229eca2017-08-08 13:05:28 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain 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,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Rich Lanec2ee4b82013-04-24 17:12:38 -070017# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
18# Copyright (c) 2011, 2012 Open Networking Foundation
19# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Dan Talaycof6202252013-07-02 01:00:29 -070020# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -070021
22# Automatically generated by LOXI from template const.py
23# Do not modify
24
25OFP_VERSION = 4
26
27# Identifiers from group macro_definitions
Rich Lanec2ee4b82013-04-24 17:12:38 -070028OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070029OFP_MAX_PORT_NAME_LEN = 16
Rich Lane6f4978c2013-10-20 21:33:52 -070030OFP_TCP_PORT = 6653
31OFP_SSL_PORT = 6653
Dan Talaycof6202252013-07-02 01:00:29 -070032OFP_ETH_ALEN = 6
33OFP_DEFAULT_MISS_SEND_LEN = 128
34OFP_VLAN_NONE = 0
35OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070036OFP_DEFAULT_PRIORITY = 32768
Rich Lanec2ee4b82013-04-24 17:12:38 -070037OFP_NO_BUFFER = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070038DESC_STR_LEN = 256
39SERIAL_NUM_LEN = 32
40OFPQ_ALL = 4294967295
41OFPQ_MAX_RATE_UNCFG = 65535
42OFPQ_MIN_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070043
Rich Lane2e079da2014-10-29 15:30:24 -070044# Identifiers from group of_bsn_lacp_convergence_status
Rich Lane7b0f2012013-11-22 14:15:26 -080045LACP_SUCCESS = 0
46LACP_TIMEDOUT = 1
47LACP_OUT_OF_SYNC = 2
48
Rich Lane2e079da2014-10-29 15:30:24 -070049of_bsn_lacp_convergence_status_map = {
Rich Lane7b0f2012013-11-22 14:15:26 -080050 0: 'LACP_SUCCESS',
51 1: 'LACP_TIMEDOUT',
52 2: 'LACP_OUT_OF_SYNC',
53}
54
Rich Lane2e079da2014-10-29 15:30:24 -070055# Identifiers from group of_bsn_pdu_slot_num
Rich Lane6f4978c2013-10-20 21:33:52 -070056BSN_PDU_SLOT_NUM_ANY = 255
57
Rich Lane2e079da2014-10-29 15:30:24 -070058of_bsn_pdu_slot_num_map = {
Rich Lane6f4978c2013-10-20 21:33:52 -070059 255: 'BSN_PDU_SLOT_NUM_ANY',
60}
61
Rich Lane2e079da2014-10-29 15:30:24 -070062# Identifiers from group of_bsn_vlan_counter
Rich Lane7dcdf022013-12-11 14:45:27 -080063OFP_BSN_VLAN_COUNTER_RX_BYTES = 0
64OFP_BSN_VLAN_COUNTER_RX_PACKETS = 1
65OFP_BSN_VLAN_COUNTER_TX_BYTES = 2
66OFP_BSN_VLAN_COUNTER_TX_PACKETS = 3
67
Rich Lane2e079da2014-10-29 15:30:24 -070068of_bsn_vlan_counter_map = {
Rich Lane7dcdf022013-12-11 14:45:27 -080069 0: 'OFP_BSN_VLAN_COUNTER_RX_BYTES',
70 1: 'OFP_BSN_VLAN_COUNTER_RX_PACKETS',
71 2: 'OFP_BSN_VLAN_COUNTER_TX_BYTES',
72 3: 'OFP_BSN_VLAN_COUNTER_TX_PACKETS',
73}
74
Rich Lane2e079da2014-10-29 15:30:24 -070075# Identifiers from group of_bsn_vrf_counter
Rich Lane5587ab12014-06-30 11:19:09 -070076OFP_BSN_VRF_COUNTER_BYTES = 0
77OFP_BSN_VRF_COUNTER_PACKETS = 1
78
Rich Lane2e079da2014-10-29 15:30:24 -070079of_bsn_vrf_counter_map = {
Rich Lane5587ab12014-06-30 11:19:09 -070080 0: 'OFP_BSN_VRF_COUNTER_BYTES',
81 1: 'OFP_BSN_VRF_COUNTER_PACKETS',
82}
83
Rich Lanec2ee4b82013-04-24 17:12:38 -070084# Identifiers from group ofp_action_type
85OFPAT_OUTPUT = 0
86OFPAT_COPY_TTL_OUT = 11
87OFPAT_COPY_TTL_IN = 12
88OFPAT_SET_MPLS_TTL = 15
89OFPAT_DEC_MPLS_TTL = 16
90OFPAT_PUSH_VLAN = 17
91OFPAT_POP_VLAN = 18
92OFPAT_PUSH_MPLS = 19
93OFPAT_POP_MPLS = 20
94OFPAT_SET_QUEUE = 21
95OFPAT_GROUP = 22
96OFPAT_SET_NW_TTL = 23
97OFPAT_DEC_NW_TTL = 24
98OFPAT_SET_FIELD = 25
99OFPAT_PUSH_PBB = 26
100OFPAT_POP_PBB = 27
101OFPAT_EXPERIMENTER = 65535
102
103ofp_action_type_map = {
104 0: 'OFPAT_OUTPUT',
105 11: 'OFPAT_COPY_TTL_OUT',
106 12: 'OFPAT_COPY_TTL_IN',
107 15: 'OFPAT_SET_MPLS_TTL',
108 16: 'OFPAT_DEC_MPLS_TTL',
109 17: 'OFPAT_PUSH_VLAN',
110 18: 'OFPAT_POP_VLAN',
111 19: 'OFPAT_PUSH_MPLS',
112 20: 'OFPAT_POP_MPLS',
113 21: 'OFPAT_SET_QUEUE',
114 22: 'OFPAT_GROUP',
115 23: 'OFPAT_SET_NW_TTL',
116 24: 'OFPAT_DEC_NW_TTL',
117 25: 'OFPAT_SET_FIELD',
118 26: 'OFPAT_PUSH_PBB',
119 27: 'OFPAT_POP_PBB',
120 65535: 'OFPAT_EXPERIMENTER',
121}
122
123# Identifiers from group ofp_bad_action_code
124OFPBAC_BAD_TYPE = 0
125OFPBAC_BAD_LEN = 1
126OFPBAC_BAD_EXPERIMENTER = 2
Rich Lane6f4978c2013-10-20 21:33:52 -0700127OFPBAC_BAD_EXPERIMENTER_TYPE = 3
Rich Lanec2ee4b82013-04-24 17:12:38 -0700128OFPBAC_BAD_OUT_PORT = 4
129OFPBAC_BAD_ARGUMENT = 5
130OFPBAC_EPERM = 6
131OFPBAC_TOO_MANY = 7
132OFPBAC_BAD_QUEUE = 8
133OFPBAC_BAD_OUT_GROUP = 9
134OFPBAC_MATCH_INCONSISTENT = 10
135OFPBAC_UNSUPPORTED_ORDER = 11
136OFPBAC_BAD_TAG = 12
137OFPBAC_BAD_SET_TYPE = 13
138OFPBAC_BAD_SET_LEN = 14
139OFPBAC_BAD_SET_ARGUMENT = 15
140
141ofp_bad_action_code_map = {
142 0: 'OFPBAC_BAD_TYPE',
143 1: 'OFPBAC_BAD_LEN',
144 2: 'OFPBAC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700145 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700146 4: 'OFPBAC_BAD_OUT_PORT',
147 5: 'OFPBAC_BAD_ARGUMENT',
148 6: 'OFPBAC_EPERM',
149 7: 'OFPBAC_TOO_MANY',
150 8: 'OFPBAC_BAD_QUEUE',
151 9: 'OFPBAC_BAD_OUT_GROUP',
152 10: 'OFPBAC_MATCH_INCONSISTENT',
153 11: 'OFPBAC_UNSUPPORTED_ORDER',
154 12: 'OFPBAC_BAD_TAG',
155 13: 'OFPBAC_BAD_SET_TYPE',
156 14: 'OFPBAC_BAD_SET_LEN',
157 15: 'OFPBAC_BAD_SET_ARGUMENT',
158}
159
160# Identifiers from group ofp_bad_instruction_code
161OFPBIC_UNKNOWN_INST = 0
162OFPBIC_UNSUP_INST = 1
163OFPBIC_BAD_TABLE_ID = 2
164OFPBIC_UNSUP_METADATA = 3
165OFPBIC_UNSUP_METADATA_MASK = 4
166OFPBIC_BAD_EXPERIMENTER = 5
Rich Lane6f4978c2013-10-20 21:33:52 -0700167OFPBIC_BAD_EXPERIMENTER_TYPE = 6
Rich Lanec2ee4b82013-04-24 17:12:38 -0700168OFPBIC_BAD_LEN = 7
169OFPBIC_EPERM = 8
170
171ofp_bad_instruction_code_map = {
172 0: 'OFPBIC_UNKNOWN_INST',
173 1: 'OFPBIC_UNSUP_INST',
174 2: 'OFPBIC_BAD_TABLE_ID',
175 3: 'OFPBIC_UNSUP_METADATA',
176 4: 'OFPBIC_UNSUP_METADATA_MASK',
177 5: 'OFPBIC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700178 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700179 7: 'OFPBIC_BAD_LEN',
180 8: 'OFPBIC_EPERM',
181}
182
183# Identifiers from group ofp_bad_match_code
184OFPBMC_BAD_TYPE = 0
185OFPBMC_BAD_LEN = 1
186OFPBMC_BAD_TAG = 2
187OFPBMC_BAD_DL_ADDR_MASK = 3
188OFPBMC_BAD_NW_ADDR_MASK = 4
189OFPBMC_BAD_WILDCARDS = 5
190OFPBMC_BAD_FIELD = 6
191OFPBMC_BAD_VALUE = 7
192OFPBMC_BAD_MASK = 8
193OFPBMC_BAD_PREREQ = 9
194OFPBMC_DUP_FIELD = 10
195OFPBMC_EPERM = 11
196
197ofp_bad_match_code_map = {
198 0: 'OFPBMC_BAD_TYPE',
199 1: 'OFPBMC_BAD_LEN',
200 2: 'OFPBMC_BAD_TAG',
201 3: 'OFPBMC_BAD_DL_ADDR_MASK',
202 4: 'OFPBMC_BAD_NW_ADDR_MASK',
203 5: 'OFPBMC_BAD_WILDCARDS',
204 6: 'OFPBMC_BAD_FIELD',
205 7: 'OFPBMC_BAD_VALUE',
206 8: 'OFPBMC_BAD_MASK',
207 9: 'OFPBMC_BAD_PREREQ',
208 10: 'OFPBMC_DUP_FIELD',
209 11: 'OFPBMC_EPERM',
210}
211
212# Identifiers from group ofp_bad_request_code
213OFPBRC_BAD_VERSION = 0
214OFPBRC_BAD_TYPE = 1
Rich Lane6f4978c2013-10-20 21:33:52 -0700215OFPBRC_BAD_STAT = 2
Rich Lanec2ee4b82013-04-24 17:12:38 -0700216OFPBRC_BAD_EXPERIMENTER = 3
Rich Lane6f4978c2013-10-20 21:33:52 -0700217OFPBRC_BAD_EXPERIMENTER_TYPE = 4
Rich Lanec2ee4b82013-04-24 17:12:38 -0700218OFPBRC_EPERM = 5
219OFPBRC_BAD_LEN = 6
220OFPBRC_BUFFER_EMPTY = 7
221OFPBRC_BUFFER_UNKNOWN = 8
222OFPBRC_BAD_TABLE_ID = 9
223OFPBRC_IS_SLAVE = 10
224OFPBRC_BAD_PORT = 11
225OFPBRC_BAD_PACKET = 12
226OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13
227
228ofp_bad_request_code_map = {
229 0: 'OFPBRC_BAD_VERSION',
230 1: 'OFPBRC_BAD_TYPE',
Rich Lane6f4978c2013-10-20 21:33:52 -0700231 2: 'OFPBRC_BAD_STAT',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700232 3: 'OFPBRC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700233 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700234 5: 'OFPBRC_EPERM',
235 6: 'OFPBRC_BAD_LEN',
236 7: 'OFPBRC_BUFFER_EMPTY',
237 8: 'OFPBRC_BUFFER_UNKNOWN',
238 9: 'OFPBRC_BAD_TABLE_ID',
239 10: 'OFPBRC_IS_SLAVE',
240 11: 'OFPBRC_BAD_PORT',
241 12: 'OFPBRC_BAD_PACKET',
242 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
243}
244
Rich Laneb41363b2015-07-08 15:42:38 -0700245# Identifiers from group ofp_bsn_anchor
246OFP_BSN_ANCHOR_PACKET_START = 0
247OFP_BSN_ANCHOR_L3_HEADER_START = 1
248OFP_BSN_ANCHOR_L4_HEADER_START = 2
249OFP_BSN_ANCHOR_L4_PAYLOAD_START = 3
250
251ofp_bsn_anchor_map = {
252 0: 'OFP_BSN_ANCHOR_PACKET_START',
253 1: 'OFP_BSN_ANCHOR_L3_HEADER_START',
254 2: 'OFP_BSN_ANCHOR_L4_HEADER_START',
255 3: 'OFP_BSN_ANCHOR_L4_PAYLOAD_START',
256}
257
Rich Lane5454b682014-01-14 17:07:36 -0800258# Identifiers from group ofp_bsn_controller_connection_state
259OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED = 0
260OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED = 1
261
262ofp_bsn_controller_connection_state_map = {
263 0: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED',
264 1: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED',
265}
266
267# Identifiers from group ofp_bsn_controller_role_reason
268OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST = 0
269OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG = 1
270OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER = 2
271
272ofp_bsn_controller_role_reason_map = {
273 0: 'OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST',
274 1: 'OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG',
275 2: 'OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER',
276}
277
Rich Lane2e079da2014-10-29 15:30:24 -0700278# 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
Rich Lane5587ab12014-06-30 11:19:09 -0700299# 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 Lane93b33132014-04-21 12:20:58 -0700325# 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
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700336OFP_BSN_PKTIN_FLAG_INGRESS_ACL = 1024
Rich Laneccd32ed2014-11-10 17:48:24 -0800337OFP_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 Lane93b33132014-04-21 12:20:58 -0700340
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',
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700352 1024: 'OFP_BSN_PKTIN_FLAG_INGRESS_ACL',
Rich Laneccd32ed2014-11-10 17:48:24 -0800353 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 Lane93b33132014-04-21 12:20:58 -0700356}
357
Rich Lane7dcdf022013-12-11 14:45:27 -0800358# 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
Rich Lane5587ab12014-06-30 11:19:09 -0700371OFP_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
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700381OFP_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 Lane7dcdf022013-12-11 14:45:27 -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',
Rich Lane5587ab12014-06-30 11:19:09 -0700401 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',
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700411 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 Lane7dcdf022013-12-11 14:45:27 -0800417}
418
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700419# 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
Rich Lane93b33132014-04-21 12:20:58 -0700442# 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
Rich Lane5587ab12014-06-30 11:19:09 -0700453# 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 Lane93b33132014-04-21 12:20:58 -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
Rich Lane5587ab12014-06-30 11:19:09 -0700464OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lanef9530c42014-09-15 09:59:43 -0700465OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
Rich Lane93b33132014-04-21 12:20:58 -0700466
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',
Rich Lane5587ab12014-06-30 11:19:09 -0700471 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lanef9530c42014-09-15 09:59:43 -0700472 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700473}
474
Dan Talaycof6202252013-07-02 01:00:29 -0700475# 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
Rich Laned53156a2013-08-05 17:17:33 -0700482# 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 Lane5587ab12014-06-30 11:19:09 -0700491# 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 Lanec2ee4b82013-04-24 17:12:38 -0700498# Identifiers from group ofp_capabilities
499OFPC_FLOW_STATS = 1
500OFPC_TABLE_STATS = 2
501OFPC_PORT_STATS = 4
502OFPC_GROUP_STATS = 8
503OFPC_IP_REASM = 32
504OFPC_QUEUE_STATS = 64
505OFPC_PORT_BLOCKED = 256
506
507ofp_capabilities_map = {
508 1: 'OFPC_FLOW_STATS',
509 2: 'OFPC_TABLE_STATS',
510 4: 'OFPC_PORT_STATS',
511 8: 'OFPC_GROUP_STATS',
512 32: 'OFPC_IP_REASM',
513 64: 'OFPC_QUEUE_STATS',
514 256: 'OFPC_PORT_BLOCKED',
515}
516
517# Identifiers from group ofp_config_flags
518OFPC_FRAG_NORMAL = 0
519OFPC_FRAG_DROP = 1
520OFPC_FRAG_REASM = 2
521OFPC_FRAG_MASK = 3
522
523ofp_config_flags_map = {
524 0: 'OFPC_FRAG_NORMAL',
525 1: 'OFPC_FRAG_DROP',
526 2: 'OFPC_FRAG_REASM',
527 3: 'OFPC_FRAG_MASK',
528}
529
530# Identifiers from group ofp_controller_max_len
531OFPCML_MAX = 65509
532OFPCML_NO_BUFFER = 65535
533
534ofp_controller_max_len_map = {
535 65509: 'OFPCML_MAX',
536 65535: 'OFPCML_NO_BUFFER',
537}
538
539# Identifiers from group ofp_controller_role
540OFPCR_ROLE_NOCHANGE = 0
541OFPCR_ROLE_EQUAL = 1
542OFPCR_ROLE_MASTER = 2
543OFPCR_ROLE_SLAVE = 3
544
545ofp_controller_role_map = {
546 0: 'OFPCR_ROLE_NOCHANGE',
547 1: 'OFPCR_ROLE_EQUAL',
548 2: 'OFPCR_ROLE_MASTER',
549 3: 'OFPCR_ROLE_SLAVE',
550}
551
552# Identifiers from group ofp_error_type
553OFPET_HELLO_FAILED = 0
554OFPET_BAD_REQUEST = 1
555OFPET_BAD_ACTION = 2
556OFPET_BAD_INSTRUCTION = 3
557OFPET_BAD_MATCH = 4
558OFPET_FLOW_MOD_FAILED = 5
559OFPET_GROUP_MOD_FAILED = 6
560OFPET_PORT_MOD_FAILED = 7
561OFPET_TABLE_MOD_FAILED = 8
562OFPET_QUEUE_OP_FAILED = 9
563OFPET_SWITCH_CONFIG_FAILED = 10
564OFPET_ROLE_REQUEST_FAILED = 11
565OFPET_METER_MOD_FAILED = 12
566OFPET_TABLE_FEATURES_FAILED = 13
567OFPET_EXPERIMENTER = 65535
568
569ofp_error_type_map = {
570 0: 'OFPET_HELLO_FAILED',
571 1: 'OFPET_BAD_REQUEST',
572 2: 'OFPET_BAD_ACTION',
573 3: 'OFPET_BAD_INSTRUCTION',
574 4: 'OFPET_BAD_MATCH',
575 5: 'OFPET_FLOW_MOD_FAILED',
576 6: 'OFPET_GROUP_MOD_FAILED',
577 7: 'OFPET_PORT_MOD_FAILED',
578 8: 'OFPET_TABLE_MOD_FAILED',
579 9: 'OFPET_QUEUE_OP_FAILED',
580 10: 'OFPET_SWITCH_CONFIG_FAILED',
581 11: 'OFPET_ROLE_REQUEST_FAILED',
582 12: 'OFPET_METER_MOD_FAILED',
583 13: 'OFPET_TABLE_FEATURES_FAILED',
584 65535: 'OFPET_EXPERIMENTER',
585}
586
587# Identifiers from group ofp_flow_mod_command
588OFPFC_ADD = 0
589OFPFC_MODIFY = 1
590OFPFC_MODIFY_STRICT = 2
591OFPFC_DELETE = 3
592OFPFC_DELETE_STRICT = 4
593
594ofp_flow_mod_command_map = {
595 0: 'OFPFC_ADD',
596 1: 'OFPFC_MODIFY',
597 2: 'OFPFC_MODIFY_STRICT',
598 3: 'OFPFC_DELETE',
599 4: 'OFPFC_DELETE_STRICT',
600}
601
602# Identifiers from group ofp_flow_mod_failed_code
603OFPFMFC_UNKNOWN = 0
604OFPFMFC_TABLE_FULL = 1
605OFPFMFC_BAD_TABLE_ID = 2
606OFPFMFC_OVERLAP = 3
607OFPFMFC_EPERM = 4
608OFPFMFC_BAD_TIMEOUT = 5
609OFPFMFC_BAD_COMMAND = 6
610OFPFMFC_BAD_FLAGS = 7
611
612ofp_flow_mod_failed_code_map = {
613 0: 'OFPFMFC_UNKNOWN',
614 1: 'OFPFMFC_TABLE_FULL',
615 2: 'OFPFMFC_BAD_TABLE_ID',
616 3: 'OFPFMFC_OVERLAP',
617 4: 'OFPFMFC_EPERM',
618 5: 'OFPFMFC_BAD_TIMEOUT',
619 6: 'OFPFMFC_BAD_COMMAND',
620 7: 'OFPFMFC_BAD_FLAGS',
621}
622
623# Identifiers from group ofp_flow_mod_flags
624OFPFF_SEND_FLOW_REM = 1
625OFPFF_CHECK_OVERLAP = 2
626OFPFF_RESET_COUNTS = 4
627OFPFF_NO_PKT_COUNTS = 8
628OFPFF_NO_BYT_COUNTS = 16
Rich Lane6f4978c2013-10-20 21:33:52 -0700629OFPFF_BSN_SEND_IDLE = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -0700630
631ofp_flow_mod_flags_map = {
632 1: 'OFPFF_SEND_FLOW_REM',
633 2: 'OFPFF_CHECK_OVERLAP',
634 4: 'OFPFF_RESET_COUNTS',
635 8: 'OFPFF_NO_PKT_COUNTS',
636 16: 'OFPFF_NO_BYT_COUNTS',
Rich Lane6f4978c2013-10-20 21:33:52 -0700637 128: 'OFPFF_BSN_SEND_IDLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700638}
639
640# Identifiers from group ofp_flow_removed_reason
641OFPRR_IDLE_TIMEOUT = 0
642OFPRR_HARD_TIMEOUT = 1
643OFPRR_DELETE = 2
644OFPRR_GROUP_DELETE = 3
645
646ofp_flow_removed_reason_map = {
647 0: 'OFPRR_IDLE_TIMEOUT',
648 1: 'OFPRR_HARD_TIMEOUT',
649 2: 'OFPRR_DELETE',
650 3: 'OFPRR_GROUP_DELETE',
651}
652
653# Identifiers from group ofp_group
654OFPG_MAX = 4294967040
655OFPG_ALL = 4294967292
656OFPG_ANY = 4294967295
657
658ofp_group_map = {
659 4294967040: 'OFPG_MAX',
660 4294967292: 'OFPG_ALL',
661 4294967295: 'OFPG_ANY',
662}
663
664# Identifiers from group ofp_group_capabilities
665OFPGFC_SELECT_WEIGHT = 1
666OFPGFC_SELECT_LIVENESS = 2
667OFPGFC_CHAINING = 4
668OFPGFC_CHAINING_CHECKS = 8
669
670ofp_group_capabilities_map = {
671 1: 'OFPGFC_SELECT_WEIGHT',
672 2: 'OFPGFC_SELECT_LIVENESS',
673 4: 'OFPGFC_CHAINING',
674 8: 'OFPGFC_CHAINING_CHECKS',
675}
676
677# Identifiers from group ofp_group_mod_command
678OFPGC_ADD = 0
679OFPGC_MODIFY = 1
680OFPGC_DELETE = 2
681
682ofp_group_mod_command_map = {
683 0: 'OFPGC_ADD',
684 1: 'OFPGC_MODIFY',
685 2: 'OFPGC_DELETE',
686}
687
688# Identifiers from group ofp_group_mod_failed_code
689OFPGMFC_GROUP_EXISTS = 0
690OFPGMFC_INVALID_GROUP = 1
691OFPGMFC_WEIGHT_UNSUPPORTED = 2
692OFPGMFC_OUT_OF_GROUPS = 3
693OFPGMFC_OUT_OF_BUCKETS = 4
694OFPGMFC_CHAINING_UNSUPPORTED = 5
695OFPGMFC_WATCH_UNSUPPORTED = 6
696OFPGMFC_LOOP = 7
697OFPGMFC_UNKNOWN_GROUP = 8
698OFPGMFC_CHAINED_GROUP = 9
699OFPGMFC_BAD_TYPE = 10
700OFPGMFC_BAD_COMMAND = 11
701OFPGMFC_BAD_BUCKET = 12
702OFPGMFC_BAD_WATCH = 13
703OFPGMFC_EPERM = 14
704
705ofp_group_mod_failed_code_map = {
706 0: 'OFPGMFC_GROUP_EXISTS',
707 1: 'OFPGMFC_INVALID_GROUP',
708 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
709 3: 'OFPGMFC_OUT_OF_GROUPS',
710 4: 'OFPGMFC_OUT_OF_BUCKETS',
711 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
712 6: 'OFPGMFC_WATCH_UNSUPPORTED',
713 7: 'OFPGMFC_LOOP',
714 8: 'OFPGMFC_UNKNOWN_GROUP',
715 9: 'OFPGMFC_CHAINED_GROUP',
716 10: 'OFPGMFC_BAD_TYPE',
717 11: 'OFPGMFC_BAD_COMMAND',
718 12: 'OFPGMFC_BAD_BUCKET',
719 13: 'OFPGMFC_BAD_WATCH',
720 14: 'OFPGMFC_EPERM',
721}
722
723# Identifiers from group ofp_group_type
724OFPGT_ALL = 0
725OFPGT_SELECT = 1
726OFPGT_INDIRECT = 2
727OFPGT_FF = 3
728
729ofp_group_type_map = {
730 0: 'OFPGT_ALL',
731 1: 'OFPGT_SELECT',
732 2: 'OFPGT_INDIRECT',
733 3: 'OFPGT_FF',
734}
735
736# Identifiers from group ofp_hello_elem_type
737OFPHET_VERSIONBITMAP = 1
738
739ofp_hello_elem_type_map = {
740 1: 'OFPHET_VERSIONBITMAP',
741}
742
743# Identifiers from group ofp_hello_failed_code
744OFPHFC_INCOMPATIBLE = 0
745OFPHFC_EPERM = 1
746
747ofp_hello_failed_code_map = {
748 0: 'OFPHFC_INCOMPATIBLE',
749 1: 'OFPHFC_EPERM',
750}
751
752# Identifiers from group ofp_instruction_type
753OFPIT_GOTO_TABLE = 1
754OFPIT_WRITE_METADATA = 2
755OFPIT_WRITE_ACTIONS = 3
756OFPIT_APPLY_ACTIONS = 4
757OFPIT_CLEAR_ACTIONS = 5
758OFPIT_METER = 6
759OFPIT_EXPERIMENTER = 65535
760
761ofp_instruction_type_map = {
762 1: 'OFPIT_GOTO_TABLE',
763 2: 'OFPIT_WRITE_METADATA',
764 3: 'OFPIT_WRITE_ACTIONS',
765 4: 'OFPIT_APPLY_ACTIONS',
766 5: 'OFPIT_CLEAR_ACTIONS',
767 6: 'OFPIT_METER',
768 65535: 'OFPIT_EXPERIMENTER',
769}
770
771# Identifiers from group ofp_ipv6exthdr_flags
772OFPIEH_NONEXT = 1
773OFPIEH_ESP = 2
774OFPIEH_AUTH = 4
775OFPIEH_DEST = 8
776OFPIEH_FRAG = 16
777OFPIEH_ROUTER = 32
778OFPIEH_HOP = 64
779OFPIEH_UNREP = 128
780OFPIEH_UNSEQ = 256
781
782ofp_ipv6exthdr_flags_map = {
783 1: 'OFPIEH_NONEXT',
784 2: 'OFPIEH_ESP',
785 4: 'OFPIEH_AUTH',
786 8: 'OFPIEH_DEST',
787 16: 'OFPIEH_FRAG',
788 32: 'OFPIEH_ROUTER',
789 64: 'OFPIEH_HOP',
790 128: 'OFPIEH_UNREP',
791 256: 'OFPIEH_UNSEQ',
792}
793
794# Identifiers from group ofp_match_type
795OFPMT_STANDARD = 0
796OFPMT_OXM = 1
797
798ofp_match_type_map = {
799 0: 'OFPMT_STANDARD',
800 1: 'OFPMT_OXM',
801}
802
803# Identifiers from group ofp_meter
804OFPM_MAX = 4294901760
805OFPM_SLOWPATH = 4294967293
806OFPM_CONTROLLER = 4294967294
807OFPM_ALL = 4294967295
808
809ofp_meter_map = {
810 4294901760: 'OFPM_MAX',
811 4294967293: 'OFPM_SLOWPATH',
812 4294967294: 'OFPM_CONTROLLER',
813 4294967295: 'OFPM_ALL',
814}
815
816# Identifiers from group ofp_meter_band_type
817OFPMBT_DROP = 1
818OFPMBT_DSCP_REMARK = 2
819OFPMBT_EXPERIMENTER = 65535
820
821ofp_meter_band_type_map = {
822 1: 'OFPMBT_DROP',
823 2: 'OFPMBT_DSCP_REMARK',
824 65535: 'OFPMBT_EXPERIMENTER',
825}
826
827# Identifiers from group ofp_meter_flags
828OFPMF_KBPS = 1
829OFPMF_PKTPS = 2
830OFPMF_BURST = 4
831OFPMF_STATS = 8
832
833ofp_meter_flags_map = {
834 1: 'OFPMF_KBPS',
835 2: 'OFPMF_PKTPS',
836 4: 'OFPMF_BURST',
837 8: 'OFPMF_STATS',
838}
839
840# Identifiers from group ofp_meter_mod_command
841OFPMC_ADD = 0
842OFPMC_MODIFY = 1
843OFPMC_DELETE = 2
844
845ofp_meter_mod_command_map = {
846 0: 'OFPMC_ADD',
847 1: 'OFPMC_MODIFY',
848 2: 'OFPMC_DELETE',
849}
850
851# Identifiers from group ofp_meter_mod_failed_code
852OFPMMFC_UNKNOWN = 0
853OFPMMFC_METER_EXISTS = 1
854OFPMMFC_INVALID_METER = 2
855OFPMMFC_UNKNOWN_METER = 3
856OFPMMFC_BAD_COMMAND = 4
857OFPMMFC_BAD_FLAGS = 5
858OFPMMFC_BAD_RATE = 6
859OFPMMFC_BAD_BURST = 7
860OFPMMFC_BAD_BAND = 8
861OFPMMFC_BAD_BAND_VALUE = 9
862OFPMMFC_OUT_OF_METERS = 10
863OFPMMFC_OUT_OF_BANDS = 11
864
865ofp_meter_mod_failed_code_map = {
866 0: 'OFPMMFC_UNKNOWN',
867 1: 'OFPMMFC_METER_EXISTS',
868 2: 'OFPMMFC_INVALID_METER',
869 3: 'OFPMMFC_UNKNOWN_METER',
870 4: 'OFPMMFC_BAD_COMMAND',
871 5: 'OFPMMFC_BAD_FLAGS',
872 6: 'OFPMMFC_BAD_RATE',
873 7: 'OFPMMFC_BAD_BURST',
874 8: 'OFPMMFC_BAD_BAND',
875 9: 'OFPMMFC_BAD_BAND_VALUE',
876 10: 'OFPMMFC_OUT_OF_METERS',
877 11: 'OFPMMFC_OUT_OF_BANDS',
878}
879
Rich Lanec2ee4b82013-04-24 17:12:38 -0700880# Identifiers from group ofp_oxm_class
881OFPXMC_NXM_0 = 0
882OFPXMC_NXM_1 = 1
883OFPXMC_OPENFLOW_BASIC = 32768
884OFPXMC_EXPERIMENTER = 65535
885
886ofp_oxm_class_map = {
887 0: 'OFPXMC_NXM_0',
888 1: 'OFPXMC_NXM_1',
889 32768: 'OFPXMC_OPENFLOW_BASIC',
890 65535: 'OFPXMC_EXPERIMENTER',
891}
892
893# Identifiers from group ofp_packet_in_reason
894OFPR_NO_MATCH = 0
895OFPR_ACTION = 1
896OFPR_INVALID_TTL = 2
Rich Laned9e3f7b2013-11-04 11:40:43 -0800897OFPR_BSN_NEW_HOST = 128
898OFPR_BSN_STATION_MOVE = 129
899OFPR_BSN_BAD_VLAN = 130
900OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131
Rich Lane5454b682014-01-14 17:07:36 -0800901OFPR_BSN_NO_ROUTE = 132
Rich Lane95f7fc92014-01-27 17:08:16 -0800902OFPR_BSN_ICMP_ECHO_REQUEST = 133
903OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134
904OFPR_BSN_DEST_HOST_UNREACHABLE = 135
905OFPR_BSN_DEST_PORT_UNREACHABLE = 136
906OFPR_BSN_FRAGMENTATION_REQUIRED = 137
907OFPR_BSN_ARP = 139
Rich Lane1b75abf2014-02-05 11:23:20 -0800908OFPR_BSN_DHCP = 140
Rich Lane9ec3fca2014-02-26 16:22:56 -0800909OFPR_BSN_DEBUG = 141
Rich Lanef50b7c32014-03-20 11:38:02 -0700910OFPR_BSN_PACKET_OF_DEATH = 142
Rich Lanec2ee4b82013-04-24 17:12:38 -0700911
912ofp_packet_in_reason_map = {
913 0: 'OFPR_NO_MATCH',
914 1: 'OFPR_ACTION',
915 2: 'OFPR_INVALID_TTL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800916 128: 'OFPR_BSN_NEW_HOST',
917 129: 'OFPR_BSN_STATION_MOVE',
918 130: 'OFPR_BSN_BAD_VLAN',
919 131: 'OFPR_BSN_DESTINATION_LOOKUP_FAILURE',
Rich Lane5454b682014-01-14 17:07:36 -0800920 132: 'OFPR_BSN_NO_ROUTE',
Rich Lane95f7fc92014-01-27 17:08:16 -0800921 133: 'OFPR_BSN_ICMP_ECHO_REQUEST',
922 134: 'OFPR_BSN_DEST_NETWORK_UNREACHABLE',
923 135: 'OFPR_BSN_DEST_HOST_UNREACHABLE',
924 136: 'OFPR_BSN_DEST_PORT_UNREACHABLE',
925 137: 'OFPR_BSN_FRAGMENTATION_REQUIRED',
926 139: 'OFPR_BSN_ARP',
Rich Lane1b75abf2014-02-05 11:23:20 -0800927 140: 'OFPR_BSN_DHCP',
Rich Lane9ec3fca2014-02-26 16:22:56 -0800928 141: 'OFPR_BSN_DEBUG',
Rich Lanef50b7c32014-03-20 11:38:02 -0700929 142: 'OFPR_BSN_PACKET_OF_DEATH',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700930}
931
932# Identifiers from group ofp_port
933OFPP_MAX = 4294967040
934OFPP_IN_PORT = 4294967288
935OFPP_TABLE = 4294967289
936OFPP_NORMAL = 4294967290
937OFPP_FLOOD = 4294967291
938OFPP_ALL = 4294967292
939OFPP_CONTROLLER = 4294967293
940OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800941OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700942
943ofp_port_map = {
944 4294967040: 'OFPP_MAX',
945 4294967288: 'OFPP_IN_PORT',
946 4294967289: 'OFPP_TABLE',
947 4294967290: 'OFPP_NORMAL',
948 4294967291: 'OFPP_FLOOD',
949 4294967292: 'OFPP_ALL',
950 4294967293: 'OFPP_CONTROLLER',
951 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800952 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700953}
954
955# Identifiers from group ofp_port_config
956OFPPC_PORT_DOWN = 1
957OFPPC_NO_RECV = 4
958OFPPC_NO_FWD = 32
959OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700960OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700961
962ofp_port_config_map = {
963 1: 'OFPPC_PORT_DOWN',
964 4: 'OFPPC_NO_RECV',
965 32: 'OFPPC_NO_FWD',
966 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700967 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700968}
969
970# Identifiers from group ofp_port_features
971OFPPF_10MB_HD = 1
972OFPPF_10MB_FD = 2
973OFPPF_100MB_HD = 4
974OFPPF_100MB_FD = 8
975OFPPF_1GB_HD = 16
976OFPPF_1GB_FD = 32
977OFPPF_10GB_FD = 64
978OFPPF_40GB_FD = 128
979OFPPF_100GB_FD = 256
980OFPPF_1TB_FD = 512
981OFPPF_OTHER = 1024
982OFPPF_COPPER = 2048
983OFPPF_FIBER = 4096
984OFPPF_AUTONEG = 8192
985OFPPF_PAUSE = 16384
986OFPPF_PAUSE_ASYM = 32768
Rich Laneccd32ed2014-11-10 17:48:24 -0800987OFPPF_BSN_BREAKOUT_CAPABLE = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700988
989ofp_port_features_map = {
990 1: 'OFPPF_10MB_HD',
991 2: 'OFPPF_10MB_FD',
992 4: 'OFPPF_100MB_HD',
993 8: 'OFPPF_100MB_FD',
994 16: 'OFPPF_1GB_HD',
995 32: 'OFPPF_1GB_FD',
996 64: 'OFPPF_10GB_FD',
997 128: 'OFPPF_40GB_FD',
998 256: 'OFPPF_100GB_FD',
999 512: 'OFPPF_1TB_FD',
1000 1024: 'OFPPF_OTHER',
1001 2048: 'OFPPF_COPPER',
1002 4096: 'OFPPF_FIBER',
1003 8192: 'OFPPF_AUTONEG',
1004 16384: 'OFPPF_PAUSE',
1005 32768: 'OFPPF_PAUSE_ASYM',
Rich Laneccd32ed2014-11-10 17:48:24 -08001006 2147483648: 'OFPPF_BSN_BREAKOUT_CAPABLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -07001007}
1008
1009# Identifiers from group ofp_port_mod_failed_code
1010OFPPMFC_BAD_PORT = 0
1011OFPPMFC_BAD_HW_ADDR = 1
1012OFPPMFC_BAD_CONFIG = 2
1013OFPPMFC_BAD_ADVERTISE = 3
1014OFPPMFC_EPERM = 4
1015
1016ofp_port_mod_failed_code_map = {
1017 0: 'OFPPMFC_BAD_PORT',
1018 1: 'OFPPMFC_BAD_HW_ADDR',
1019 2: 'OFPPMFC_BAD_CONFIG',
1020 3: 'OFPPMFC_BAD_ADVERTISE',
1021 4: 'OFPPMFC_EPERM',
1022}
1023
Rich Lanec2ee4b82013-04-24 17:12:38 -07001024# Identifiers from group ofp_port_reason
1025OFPPR_ADD = 0
1026OFPPR_DELETE = 1
1027OFPPR_MODIFY = 2
1028
1029ofp_port_reason_map = {
1030 0: 'OFPPR_ADD',
1031 1: 'OFPPR_DELETE',
1032 2: 'OFPPR_MODIFY',
1033}
1034
1035# Identifiers from group ofp_port_state
1036OFPPS_LINK_DOWN = 1
1037OFPPS_BLOCKED = 2
1038OFPPS_LIVE = 4
1039
1040ofp_port_state_map = {
1041 1: 'OFPPS_LINK_DOWN',
1042 2: 'OFPPS_BLOCKED',
1043 4: 'OFPPS_LIVE',
1044}
1045
1046# Identifiers from group ofp_queue_op_failed_code
1047OFPQOFC_BAD_PORT = 0
1048OFPQOFC_BAD_QUEUE = 1
1049OFPQOFC_EPERM = 2
1050
1051ofp_queue_op_failed_code_map = {
1052 0: 'OFPQOFC_BAD_PORT',
1053 1: 'OFPQOFC_BAD_QUEUE',
1054 2: 'OFPQOFC_EPERM',
1055}
1056
1057# Identifiers from group ofp_queue_properties
1058OFPQT_MIN_RATE = 1
1059OFPQT_MAX_RATE = 2
1060OFPQT_EXPERIMENTER = 65535
1061
1062ofp_queue_properties_map = {
1063 1: 'OFPQT_MIN_RATE',
1064 2: 'OFPQT_MAX_RATE',
1065 65535: 'OFPQT_EXPERIMENTER',
1066}
1067
1068# Identifiers from group ofp_role_request_failed_code
1069OFPRRFC_STALE = 0
1070OFPRRFC_UNSUP = 1
1071OFPRRFC_BAD_ROLE = 2
1072
1073ofp_role_request_failed_code_map = {
1074 0: 'OFPRRFC_STALE',
1075 1: 'OFPRRFC_UNSUP',
1076 2: 'OFPRRFC_BAD_ROLE',
1077}
1078
Rich Lane6f4978c2013-10-20 21:33:52 -07001079# Identifiers from group ofp_stats_reply_flags
1080OFPSF_REPLY_MORE = 1
1081
1082ofp_stats_reply_flags_map = {
1083 1: 'OFPSF_REPLY_MORE',
1084}
1085
1086# Identifiers from group ofp_stats_request_flags
1087OFPSF_REQ_MORE = 1
1088
1089ofp_stats_request_flags_map = {
1090 1: 'OFPSF_REQ_MORE',
1091}
1092
1093# Identifiers from group ofp_stats_type
1094OFPST_DESC = 0
1095OFPST_FLOW = 1
1096OFPST_AGGREGATE = 2
1097OFPST_TABLE = 3
1098OFPST_PORT = 4
1099OFPST_QUEUE = 5
1100OFPST_GROUP = 6
1101OFPST_GROUP_DESC = 7
1102OFPST_GROUP_FEATURES = 8
1103OFPST_METER = 9
1104OFPST_METER_CONFIG = 10
1105OFPST_METER_FEATURES = 11
1106OFPST_TABLE_FEATURES = 12
1107OFPST_PORT_DESC = 13
1108OFPST_EXPERIMENTER = 65535
1109
1110ofp_stats_type_map = {
1111 0: 'OFPST_DESC',
1112 1: 'OFPST_FLOW',
1113 2: 'OFPST_AGGREGATE',
1114 3: 'OFPST_TABLE',
1115 4: 'OFPST_PORT',
1116 5: 'OFPST_QUEUE',
1117 6: 'OFPST_GROUP',
1118 7: 'OFPST_GROUP_DESC',
1119 8: 'OFPST_GROUP_FEATURES',
1120 9: 'OFPST_METER',
1121 10: 'OFPST_METER_CONFIG',
1122 11: 'OFPST_METER_FEATURES',
1123 12: 'OFPST_TABLE_FEATURES',
1124 13: 'OFPST_PORT_DESC',
1125 65535: 'OFPST_EXPERIMENTER',
1126}
1127
Rich Lanec2ee4b82013-04-24 17:12:38 -07001128# Identifiers from group ofp_switch_config_failed_code
1129OFPSCFC_BAD_FLAGS = 0
1130OFPSCFC_BAD_LEN = 1
1131OFPSCFC_EPERM = 2
1132
1133ofp_switch_config_failed_code_map = {
1134 0: 'OFPSCFC_BAD_FLAGS',
1135 1: 'OFPSCFC_BAD_LEN',
1136 2: 'OFPSCFC_EPERM',
1137}
1138
1139# Identifiers from group ofp_table
1140OFPTT_MAX = 254
1141OFPTT_ALL = 255
1142
1143ofp_table_map = {
1144 254: 'OFPTT_MAX',
1145 255: 'OFPTT_ALL',
1146}
1147
1148# Identifiers from group ofp_table_config
1149OFPTC_DEPRECATED_MASK = 3
1150
1151ofp_table_config_map = {
1152 3: 'OFPTC_DEPRECATED_MASK',
1153}
1154
1155# Identifiers from group ofp_table_feature_prop_type
1156OFPTFPT_INSTRUCTIONS = 0
1157OFPTFPT_INSTRUCTIONS_MISS = 1
1158OFPTFPT_NEXT_TABLES = 2
1159OFPTFPT_NEXT_TABLES_MISS = 3
1160OFPTFPT_WRITE_ACTIONS = 4
1161OFPTFPT_WRITE_ACTIONS_MISS = 5
1162OFPTFPT_APPLY_ACTIONS = 6
1163OFPTFPT_APPLY_ACTIONS_MISS = 7
1164OFPTFPT_MATCH = 8
1165OFPTFPT_WILDCARDS = 10
1166OFPTFPT_WRITE_SETFIELD = 12
1167OFPTFPT_WRITE_SETFIELD_MISS = 13
1168OFPTFPT_APPLY_SETFIELD = 14
1169OFPTFPT_APPLY_SETFIELD_MISS = 15
1170OFPTFPT_EXPERIMENTER = 65534
1171OFPTFPT_EXPERIMENTER_MISS = 65535
1172
1173ofp_table_feature_prop_type_map = {
1174 0: 'OFPTFPT_INSTRUCTIONS',
1175 1: 'OFPTFPT_INSTRUCTIONS_MISS',
1176 2: 'OFPTFPT_NEXT_TABLES',
1177 3: 'OFPTFPT_NEXT_TABLES_MISS',
1178 4: 'OFPTFPT_WRITE_ACTIONS',
1179 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
1180 6: 'OFPTFPT_APPLY_ACTIONS',
1181 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
1182 8: 'OFPTFPT_MATCH',
1183 10: 'OFPTFPT_WILDCARDS',
1184 12: 'OFPTFPT_WRITE_SETFIELD',
1185 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
1186 14: 'OFPTFPT_APPLY_SETFIELD',
1187 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
1188 65534: 'OFPTFPT_EXPERIMENTER',
1189 65535: 'OFPTFPT_EXPERIMENTER_MISS',
1190}
1191
1192# Identifiers from group ofp_table_features_failed_code
1193OFPTFFC_BAD_TABLE = 0
1194OFPTFFC_BAD_METADATA = 1
1195OFPTFFC_BAD_TYPE = 2
1196OFPTFFC_BAD_LEN = 3
1197OFPTFFC_BAD_ARGUMENT = 4
1198OFPTFFC_EPERM = 5
1199
1200ofp_table_features_failed_code_map = {
1201 0: 'OFPTFFC_BAD_TABLE',
1202 1: 'OFPTFFC_BAD_METADATA',
1203 2: 'OFPTFFC_BAD_TYPE',
1204 3: 'OFPTFFC_BAD_LEN',
1205 4: 'OFPTFFC_BAD_ARGUMENT',
1206 5: 'OFPTFFC_EPERM',
1207}
1208
1209# Identifiers from group ofp_table_mod_failed_code
1210OFPTMFC_BAD_TABLE = 0
1211OFPTMFC_BAD_CONFIG = 1
1212OFPTMFC_EPERM = 2
1213
1214ofp_table_mod_failed_code_map = {
1215 0: 'OFPTMFC_BAD_TABLE',
1216 1: 'OFPTMFC_BAD_CONFIG',
1217 2: 'OFPTMFC_EPERM',
1218}
1219
1220# Identifiers from group ofp_type
1221OFPT_HELLO = 0
1222OFPT_ERROR = 1
1223OFPT_ECHO_REQUEST = 2
1224OFPT_ECHO_REPLY = 3
1225OFPT_EXPERIMENTER = 4
1226OFPT_FEATURES_REQUEST = 5
1227OFPT_FEATURES_REPLY = 6
1228OFPT_GET_CONFIG_REQUEST = 7
1229OFPT_GET_CONFIG_REPLY = 8
1230OFPT_SET_CONFIG = 9
1231OFPT_PACKET_IN = 10
1232OFPT_FLOW_REMOVED = 11
1233OFPT_PORT_STATUS = 12
1234OFPT_PACKET_OUT = 13
1235OFPT_FLOW_MOD = 14
1236OFPT_GROUP_MOD = 15
1237OFPT_PORT_MOD = 16
1238OFPT_TABLE_MOD = 17
Rich Lane6f4978c2013-10-20 21:33:52 -07001239OFPT_STATS_REQUEST = 18
1240OFPT_STATS_REPLY = 19
Rich Lanec2ee4b82013-04-24 17:12:38 -07001241OFPT_BARRIER_REQUEST = 20
1242OFPT_BARRIER_REPLY = 21
1243OFPT_QUEUE_GET_CONFIG_REQUEST = 22
1244OFPT_QUEUE_GET_CONFIG_REPLY = 23
1245OFPT_ROLE_REQUEST = 24
1246OFPT_ROLE_REPLY = 25
1247OFPT_GET_ASYNC_REQUEST = 26
1248OFPT_GET_ASYNC_REPLY = 27
1249OFPT_SET_ASYNC = 28
1250OFPT_METER_MOD = 29
1251
1252ofp_type_map = {
1253 0: 'OFPT_HELLO',
1254 1: 'OFPT_ERROR',
1255 2: 'OFPT_ECHO_REQUEST',
1256 3: 'OFPT_ECHO_REPLY',
1257 4: 'OFPT_EXPERIMENTER',
1258 5: 'OFPT_FEATURES_REQUEST',
1259 6: 'OFPT_FEATURES_REPLY',
1260 7: 'OFPT_GET_CONFIG_REQUEST',
1261 8: 'OFPT_GET_CONFIG_REPLY',
1262 9: 'OFPT_SET_CONFIG',
1263 10: 'OFPT_PACKET_IN',
1264 11: 'OFPT_FLOW_REMOVED',
1265 12: 'OFPT_PORT_STATUS',
1266 13: 'OFPT_PACKET_OUT',
1267 14: 'OFPT_FLOW_MOD',
1268 15: 'OFPT_GROUP_MOD',
1269 16: 'OFPT_PORT_MOD',
1270 17: 'OFPT_TABLE_MOD',
Rich Lane6f4978c2013-10-20 21:33:52 -07001271 18: 'OFPT_STATS_REQUEST',
1272 19: 'OFPT_STATS_REPLY',
Rich Lanec2ee4b82013-04-24 17:12:38 -07001273 20: 'OFPT_BARRIER_REQUEST',
1274 21: 'OFPT_BARRIER_REPLY',
1275 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
1276 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
1277 24: 'OFPT_ROLE_REQUEST',
1278 25: 'OFPT_ROLE_REPLY',
1279 26: 'OFPT_GET_ASYNC_REQUEST',
1280 27: 'OFPT_GET_ASYNC_REPLY',
1281 28: 'OFPT_SET_ASYNC',
1282 29: 'OFPT_METER_MOD',
1283}
1284
1285# Identifiers from group ofp_vlan_id
1286OFPVID_NONE = 0
1287OFPVID_PRESENT = 4096
1288
1289ofp_vlan_id_map = {
1290 0: 'OFPVID_NONE',
1291 4096: 'OFPVID_PRESENT',
1292}
1293