blob: fc0fd7bb77d0c11f74ae48d03002699a703ab967 [file] [log] [blame]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2# Copyright (c) 2011, 2012 Open Networking Foundation
3# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Dan Talaycof6202252013-07-02 01:00:29 -07004# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -07005
6# Automatically generated by LOXI from template const.py
7# Do not modify
8
9OFP_VERSION = 4
10
11# Identifiers from group macro_definitions
Rich Lanec2ee4b82013-04-24 17:12:38 -070012OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070013OFP_MAX_PORT_NAME_LEN = 16
Rich Lane6f4978c2013-10-20 21:33:52 -070014OFP_TCP_PORT = 6653
15OFP_SSL_PORT = 6653
Dan Talaycof6202252013-07-02 01:00:29 -070016OFP_ETH_ALEN = 6
17OFP_DEFAULT_MISS_SEND_LEN = 128
18OFP_VLAN_NONE = 0
19OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070020OFP_DEFAULT_PRIORITY = 32768
Rich Lanec2ee4b82013-04-24 17:12:38 -070021OFP_NO_BUFFER = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070022DESC_STR_LEN = 256
23SERIAL_NUM_LEN = 32
24OFPQ_ALL = 4294967295
25OFPQ_MAX_RATE_UNCFG = 65535
26OFPQ_MIN_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070027
Rich Lane2e079da2014-10-29 15:30:24 -070028# Identifiers from group of_bsn_lacp_convergence_status
Rich Lane7b0f2012013-11-22 14:15:26 -080029LACP_SUCCESS = 0
30LACP_TIMEDOUT = 1
31LACP_OUT_OF_SYNC = 2
32
Rich Lane2e079da2014-10-29 15:30:24 -070033of_bsn_lacp_convergence_status_map = {
Rich Lane7b0f2012013-11-22 14:15:26 -080034 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
Rich Lane6f4978c2013-10-20 21:33:52 -070040BSN_PDU_SLOT_NUM_ANY = 255
41
Rich Lane2e079da2014-10-29 15:30:24 -070042of_bsn_pdu_slot_num_map = {
Rich Lane6f4978c2013-10-20 21:33:52 -070043 255: 'BSN_PDU_SLOT_NUM_ANY',
44}
45
Rich Lane2e079da2014-10-29 15:30:24 -070046# Identifiers from group of_bsn_vlan_counter
Rich Lane7dcdf022013-12-11 14:45:27 -080047OFP_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
Rich Lane2e079da2014-10-29 15:30:24 -070052of_bsn_vlan_counter_map = {
Rich Lane7dcdf022013-12-11 14:45:27 -080053 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
Rich Lane2e079da2014-10-29 15:30:24 -070059# Identifiers from group of_bsn_vrf_counter
Rich Lane5587ab12014-06-30 11:19:09 -070060OFP_BSN_VRF_COUNTER_BYTES = 0
61OFP_BSN_VRF_COUNTER_PACKETS = 1
62
Rich Lane2e079da2014-10-29 15:30:24 -070063of_bsn_vrf_counter_map = {
Rich Lane5587ab12014-06-30 11:19:09 -070064 0: 'OFP_BSN_VRF_COUNTER_BYTES',
65 1: 'OFP_BSN_VRF_COUNTER_PACKETS',
66}
67
Rich Lanec2ee4b82013-04-24 17:12:38 -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_bad_action_code
108OFPBAC_BAD_TYPE = 0
109OFPBAC_BAD_LEN = 1
110OFPBAC_BAD_EXPERIMENTER = 2
Rich Lane6f4978c2013-10-20 21:33:52 -0700111OFPBAC_BAD_EXPERIMENTER_TYPE = 3
Rich Lanec2ee4b82013-04-24 17:12:38 -0700112OFPBAC_BAD_OUT_PORT = 4
113OFPBAC_BAD_ARGUMENT = 5
114OFPBAC_EPERM = 6
115OFPBAC_TOO_MANY = 7
116OFPBAC_BAD_QUEUE = 8
117OFPBAC_BAD_OUT_GROUP = 9
118OFPBAC_MATCH_INCONSISTENT = 10
119OFPBAC_UNSUPPORTED_ORDER = 11
120OFPBAC_BAD_TAG = 12
121OFPBAC_BAD_SET_TYPE = 13
122OFPBAC_BAD_SET_LEN = 14
123OFPBAC_BAD_SET_ARGUMENT = 15
124
125ofp_bad_action_code_map = {
126 0: 'OFPBAC_BAD_TYPE',
127 1: 'OFPBAC_BAD_LEN',
128 2: 'OFPBAC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700129 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700130 4: 'OFPBAC_BAD_OUT_PORT',
131 5: 'OFPBAC_BAD_ARGUMENT',
132 6: 'OFPBAC_EPERM',
133 7: 'OFPBAC_TOO_MANY',
134 8: 'OFPBAC_BAD_QUEUE',
135 9: 'OFPBAC_BAD_OUT_GROUP',
136 10: 'OFPBAC_MATCH_INCONSISTENT',
137 11: 'OFPBAC_UNSUPPORTED_ORDER',
138 12: 'OFPBAC_BAD_TAG',
139 13: 'OFPBAC_BAD_SET_TYPE',
140 14: 'OFPBAC_BAD_SET_LEN',
141 15: 'OFPBAC_BAD_SET_ARGUMENT',
142}
143
144# Identifiers from group ofp_bad_instruction_code
145OFPBIC_UNKNOWN_INST = 0
146OFPBIC_UNSUP_INST = 1
147OFPBIC_BAD_TABLE_ID = 2
148OFPBIC_UNSUP_METADATA = 3
149OFPBIC_UNSUP_METADATA_MASK = 4
150OFPBIC_BAD_EXPERIMENTER = 5
Rich Lane6f4978c2013-10-20 21:33:52 -0700151OFPBIC_BAD_EXPERIMENTER_TYPE = 6
Rich Lanec2ee4b82013-04-24 17:12:38 -0700152OFPBIC_BAD_LEN = 7
153OFPBIC_EPERM = 8
154
155ofp_bad_instruction_code_map = {
156 0: 'OFPBIC_UNKNOWN_INST',
157 1: 'OFPBIC_UNSUP_INST',
158 2: 'OFPBIC_BAD_TABLE_ID',
159 3: 'OFPBIC_UNSUP_METADATA',
160 4: 'OFPBIC_UNSUP_METADATA_MASK',
161 5: 'OFPBIC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700162 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700163 7: 'OFPBIC_BAD_LEN',
164 8: 'OFPBIC_EPERM',
165}
166
167# Identifiers from group ofp_bad_match_code
168OFPBMC_BAD_TYPE = 0
169OFPBMC_BAD_LEN = 1
170OFPBMC_BAD_TAG = 2
171OFPBMC_BAD_DL_ADDR_MASK = 3
172OFPBMC_BAD_NW_ADDR_MASK = 4
173OFPBMC_BAD_WILDCARDS = 5
174OFPBMC_BAD_FIELD = 6
175OFPBMC_BAD_VALUE = 7
176OFPBMC_BAD_MASK = 8
177OFPBMC_BAD_PREREQ = 9
178OFPBMC_DUP_FIELD = 10
179OFPBMC_EPERM = 11
180
181ofp_bad_match_code_map = {
182 0: 'OFPBMC_BAD_TYPE',
183 1: 'OFPBMC_BAD_LEN',
184 2: 'OFPBMC_BAD_TAG',
185 3: 'OFPBMC_BAD_DL_ADDR_MASK',
186 4: 'OFPBMC_BAD_NW_ADDR_MASK',
187 5: 'OFPBMC_BAD_WILDCARDS',
188 6: 'OFPBMC_BAD_FIELD',
189 7: 'OFPBMC_BAD_VALUE',
190 8: 'OFPBMC_BAD_MASK',
191 9: 'OFPBMC_BAD_PREREQ',
192 10: 'OFPBMC_DUP_FIELD',
193 11: 'OFPBMC_EPERM',
194}
195
196# Identifiers from group ofp_bad_request_code
197OFPBRC_BAD_VERSION = 0
198OFPBRC_BAD_TYPE = 1
Rich Lane6f4978c2013-10-20 21:33:52 -0700199OFPBRC_BAD_STAT = 2
Rich Lanec2ee4b82013-04-24 17:12:38 -0700200OFPBRC_BAD_EXPERIMENTER = 3
Rich Lane6f4978c2013-10-20 21:33:52 -0700201OFPBRC_BAD_EXPERIMENTER_TYPE = 4
Rich Lanec2ee4b82013-04-24 17:12:38 -0700202OFPBRC_EPERM = 5
203OFPBRC_BAD_LEN = 6
204OFPBRC_BUFFER_EMPTY = 7
205OFPBRC_BUFFER_UNKNOWN = 8
206OFPBRC_BAD_TABLE_ID = 9
207OFPBRC_IS_SLAVE = 10
208OFPBRC_BAD_PORT = 11
209OFPBRC_BAD_PACKET = 12
210OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13
211
212ofp_bad_request_code_map = {
213 0: 'OFPBRC_BAD_VERSION',
214 1: 'OFPBRC_BAD_TYPE',
Rich Lane6f4978c2013-10-20 21:33:52 -0700215 2: 'OFPBRC_BAD_STAT',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700216 3: 'OFPBRC_BAD_EXPERIMENTER',
Rich Lane6f4978c2013-10-20 21:33:52 -0700217 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700218 5: 'OFPBRC_EPERM',
219 6: 'OFPBRC_BAD_LEN',
220 7: 'OFPBRC_BUFFER_EMPTY',
221 8: 'OFPBRC_BUFFER_UNKNOWN',
222 9: 'OFPBRC_BAD_TABLE_ID',
223 10: 'OFPBRC_IS_SLAVE',
224 11: 'OFPBRC_BAD_PORT',
225 12: 'OFPBRC_BAD_PACKET',
226 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
227}
228
Rich Lane5454b682014-01-14 17:07:36 -0800229# Identifiers from group ofp_bsn_controller_connection_state
230OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED = 0
231OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED = 1
232
233ofp_bsn_controller_connection_state_map = {
234 0: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED',
235 1: 'OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED',
236}
237
238# Identifiers from group ofp_bsn_controller_role_reason
239OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST = 0
240OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG = 1
241OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER = 2
242
243ofp_bsn_controller_role_reason_map = {
244 0: 'OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST',
245 1: 'OFP_BSN_CONTROLLER_ROLE_REASON_CONFIG',
246 2: 'OFP_BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER',
247}
248
Rich Lane2e079da2014-10-29 15:30:24 -0700249# Identifiers from group ofp_bsn_lacp_state
250OFP_BSN_LACP_STATE_ACTIVITY = 1
251OFP_BSN_LACP_STATE_TIMEOUT = 2
252OFP_BSN_LACP_STATE_AGGREGATION = 4
253OFP_BSN_LACP_STATE_SYNCHRONIZATION = 8
254OFP_BSN_LACP_STATE_COLLECTING = 16
255OFP_BSN_LACP_STATE_DISTRIBUTING = 32
256OFP_BSN_LACP_STATE_DEFAULTED = 64
257OFP_BSN_LACP_STATE_EXPIRED = 128
258
259ofp_bsn_lacp_state_map = {
260 1: 'OFP_BSN_LACP_STATE_ACTIVITY',
261 2: 'OFP_BSN_LACP_STATE_TIMEOUT',
262 4: 'OFP_BSN_LACP_STATE_AGGREGATION',
263 8: 'OFP_BSN_LACP_STATE_SYNCHRONIZATION',
264 16: 'OFP_BSN_LACP_STATE_COLLECTING',
265 32: 'OFP_BSN_LACP_STATE_DISTRIBUTING',
266 64: 'OFP_BSN_LACP_STATE_DEFAULTED',
267 128: 'OFP_BSN_LACP_STATE_EXPIRED',
268}
269
Rich Lane5587ab12014-06-30 11:19:09 -0700270# Identifiers from group ofp_bsn_loglevel
271OFP_BSN_LOGLEVEL_MSG = 0
272OFP_BSN_LOGLEVEL_ERROR = 1
273OFP_BSN_LOGLEVEL_WARN = 2
274OFP_BSN_LOGLEVEL_INFO = 3
275OFP_BSN_LOGLEVEL_VERBOSE = 4
276OFP_BSN_LOGLEVEL_TRACE = 5
277
278ofp_bsn_loglevel_map = {
279 0: 'OFP_BSN_LOGLEVEL_MSG',
280 1: 'OFP_BSN_LOGLEVEL_ERROR',
281 2: 'OFP_BSN_LOGLEVEL_WARN',
282 3: 'OFP_BSN_LOGLEVEL_INFO',
283 4: 'OFP_BSN_LOGLEVEL_VERBOSE',
284 5: 'OFP_BSN_LOGLEVEL_TRACE',
285}
286
Rich Lane474324f2015-01-14 15:22:56 -0800287# Identifiers from group ofp_bsn_lua_upload_flags
288OFP_BSN_LUA_UPLOAD_MORE = 1
289OFP_BSN_LUA_UPLOAD_FORCE = 2
290
291ofp_bsn_lua_upload_flags_map = {
292 1: 'OFP_BSN_LUA_UPLOAD_MORE',
293 2: 'OFP_BSN_LUA_UPLOAD_FORCE',
294}
295
Rich Lane93b33132014-04-21 12:20:58 -0700296# Identifiers from group ofp_bsn_pktin_flag
297OFP_BSN_PKTIN_FLAG_PDU = 1
298OFP_BSN_PKTIN_FLAG_NEW_HOST = 2
299OFP_BSN_PKTIN_FLAG_STATION_MOVE = 4
300OFP_BSN_PKTIN_FLAG_ARP = 8
301OFP_BSN_PKTIN_FLAG_DHCP = 16
302OFP_BSN_PKTIN_FLAG_L2_CPU = 32
303OFP_BSN_PKTIN_FLAG_DEBUG = 64
304OFP_BSN_PKTIN_FLAG_TTL_EXPIRED = 128
305OFP_BSN_PKTIN_FLAG_L3_MISS = 256
306OFP_BSN_PKTIN_FLAG_L3_CPU = 512
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700307OFP_BSN_PKTIN_FLAG_INGRESS_ACL = 1024
Rich Laneccd32ed2014-11-10 17:48:24 -0800308OFP_BSN_PKTIN_FLAG_SFLOW = 2048
Rich Lane2d1b40e2015-02-11 12:45:33 -0800309OFP_BSN_PKTIN_FLAG_ARP_CACHE = 4096
Rich Lane7b69e792015-03-31 11:12:50 -0700310OFP_BSN_PKTIN_FLAG_ARP_TARGET = 8192
Rich Lane93b33132014-04-21 12:20:58 -0700311
312ofp_bsn_pktin_flag_map = {
313 1: 'OFP_BSN_PKTIN_FLAG_PDU',
314 2: 'OFP_BSN_PKTIN_FLAG_NEW_HOST',
315 4: 'OFP_BSN_PKTIN_FLAG_STATION_MOVE',
316 8: 'OFP_BSN_PKTIN_FLAG_ARP',
317 16: 'OFP_BSN_PKTIN_FLAG_DHCP',
318 32: 'OFP_BSN_PKTIN_FLAG_L2_CPU',
319 64: 'OFP_BSN_PKTIN_FLAG_DEBUG',
320 128: 'OFP_BSN_PKTIN_FLAG_TTL_EXPIRED',
321 256: 'OFP_BSN_PKTIN_FLAG_L3_MISS',
322 512: 'OFP_BSN_PKTIN_FLAG_L3_CPU',
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700323 1024: 'OFP_BSN_PKTIN_FLAG_INGRESS_ACL',
Rich Laneccd32ed2014-11-10 17:48:24 -0800324 2048: 'OFP_BSN_PKTIN_FLAG_SFLOW',
Rich Lane2d1b40e2015-02-11 12:45:33 -0800325 4096: 'OFP_BSN_PKTIN_FLAG_ARP_CACHE',
Rich Lane7b69e792015-03-31 11:12:50 -0700326 8192: 'OFP_BSN_PKTIN_FLAG_ARP_TARGET',
Rich Lane93b33132014-04-21 12:20:58 -0700327}
328
Rich Lane7dcdf022013-12-11 14:45:27 -0800329# Identifiers from group ofp_bsn_port_counter
330OFP_BSN_PORT_COUNTER_RX_BYTES = 0
331OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST = 1
332OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST = 2
333OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST = 3
334OFP_BSN_PORT_COUNTER_RX_DROPPED = 4
335OFP_BSN_PORT_COUNTER_RX_ERRORS = 5
336OFP_BSN_PORT_COUNTER_TX_BYTES = 6
337OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST = 7
338OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST = 8
339OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST = 9
340OFP_BSN_PORT_COUNTER_TX_DROPPED = 10
341OFP_BSN_PORT_COUNTER_TX_ERRORS = 11
Rich Lane5587ab12014-06-30 11:19:09 -0700342OFP_BSN_PORT_COUNTER_RX_RUNTS = 12
343OFP_BSN_PORT_COUNTER_RX_GIANTS = 13
344OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS = 14
345OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS = 15
346OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS = 16
347OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT = 17
348OFP_BSN_PORT_COUNTER_TX_COLLISIONS = 18
349OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS = 19
350OFP_BSN_PORT_COUNTER_TX_DEFERRED = 20
351OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT = 21
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700352OFP_BSN_PORT_COUNTER_RX_PACKETS = 22
353OFP_BSN_PORT_COUNTER_TX_PACKETS = 23
354OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS = 24
355OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS = 25
356OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS = 26
Rich Lane7dcdf022013-12-11 14:45:27 -0800357
358ofp_bsn_port_counter_map = {
359 0: 'OFP_BSN_PORT_COUNTER_RX_BYTES',
360 1: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST',
361 2: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST',
362 3: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST',
363 4: 'OFP_BSN_PORT_COUNTER_RX_DROPPED',
364 5: 'OFP_BSN_PORT_COUNTER_RX_ERRORS',
365 6: 'OFP_BSN_PORT_COUNTER_TX_BYTES',
366 7: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST',
367 8: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST',
368 9: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST',
369 10: 'OFP_BSN_PORT_COUNTER_TX_DROPPED',
370 11: 'OFP_BSN_PORT_COUNTER_TX_ERRORS',
Rich Lane5587ab12014-06-30 11:19:09 -0700371 12: 'OFP_BSN_PORT_COUNTER_RX_RUNTS',
372 13: 'OFP_BSN_PORT_COUNTER_RX_GIANTS',
373 14: 'OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS',
374 15: 'OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS',
375 16: 'OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS',
376 17: 'OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT',
377 18: 'OFP_BSN_PORT_COUNTER_TX_COLLISIONS',
378 19: 'OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS',
379 20: 'OFP_BSN_PORT_COUNTER_TX_DEFERRED',
380 21: 'OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT',
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700381 22: 'OFP_BSN_PORT_COUNTER_RX_PACKETS',
382 23: 'OFP_BSN_PORT_COUNTER_TX_PACKETS',
383 24: 'OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS',
384 25: 'OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS',
385 26: 'OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS',
Rich Lane7dcdf022013-12-11 14:45:27 -0800386}
387
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700388# Identifiers from group ofp_bsn_tcp_flag
389OFP_BSN_TCP_FLAG_FIN = 1
390OFP_BSN_TCP_FLAG_SYN = 2
391OFP_BSN_TCP_FLAG_RST = 4
392OFP_BSN_TCP_FLAG_PSH = 8
393OFP_BSN_TCP_FLAG_ACK = 16
394OFP_BSN_TCP_FLAG_URG = 32
395OFP_BSN_TCP_FLAG_ECE = 64
396OFP_BSN_TCP_FLAG_CWR = 128
397OFP_BSN_TCP_FLAG_NS = 256
398
399ofp_bsn_tcp_flag_map = {
400 1: 'OFP_BSN_TCP_FLAG_FIN',
401 2: 'OFP_BSN_TCP_FLAG_SYN',
402 4: 'OFP_BSN_TCP_FLAG_RST',
403 8: 'OFP_BSN_TCP_FLAG_PSH',
404 16: 'OFP_BSN_TCP_FLAG_ACK',
405 32: 'OFP_BSN_TCP_FLAG_URG',
406 64: 'OFP_BSN_TCP_FLAG_ECE',
407 128: 'OFP_BSN_TCP_FLAG_CWR',
408 256: 'OFP_BSN_TCP_FLAG_NS',
409}
410
Rich Lane93b33132014-04-21 12:20:58 -0700411# Identifiers from group ofp_bsn_udf_anchor
412OFP_BSN_UDF_ANCHOR_PACKET_START = 0
413OFP_BSN_UDF_ANCHOR_L3_HEADER_START = 1
414OFP_BSN_UDF_ANCHOR_L4_HEADER_START = 2
415
416ofp_bsn_udf_anchor_map = {
417 0: 'OFP_BSN_UDF_ANCHOR_PACKET_START',
418 1: 'OFP_BSN_UDF_ANCHOR_L3_HEADER_START',
419 2: 'OFP_BSN_UDF_ANCHOR_L4_HEADER_START',
420}
421
Rich Lane5587ab12014-06-30 11:19:09 -0700422# Identifiers from group ofp_bsn_vlan_counter_constants
423OFP_BSN_VLAN_ALL = 65535
424
425ofp_bsn_vlan_counter_constants_map = {
426 65535: 'OFP_BSN_VLAN_ALL',
427}
428
Rich Lane93b33132014-04-21 12:20:58 -0700429# Identifiers from group ofp_bsn_vport_l2gre_flags
430OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
431OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
432OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700433OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lanef9530c42014-09-15 09:59:43 -0700434OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
Rich Lane93b33132014-04-21 12:20:58 -0700435
436ofp_bsn_vport_l2gre_flags_map = {
437 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
438 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
439 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700440 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lanef9530c42014-09-15 09:59:43 -0700441 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700442}
443
Dan Talaycof6202252013-07-02 01:00:29 -0700444# Identifiers from group ofp_bsn_vport_q_in_q_untagged
445OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
446
447ofp_bsn_vport_q_in_q_untagged_map = {
448 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
449}
450
Rich Laned53156a2013-08-05 17:17:33 -0700451# Identifiers from group ofp_bsn_vport_status
452OF_BSN_VPORT_STATUS_OK = 0
453OF_BSN_VPORT_STATUS_FAILED = 1
454
455ofp_bsn_vport_status_map = {
456 0: 'OF_BSN_VPORT_STATUS_OK',
457 1: 'OF_BSN_VPORT_STATUS_FAILED',
458}
459
Rich Lane5587ab12014-06-30 11:19:09 -0700460# Identifiers from group ofp_bsn_vrf_counter_constants
461OFP_BSN_VRF_ALL = 4294967295
462
463ofp_bsn_vrf_counter_constants_map = {
464 4294967295: 'OFP_BSN_VRF_ALL',
465}
466
Rich Lanec2ee4b82013-04-24 17:12:38 -0700467# Identifiers from group ofp_capabilities
468OFPC_FLOW_STATS = 1
469OFPC_TABLE_STATS = 2
470OFPC_PORT_STATS = 4
471OFPC_GROUP_STATS = 8
472OFPC_IP_REASM = 32
473OFPC_QUEUE_STATS = 64
474OFPC_PORT_BLOCKED = 256
475
476ofp_capabilities_map = {
477 1: 'OFPC_FLOW_STATS',
478 2: 'OFPC_TABLE_STATS',
479 4: 'OFPC_PORT_STATS',
480 8: 'OFPC_GROUP_STATS',
481 32: 'OFPC_IP_REASM',
482 64: 'OFPC_QUEUE_STATS',
483 256: 'OFPC_PORT_BLOCKED',
484}
485
486# Identifiers from group ofp_config_flags
487OFPC_FRAG_NORMAL = 0
488OFPC_FRAG_DROP = 1
489OFPC_FRAG_REASM = 2
490OFPC_FRAG_MASK = 3
491
492ofp_config_flags_map = {
493 0: 'OFPC_FRAG_NORMAL',
494 1: 'OFPC_FRAG_DROP',
495 2: 'OFPC_FRAG_REASM',
496 3: 'OFPC_FRAG_MASK',
497}
498
499# Identifiers from group ofp_controller_max_len
500OFPCML_MAX = 65509
501OFPCML_NO_BUFFER = 65535
502
503ofp_controller_max_len_map = {
504 65509: 'OFPCML_MAX',
505 65535: 'OFPCML_NO_BUFFER',
506}
507
508# Identifiers from group ofp_controller_role
509OFPCR_ROLE_NOCHANGE = 0
510OFPCR_ROLE_EQUAL = 1
511OFPCR_ROLE_MASTER = 2
512OFPCR_ROLE_SLAVE = 3
513
514ofp_controller_role_map = {
515 0: 'OFPCR_ROLE_NOCHANGE',
516 1: 'OFPCR_ROLE_EQUAL',
517 2: 'OFPCR_ROLE_MASTER',
518 3: 'OFPCR_ROLE_SLAVE',
519}
520
521# Identifiers from group ofp_error_type
522OFPET_HELLO_FAILED = 0
523OFPET_BAD_REQUEST = 1
524OFPET_BAD_ACTION = 2
525OFPET_BAD_INSTRUCTION = 3
526OFPET_BAD_MATCH = 4
527OFPET_FLOW_MOD_FAILED = 5
528OFPET_GROUP_MOD_FAILED = 6
529OFPET_PORT_MOD_FAILED = 7
530OFPET_TABLE_MOD_FAILED = 8
531OFPET_QUEUE_OP_FAILED = 9
532OFPET_SWITCH_CONFIG_FAILED = 10
533OFPET_ROLE_REQUEST_FAILED = 11
534OFPET_METER_MOD_FAILED = 12
535OFPET_TABLE_FEATURES_FAILED = 13
536OFPET_EXPERIMENTER = 65535
537
538ofp_error_type_map = {
539 0: 'OFPET_HELLO_FAILED',
540 1: 'OFPET_BAD_REQUEST',
541 2: 'OFPET_BAD_ACTION',
542 3: 'OFPET_BAD_INSTRUCTION',
543 4: 'OFPET_BAD_MATCH',
544 5: 'OFPET_FLOW_MOD_FAILED',
545 6: 'OFPET_GROUP_MOD_FAILED',
546 7: 'OFPET_PORT_MOD_FAILED',
547 8: 'OFPET_TABLE_MOD_FAILED',
548 9: 'OFPET_QUEUE_OP_FAILED',
549 10: 'OFPET_SWITCH_CONFIG_FAILED',
550 11: 'OFPET_ROLE_REQUEST_FAILED',
551 12: 'OFPET_METER_MOD_FAILED',
552 13: 'OFPET_TABLE_FEATURES_FAILED',
553 65535: 'OFPET_EXPERIMENTER',
554}
555
556# Identifiers from group ofp_flow_mod_command
557OFPFC_ADD = 0
558OFPFC_MODIFY = 1
559OFPFC_MODIFY_STRICT = 2
560OFPFC_DELETE = 3
561OFPFC_DELETE_STRICT = 4
562
563ofp_flow_mod_command_map = {
564 0: 'OFPFC_ADD',
565 1: 'OFPFC_MODIFY',
566 2: 'OFPFC_MODIFY_STRICT',
567 3: 'OFPFC_DELETE',
568 4: 'OFPFC_DELETE_STRICT',
569}
570
571# Identifiers from group ofp_flow_mod_failed_code
572OFPFMFC_UNKNOWN = 0
573OFPFMFC_TABLE_FULL = 1
574OFPFMFC_BAD_TABLE_ID = 2
575OFPFMFC_OVERLAP = 3
576OFPFMFC_EPERM = 4
577OFPFMFC_BAD_TIMEOUT = 5
578OFPFMFC_BAD_COMMAND = 6
579OFPFMFC_BAD_FLAGS = 7
580
581ofp_flow_mod_failed_code_map = {
582 0: 'OFPFMFC_UNKNOWN',
583 1: 'OFPFMFC_TABLE_FULL',
584 2: 'OFPFMFC_BAD_TABLE_ID',
585 3: 'OFPFMFC_OVERLAP',
586 4: 'OFPFMFC_EPERM',
587 5: 'OFPFMFC_BAD_TIMEOUT',
588 6: 'OFPFMFC_BAD_COMMAND',
589 7: 'OFPFMFC_BAD_FLAGS',
590}
591
592# Identifiers from group ofp_flow_mod_flags
593OFPFF_SEND_FLOW_REM = 1
594OFPFF_CHECK_OVERLAP = 2
595OFPFF_RESET_COUNTS = 4
596OFPFF_NO_PKT_COUNTS = 8
597OFPFF_NO_BYT_COUNTS = 16
Rich Lane6f4978c2013-10-20 21:33:52 -0700598OFPFF_BSN_SEND_IDLE = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -0700599
600ofp_flow_mod_flags_map = {
601 1: 'OFPFF_SEND_FLOW_REM',
602 2: 'OFPFF_CHECK_OVERLAP',
603 4: 'OFPFF_RESET_COUNTS',
604 8: 'OFPFF_NO_PKT_COUNTS',
605 16: 'OFPFF_NO_BYT_COUNTS',
Rich Lane6f4978c2013-10-20 21:33:52 -0700606 128: 'OFPFF_BSN_SEND_IDLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700607}
608
609# Identifiers from group ofp_flow_removed_reason
610OFPRR_IDLE_TIMEOUT = 0
611OFPRR_HARD_TIMEOUT = 1
612OFPRR_DELETE = 2
613OFPRR_GROUP_DELETE = 3
614
615ofp_flow_removed_reason_map = {
616 0: 'OFPRR_IDLE_TIMEOUT',
617 1: 'OFPRR_HARD_TIMEOUT',
618 2: 'OFPRR_DELETE',
619 3: 'OFPRR_GROUP_DELETE',
620}
621
622# Identifiers from group ofp_group
623OFPG_MAX = 4294967040
624OFPG_ALL = 4294967292
625OFPG_ANY = 4294967295
626
627ofp_group_map = {
628 4294967040: 'OFPG_MAX',
629 4294967292: 'OFPG_ALL',
630 4294967295: 'OFPG_ANY',
631}
632
633# Identifiers from group ofp_group_capabilities
634OFPGFC_SELECT_WEIGHT = 1
635OFPGFC_SELECT_LIVENESS = 2
636OFPGFC_CHAINING = 4
637OFPGFC_CHAINING_CHECKS = 8
638
639ofp_group_capabilities_map = {
640 1: 'OFPGFC_SELECT_WEIGHT',
641 2: 'OFPGFC_SELECT_LIVENESS',
642 4: 'OFPGFC_CHAINING',
643 8: 'OFPGFC_CHAINING_CHECKS',
644}
645
646# Identifiers from group ofp_group_mod_command
647OFPGC_ADD = 0
648OFPGC_MODIFY = 1
649OFPGC_DELETE = 2
650
651ofp_group_mod_command_map = {
652 0: 'OFPGC_ADD',
653 1: 'OFPGC_MODIFY',
654 2: 'OFPGC_DELETE',
655}
656
657# Identifiers from group ofp_group_mod_failed_code
658OFPGMFC_GROUP_EXISTS = 0
659OFPGMFC_INVALID_GROUP = 1
660OFPGMFC_WEIGHT_UNSUPPORTED = 2
661OFPGMFC_OUT_OF_GROUPS = 3
662OFPGMFC_OUT_OF_BUCKETS = 4
663OFPGMFC_CHAINING_UNSUPPORTED = 5
664OFPGMFC_WATCH_UNSUPPORTED = 6
665OFPGMFC_LOOP = 7
666OFPGMFC_UNKNOWN_GROUP = 8
667OFPGMFC_CHAINED_GROUP = 9
668OFPGMFC_BAD_TYPE = 10
669OFPGMFC_BAD_COMMAND = 11
670OFPGMFC_BAD_BUCKET = 12
671OFPGMFC_BAD_WATCH = 13
672OFPGMFC_EPERM = 14
673
674ofp_group_mod_failed_code_map = {
675 0: 'OFPGMFC_GROUP_EXISTS',
676 1: 'OFPGMFC_INVALID_GROUP',
677 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
678 3: 'OFPGMFC_OUT_OF_GROUPS',
679 4: 'OFPGMFC_OUT_OF_BUCKETS',
680 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
681 6: 'OFPGMFC_WATCH_UNSUPPORTED',
682 7: 'OFPGMFC_LOOP',
683 8: 'OFPGMFC_UNKNOWN_GROUP',
684 9: 'OFPGMFC_CHAINED_GROUP',
685 10: 'OFPGMFC_BAD_TYPE',
686 11: 'OFPGMFC_BAD_COMMAND',
687 12: 'OFPGMFC_BAD_BUCKET',
688 13: 'OFPGMFC_BAD_WATCH',
689 14: 'OFPGMFC_EPERM',
690}
691
692# Identifiers from group ofp_group_type
693OFPGT_ALL = 0
694OFPGT_SELECT = 1
695OFPGT_INDIRECT = 2
696OFPGT_FF = 3
697
698ofp_group_type_map = {
699 0: 'OFPGT_ALL',
700 1: 'OFPGT_SELECT',
701 2: 'OFPGT_INDIRECT',
702 3: 'OFPGT_FF',
703}
704
705# Identifiers from group ofp_hello_elem_type
706OFPHET_VERSIONBITMAP = 1
707
708ofp_hello_elem_type_map = {
709 1: 'OFPHET_VERSIONBITMAP',
710}
711
712# Identifiers from group ofp_hello_failed_code
713OFPHFC_INCOMPATIBLE = 0
714OFPHFC_EPERM = 1
715
716ofp_hello_failed_code_map = {
717 0: 'OFPHFC_INCOMPATIBLE',
718 1: 'OFPHFC_EPERM',
719}
720
721# Identifiers from group ofp_instruction_type
722OFPIT_GOTO_TABLE = 1
723OFPIT_WRITE_METADATA = 2
724OFPIT_WRITE_ACTIONS = 3
725OFPIT_APPLY_ACTIONS = 4
726OFPIT_CLEAR_ACTIONS = 5
727OFPIT_METER = 6
728OFPIT_EXPERIMENTER = 65535
729
730ofp_instruction_type_map = {
731 1: 'OFPIT_GOTO_TABLE',
732 2: 'OFPIT_WRITE_METADATA',
733 3: 'OFPIT_WRITE_ACTIONS',
734 4: 'OFPIT_APPLY_ACTIONS',
735 5: 'OFPIT_CLEAR_ACTIONS',
736 6: 'OFPIT_METER',
737 65535: 'OFPIT_EXPERIMENTER',
738}
739
740# Identifiers from group ofp_ipv6exthdr_flags
741OFPIEH_NONEXT = 1
742OFPIEH_ESP = 2
743OFPIEH_AUTH = 4
744OFPIEH_DEST = 8
745OFPIEH_FRAG = 16
746OFPIEH_ROUTER = 32
747OFPIEH_HOP = 64
748OFPIEH_UNREP = 128
749OFPIEH_UNSEQ = 256
750
751ofp_ipv6exthdr_flags_map = {
752 1: 'OFPIEH_NONEXT',
753 2: 'OFPIEH_ESP',
754 4: 'OFPIEH_AUTH',
755 8: 'OFPIEH_DEST',
756 16: 'OFPIEH_FRAG',
757 32: 'OFPIEH_ROUTER',
758 64: 'OFPIEH_HOP',
759 128: 'OFPIEH_UNREP',
760 256: 'OFPIEH_UNSEQ',
761}
762
763# Identifiers from group ofp_match_type
764OFPMT_STANDARD = 0
765OFPMT_OXM = 1
766
767ofp_match_type_map = {
768 0: 'OFPMT_STANDARD',
769 1: 'OFPMT_OXM',
770}
771
772# Identifiers from group ofp_meter
773OFPM_MAX = 4294901760
774OFPM_SLOWPATH = 4294967293
775OFPM_CONTROLLER = 4294967294
776OFPM_ALL = 4294967295
777
778ofp_meter_map = {
779 4294901760: 'OFPM_MAX',
780 4294967293: 'OFPM_SLOWPATH',
781 4294967294: 'OFPM_CONTROLLER',
782 4294967295: 'OFPM_ALL',
783}
784
785# Identifiers from group ofp_meter_band_type
786OFPMBT_DROP = 1
787OFPMBT_DSCP_REMARK = 2
788OFPMBT_EXPERIMENTER = 65535
789
790ofp_meter_band_type_map = {
791 1: 'OFPMBT_DROP',
792 2: 'OFPMBT_DSCP_REMARK',
793 65535: 'OFPMBT_EXPERIMENTER',
794}
795
796# Identifiers from group ofp_meter_flags
797OFPMF_KBPS = 1
798OFPMF_PKTPS = 2
799OFPMF_BURST = 4
800OFPMF_STATS = 8
801
802ofp_meter_flags_map = {
803 1: 'OFPMF_KBPS',
804 2: 'OFPMF_PKTPS',
805 4: 'OFPMF_BURST',
806 8: 'OFPMF_STATS',
807}
808
809# Identifiers from group ofp_meter_mod_command
810OFPMC_ADD = 0
811OFPMC_MODIFY = 1
812OFPMC_DELETE = 2
813
814ofp_meter_mod_command_map = {
815 0: 'OFPMC_ADD',
816 1: 'OFPMC_MODIFY',
817 2: 'OFPMC_DELETE',
818}
819
820# Identifiers from group ofp_meter_mod_failed_code
821OFPMMFC_UNKNOWN = 0
822OFPMMFC_METER_EXISTS = 1
823OFPMMFC_INVALID_METER = 2
824OFPMMFC_UNKNOWN_METER = 3
825OFPMMFC_BAD_COMMAND = 4
826OFPMMFC_BAD_FLAGS = 5
827OFPMMFC_BAD_RATE = 6
828OFPMMFC_BAD_BURST = 7
829OFPMMFC_BAD_BAND = 8
830OFPMMFC_BAD_BAND_VALUE = 9
831OFPMMFC_OUT_OF_METERS = 10
832OFPMMFC_OUT_OF_BANDS = 11
833
834ofp_meter_mod_failed_code_map = {
835 0: 'OFPMMFC_UNKNOWN',
836 1: 'OFPMMFC_METER_EXISTS',
837 2: 'OFPMMFC_INVALID_METER',
838 3: 'OFPMMFC_UNKNOWN_METER',
839 4: 'OFPMMFC_BAD_COMMAND',
840 5: 'OFPMMFC_BAD_FLAGS',
841 6: 'OFPMMFC_BAD_RATE',
842 7: 'OFPMMFC_BAD_BURST',
843 8: 'OFPMMFC_BAD_BAND',
844 9: 'OFPMMFC_BAD_BAND_VALUE',
845 10: 'OFPMMFC_OUT_OF_METERS',
846 11: 'OFPMMFC_OUT_OF_BANDS',
847}
848
Rich Lanec2ee4b82013-04-24 17:12:38 -0700849# Identifiers from group ofp_oxm_class
850OFPXMC_NXM_0 = 0
851OFPXMC_NXM_1 = 1
852OFPXMC_OPENFLOW_BASIC = 32768
853OFPXMC_EXPERIMENTER = 65535
854
855ofp_oxm_class_map = {
856 0: 'OFPXMC_NXM_0',
857 1: 'OFPXMC_NXM_1',
858 32768: 'OFPXMC_OPENFLOW_BASIC',
859 65535: 'OFPXMC_EXPERIMENTER',
860}
861
862# Identifiers from group ofp_packet_in_reason
863OFPR_NO_MATCH = 0
864OFPR_ACTION = 1
865OFPR_INVALID_TTL = 2
Rich Laned9e3f7b2013-11-04 11:40:43 -0800866OFPR_BSN_NEW_HOST = 128
867OFPR_BSN_STATION_MOVE = 129
868OFPR_BSN_BAD_VLAN = 130
869OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131
Rich Lane5454b682014-01-14 17:07:36 -0800870OFPR_BSN_NO_ROUTE = 132
Rich Lane95f7fc92014-01-27 17:08:16 -0800871OFPR_BSN_ICMP_ECHO_REQUEST = 133
872OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134
873OFPR_BSN_DEST_HOST_UNREACHABLE = 135
874OFPR_BSN_DEST_PORT_UNREACHABLE = 136
875OFPR_BSN_FRAGMENTATION_REQUIRED = 137
876OFPR_BSN_ARP = 139
Rich Lane1b75abf2014-02-05 11:23:20 -0800877OFPR_BSN_DHCP = 140
Rich Lane9ec3fca2014-02-26 16:22:56 -0800878OFPR_BSN_DEBUG = 141
Rich Lanef50b7c32014-03-20 11:38:02 -0700879OFPR_BSN_PACKET_OF_DEATH = 142
Rich Lanec2ee4b82013-04-24 17:12:38 -0700880
881ofp_packet_in_reason_map = {
882 0: 'OFPR_NO_MATCH',
883 1: 'OFPR_ACTION',
884 2: 'OFPR_INVALID_TTL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800885 128: 'OFPR_BSN_NEW_HOST',
886 129: 'OFPR_BSN_STATION_MOVE',
887 130: 'OFPR_BSN_BAD_VLAN',
888 131: 'OFPR_BSN_DESTINATION_LOOKUP_FAILURE',
Rich Lane5454b682014-01-14 17:07:36 -0800889 132: 'OFPR_BSN_NO_ROUTE',
Rich Lane95f7fc92014-01-27 17:08:16 -0800890 133: 'OFPR_BSN_ICMP_ECHO_REQUEST',
891 134: 'OFPR_BSN_DEST_NETWORK_UNREACHABLE',
892 135: 'OFPR_BSN_DEST_HOST_UNREACHABLE',
893 136: 'OFPR_BSN_DEST_PORT_UNREACHABLE',
894 137: 'OFPR_BSN_FRAGMENTATION_REQUIRED',
895 139: 'OFPR_BSN_ARP',
Rich Lane1b75abf2014-02-05 11:23:20 -0800896 140: 'OFPR_BSN_DHCP',
Rich Lane9ec3fca2014-02-26 16:22:56 -0800897 141: 'OFPR_BSN_DEBUG',
Rich Lanef50b7c32014-03-20 11:38:02 -0700898 142: 'OFPR_BSN_PACKET_OF_DEATH',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700899}
900
901# Identifiers from group ofp_port
902OFPP_MAX = 4294967040
903OFPP_IN_PORT = 4294967288
904OFPP_TABLE = 4294967289
905OFPP_NORMAL = 4294967290
906OFPP_FLOOD = 4294967291
907OFPP_ALL = 4294967292
908OFPP_CONTROLLER = 4294967293
909OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800910OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700911
912ofp_port_map = {
913 4294967040: 'OFPP_MAX',
914 4294967288: 'OFPP_IN_PORT',
915 4294967289: 'OFPP_TABLE',
916 4294967290: 'OFPP_NORMAL',
917 4294967291: 'OFPP_FLOOD',
918 4294967292: 'OFPP_ALL',
919 4294967293: 'OFPP_CONTROLLER',
920 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800921 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700922}
923
924# Identifiers from group ofp_port_config
925OFPPC_PORT_DOWN = 1
926OFPPC_NO_RECV = 4
927OFPPC_NO_FWD = 32
928OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700929OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700930
931ofp_port_config_map = {
932 1: 'OFPPC_PORT_DOWN',
933 4: 'OFPPC_NO_RECV',
934 32: 'OFPPC_NO_FWD',
935 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700936 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700937}
938
939# Identifiers from group ofp_port_features
940OFPPF_10MB_HD = 1
941OFPPF_10MB_FD = 2
942OFPPF_100MB_HD = 4
943OFPPF_100MB_FD = 8
944OFPPF_1GB_HD = 16
945OFPPF_1GB_FD = 32
946OFPPF_10GB_FD = 64
947OFPPF_40GB_FD = 128
948OFPPF_100GB_FD = 256
949OFPPF_1TB_FD = 512
950OFPPF_OTHER = 1024
951OFPPF_COPPER = 2048
952OFPPF_FIBER = 4096
953OFPPF_AUTONEG = 8192
954OFPPF_PAUSE = 16384
955OFPPF_PAUSE_ASYM = 32768
Rich Laneccd32ed2014-11-10 17:48:24 -0800956OFPPF_BSN_BREAKOUT_CAPABLE = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700957
958ofp_port_features_map = {
959 1: 'OFPPF_10MB_HD',
960 2: 'OFPPF_10MB_FD',
961 4: 'OFPPF_100MB_HD',
962 8: 'OFPPF_100MB_FD',
963 16: 'OFPPF_1GB_HD',
964 32: 'OFPPF_1GB_FD',
965 64: 'OFPPF_10GB_FD',
966 128: 'OFPPF_40GB_FD',
967 256: 'OFPPF_100GB_FD',
968 512: 'OFPPF_1TB_FD',
969 1024: 'OFPPF_OTHER',
970 2048: 'OFPPF_COPPER',
971 4096: 'OFPPF_FIBER',
972 8192: 'OFPPF_AUTONEG',
973 16384: 'OFPPF_PAUSE',
974 32768: 'OFPPF_PAUSE_ASYM',
Rich Laneccd32ed2014-11-10 17:48:24 -0800975 2147483648: 'OFPPF_BSN_BREAKOUT_CAPABLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700976}
977
978# Identifiers from group ofp_port_mod_failed_code
979OFPPMFC_BAD_PORT = 0
980OFPPMFC_BAD_HW_ADDR = 1
981OFPPMFC_BAD_CONFIG = 2
982OFPPMFC_BAD_ADVERTISE = 3
983OFPPMFC_EPERM = 4
984
985ofp_port_mod_failed_code_map = {
986 0: 'OFPPMFC_BAD_PORT',
987 1: 'OFPPMFC_BAD_HW_ADDR',
988 2: 'OFPPMFC_BAD_CONFIG',
989 3: 'OFPPMFC_BAD_ADVERTISE',
990 4: 'OFPPMFC_EPERM',
991}
992
Rich Lanec2ee4b82013-04-24 17:12:38 -0700993# Identifiers from group ofp_port_reason
994OFPPR_ADD = 0
995OFPPR_DELETE = 1
996OFPPR_MODIFY = 2
997
998ofp_port_reason_map = {
999 0: 'OFPPR_ADD',
1000 1: 'OFPPR_DELETE',
1001 2: 'OFPPR_MODIFY',
1002}
1003
1004# Identifiers from group ofp_port_state
1005OFPPS_LINK_DOWN = 1
1006OFPPS_BLOCKED = 2
1007OFPPS_LIVE = 4
1008
1009ofp_port_state_map = {
1010 1: 'OFPPS_LINK_DOWN',
1011 2: 'OFPPS_BLOCKED',
1012 4: 'OFPPS_LIVE',
1013}
1014
1015# Identifiers from group ofp_queue_op_failed_code
1016OFPQOFC_BAD_PORT = 0
1017OFPQOFC_BAD_QUEUE = 1
1018OFPQOFC_EPERM = 2
1019
1020ofp_queue_op_failed_code_map = {
1021 0: 'OFPQOFC_BAD_PORT',
1022 1: 'OFPQOFC_BAD_QUEUE',
1023 2: 'OFPQOFC_EPERM',
1024}
1025
1026# Identifiers from group ofp_queue_properties
1027OFPQT_MIN_RATE = 1
1028OFPQT_MAX_RATE = 2
1029OFPQT_EXPERIMENTER = 65535
1030
1031ofp_queue_properties_map = {
1032 1: 'OFPQT_MIN_RATE',
1033 2: 'OFPQT_MAX_RATE',
1034 65535: 'OFPQT_EXPERIMENTER',
1035}
1036
1037# Identifiers from group ofp_role_request_failed_code
1038OFPRRFC_STALE = 0
1039OFPRRFC_UNSUP = 1
1040OFPRRFC_BAD_ROLE = 2
1041
1042ofp_role_request_failed_code_map = {
1043 0: 'OFPRRFC_STALE',
1044 1: 'OFPRRFC_UNSUP',
1045 2: 'OFPRRFC_BAD_ROLE',
1046}
1047
Rich Lane6f4978c2013-10-20 21:33:52 -07001048# Identifiers from group ofp_stats_reply_flags
1049OFPSF_REPLY_MORE = 1
1050
1051ofp_stats_reply_flags_map = {
1052 1: 'OFPSF_REPLY_MORE',
1053}
1054
1055# Identifiers from group ofp_stats_request_flags
1056OFPSF_REQ_MORE = 1
1057
1058ofp_stats_request_flags_map = {
1059 1: 'OFPSF_REQ_MORE',
1060}
1061
1062# Identifiers from group ofp_stats_type
1063OFPST_DESC = 0
1064OFPST_FLOW = 1
1065OFPST_AGGREGATE = 2
1066OFPST_TABLE = 3
1067OFPST_PORT = 4
1068OFPST_QUEUE = 5
1069OFPST_GROUP = 6
1070OFPST_GROUP_DESC = 7
1071OFPST_GROUP_FEATURES = 8
1072OFPST_METER = 9
1073OFPST_METER_CONFIG = 10
1074OFPST_METER_FEATURES = 11
1075OFPST_TABLE_FEATURES = 12
1076OFPST_PORT_DESC = 13
1077OFPST_EXPERIMENTER = 65535
1078
1079ofp_stats_type_map = {
1080 0: 'OFPST_DESC',
1081 1: 'OFPST_FLOW',
1082 2: 'OFPST_AGGREGATE',
1083 3: 'OFPST_TABLE',
1084 4: 'OFPST_PORT',
1085 5: 'OFPST_QUEUE',
1086 6: 'OFPST_GROUP',
1087 7: 'OFPST_GROUP_DESC',
1088 8: 'OFPST_GROUP_FEATURES',
1089 9: 'OFPST_METER',
1090 10: 'OFPST_METER_CONFIG',
1091 11: 'OFPST_METER_FEATURES',
1092 12: 'OFPST_TABLE_FEATURES',
1093 13: 'OFPST_PORT_DESC',
1094 65535: 'OFPST_EXPERIMENTER',
1095}
1096
Rich Lanec2ee4b82013-04-24 17:12:38 -07001097# Identifiers from group ofp_switch_config_failed_code
1098OFPSCFC_BAD_FLAGS = 0
1099OFPSCFC_BAD_LEN = 1
1100OFPSCFC_EPERM = 2
1101
1102ofp_switch_config_failed_code_map = {
1103 0: 'OFPSCFC_BAD_FLAGS',
1104 1: 'OFPSCFC_BAD_LEN',
1105 2: 'OFPSCFC_EPERM',
1106}
1107
1108# Identifiers from group ofp_table
1109OFPTT_MAX = 254
1110OFPTT_ALL = 255
1111
1112ofp_table_map = {
1113 254: 'OFPTT_MAX',
1114 255: 'OFPTT_ALL',
1115}
1116
1117# Identifiers from group ofp_table_config
1118OFPTC_DEPRECATED_MASK = 3
1119
1120ofp_table_config_map = {
1121 3: 'OFPTC_DEPRECATED_MASK',
1122}
1123
1124# Identifiers from group ofp_table_feature_prop_type
1125OFPTFPT_INSTRUCTIONS = 0
1126OFPTFPT_INSTRUCTIONS_MISS = 1
1127OFPTFPT_NEXT_TABLES = 2
1128OFPTFPT_NEXT_TABLES_MISS = 3
1129OFPTFPT_WRITE_ACTIONS = 4
1130OFPTFPT_WRITE_ACTIONS_MISS = 5
1131OFPTFPT_APPLY_ACTIONS = 6
1132OFPTFPT_APPLY_ACTIONS_MISS = 7
1133OFPTFPT_MATCH = 8
1134OFPTFPT_WILDCARDS = 10
1135OFPTFPT_WRITE_SETFIELD = 12
1136OFPTFPT_WRITE_SETFIELD_MISS = 13
1137OFPTFPT_APPLY_SETFIELD = 14
1138OFPTFPT_APPLY_SETFIELD_MISS = 15
1139OFPTFPT_EXPERIMENTER = 65534
1140OFPTFPT_EXPERIMENTER_MISS = 65535
1141
1142ofp_table_feature_prop_type_map = {
1143 0: 'OFPTFPT_INSTRUCTIONS',
1144 1: 'OFPTFPT_INSTRUCTIONS_MISS',
1145 2: 'OFPTFPT_NEXT_TABLES',
1146 3: 'OFPTFPT_NEXT_TABLES_MISS',
1147 4: 'OFPTFPT_WRITE_ACTIONS',
1148 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
1149 6: 'OFPTFPT_APPLY_ACTIONS',
1150 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
1151 8: 'OFPTFPT_MATCH',
1152 10: 'OFPTFPT_WILDCARDS',
1153 12: 'OFPTFPT_WRITE_SETFIELD',
1154 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
1155 14: 'OFPTFPT_APPLY_SETFIELD',
1156 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
1157 65534: 'OFPTFPT_EXPERIMENTER',
1158 65535: 'OFPTFPT_EXPERIMENTER_MISS',
1159}
1160
1161# Identifiers from group ofp_table_features_failed_code
1162OFPTFFC_BAD_TABLE = 0
1163OFPTFFC_BAD_METADATA = 1
1164OFPTFFC_BAD_TYPE = 2
1165OFPTFFC_BAD_LEN = 3
1166OFPTFFC_BAD_ARGUMENT = 4
1167OFPTFFC_EPERM = 5
1168
1169ofp_table_features_failed_code_map = {
1170 0: 'OFPTFFC_BAD_TABLE',
1171 1: 'OFPTFFC_BAD_METADATA',
1172 2: 'OFPTFFC_BAD_TYPE',
1173 3: 'OFPTFFC_BAD_LEN',
1174 4: 'OFPTFFC_BAD_ARGUMENT',
1175 5: 'OFPTFFC_EPERM',
1176}
1177
1178# Identifiers from group ofp_table_mod_failed_code
1179OFPTMFC_BAD_TABLE = 0
1180OFPTMFC_BAD_CONFIG = 1
1181OFPTMFC_EPERM = 2
1182
1183ofp_table_mod_failed_code_map = {
1184 0: 'OFPTMFC_BAD_TABLE',
1185 1: 'OFPTMFC_BAD_CONFIG',
1186 2: 'OFPTMFC_EPERM',
1187}
1188
1189# Identifiers from group ofp_type
1190OFPT_HELLO = 0
1191OFPT_ERROR = 1
1192OFPT_ECHO_REQUEST = 2
1193OFPT_ECHO_REPLY = 3
1194OFPT_EXPERIMENTER = 4
1195OFPT_FEATURES_REQUEST = 5
1196OFPT_FEATURES_REPLY = 6
1197OFPT_GET_CONFIG_REQUEST = 7
1198OFPT_GET_CONFIG_REPLY = 8
1199OFPT_SET_CONFIG = 9
1200OFPT_PACKET_IN = 10
1201OFPT_FLOW_REMOVED = 11
1202OFPT_PORT_STATUS = 12
1203OFPT_PACKET_OUT = 13
1204OFPT_FLOW_MOD = 14
1205OFPT_GROUP_MOD = 15
1206OFPT_PORT_MOD = 16
1207OFPT_TABLE_MOD = 17
Rich Lane6f4978c2013-10-20 21:33:52 -07001208OFPT_STATS_REQUEST = 18
1209OFPT_STATS_REPLY = 19
Rich Lanec2ee4b82013-04-24 17:12:38 -07001210OFPT_BARRIER_REQUEST = 20
1211OFPT_BARRIER_REPLY = 21
1212OFPT_QUEUE_GET_CONFIG_REQUEST = 22
1213OFPT_QUEUE_GET_CONFIG_REPLY = 23
1214OFPT_ROLE_REQUEST = 24
1215OFPT_ROLE_REPLY = 25
1216OFPT_GET_ASYNC_REQUEST = 26
1217OFPT_GET_ASYNC_REPLY = 27
1218OFPT_SET_ASYNC = 28
1219OFPT_METER_MOD = 29
1220
1221ofp_type_map = {
1222 0: 'OFPT_HELLO',
1223 1: 'OFPT_ERROR',
1224 2: 'OFPT_ECHO_REQUEST',
1225 3: 'OFPT_ECHO_REPLY',
1226 4: 'OFPT_EXPERIMENTER',
1227 5: 'OFPT_FEATURES_REQUEST',
1228 6: 'OFPT_FEATURES_REPLY',
1229 7: 'OFPT_GET_CONFIG_REQUEST',
1230 8: 'OFPT_GET_CONFIG_REPLY',
1231 9: 'OFPT_SET_CONFIG',
1232 10: 'OFPT_PACKET_IN',
1233 11: 'OFPT_FLOW_REMOVED',
1234 12: 'OFPT_PORT_STATUS',
1235 13: 'OFPT_PACKET_OUT',
1236 14: 'OFPT_FLOW_MOD',
1237 15: 'OFPT_GROUP_MOD',
1238 16: 'OFPT_PORT_MOD',
1239 17: 'OFPT_TABLE_MOD',
Rich Lane6f4978c2013-10-20 21:33:52 -07001240 18: 'OFPT_STATS_REQUEST',
1241 19: 'OFPT_STATS_REPLY',
Rich Lanec2ee4b82013-04-24 17:12:38 -07001242 20: 'OFPT_BARRIER_REQUEST',
1243 21: 'OFPT_BARRIER_REPLY',
1244 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
1245 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
1246 24: 'OFPT_ROLE_REQUEST',
1247 25: 'OFPT_ROLE_REPLY',
1248 26: 'OFPT_GET_ASYNC_REQUEST',
1249 27: 'OFPT_GET_ASYNC_REPLY',
1250 28: 'OFPT_SET_ASYNC',
1251 29: 'OFPT_METER_MOD',
1252}
1253
1254# Identifiers from group ofp_vlan_id
1255OFPVID_NONE = 0
1256OFPVID_PRESENT = 4096
1257
1258ofp_vlan_id_map = {
1259 0: 'OFPVID_NONE',
1260 4096: 'OFPVID_PRESENT',
1261}
1262