blob: 843282529d1f27b06f512fd67efb8ac39a55551d [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 Lane93b33132014-04-21 12:20:58 -0700287# Identifiers from group ofp_bsn_pktin_flag
288OFP_BSN_PKTIN_FLAG_PDU = 1
289OFP_BSN_PKTIN_FLAG_NEW_HOST = 2
290OFP_BSN_PKTIN_FLAG_STATION_MOVE = 4
291OFP_BSN_PKTIN_FLAG_ARP = 8
292OFP_BSN_PKTIN_FLAG_DHCP = 16
293OFP_BSN_PKTIN_FLAG_L2_CPU = 32
294OFP_BSN_PKTIN_FLAG_DEBUG = 64
295OFP_BSN_PKTIN_FLAG_TTL_EXPIRED = 128
296OFP_BSN_PKTIN_FLAG_L3_MISS = 256
297OFP_BSN_PKTIN_FLAG_L3_CPU = 512
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700298OFP_BSN_PKTIN_FLAG_INGRESS_ACL = 1024
Rich Laneccd32ed2014-11-10 17:48:24 -0800299OFP_BSN_PKTIN_FLAG_SFLOW = 2048
Rich Lane93b33132014-04-21 12:20:58 -0700300
301ofp_bsn_pktin_flag_map = {
302 1: 'OFP_BSN_PKTIN_FLAG_PDU',
303 2: 'OFP_BSN_PKTIN_FLAG_NEW_HOST',
304 4: 'OFP_BSN_PKTIN_FLAG_STATION_MOVE',
305 8: 'OFP_BSN_PKTIN_FLAG_ARP',
306 16: 'OFP_BSN_PKTIN_FLAG_DHCP',
307 32: 'OFP_BSN_PKTIN_FLAG_L2_CPU',
308 64: 'OFP_BSN_PKTIN_FLAG_DEBUG',
309 128: 'OFP_BSN_PKTIN_FLAG_TTL_EXPIRED',
310 256: 'OFP_BSN_PKTIN_FLAG_L3_MISS',
311 512: 'OFP_BSN_PKTIN_FLAG_L3_CPU',
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700312 1024: 'OFP_BSN_PKTIN_FLAG_INGRESS_ACL',
Rich Laneccd32ed2014-11-10 17:48:24 -0800313 2048: 'OFP_BSN_PKTIN_FLAG_SFLOW',
Rich Lane93b33132014-04-21 12:20:58 -0700314}
315
Rich Lane7dcdf022013-12-11 14:45:27 -0800316# Identifiers from group ofp_bsn_port_counter
317OFP_BSN_PORT_COUNTER_RX_BYTES = 0
318OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST = 1
319OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST = 2
320OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST = 3
321OFP_BSN_PORT_COUNTER_RX_DROPPED = 4
322OFP_BSN_PORT_COUNTER_RX_ERRORS = 5
323OFP_BSN_PORT_COUNTER_TX_BYTES = 6
324OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST = 7
325OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST = 8
326OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST = 9
327OFP_BSN_PORT_COUNTER_TX_DROPPED = 10
328OFP_BSN_PORT_COUNTER_TX_ERRORS = 11
Rich Lane5587ab12014-06-30 11:19:09 -0700329OFP_BSN_PORT_COUNTER_RX_RUNTS = 12
330OFP_BSN_PORT_COUNTER_RX_GIANTS = 13
331OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS = 14
332OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS = 15
333OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS = 16
334OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT = 17
335OFP_BSN_PORT_COUNTER_TX_COLLISIONS = 18
336OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS = 19
337OFP_BSN_PORT_COUNTER_TX_DEFERRED = 20
338OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT = 21
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700339OFP_BSN_PORT_COUNTER_RX_PACKETS = 22
340OFP_BSN_PORT_COUNTER_TX_PACKETS = 23
341OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS = 24
342OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS = 25
343OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS = 26
Rich Lane7dcdf022013-12-11 14:45:27 -0800344
345ofp_bsn_port_counter_map = {
346 0: 'OFP_BSN_PORT_COUNTER_RX_BYTES',
347 1: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST',
348 2: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST',
349 3: 'OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST',
350 4: 'OFP_BSN_PORT_COUNTER_RX_DROPPED',
351 5: 'OFP_BSN_PORT_COUNTER_RX_ERRORS',
352 6: 'OFP_BSN_PORT_COUNTER_TX_BYTES',
353 7: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST',
354 8: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST',
355 9: 'OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST',
356 10: 'OFP_BSN_PORT_COUNTER_TX_DROPPED',
357 11: 'OFP_BSN_PORT_COUNTER_TX_ERRORS',
Rich Lane5587ab12014-06-30 11:19:09 -0700358 12: 'OFP_BSN_PORT_COUNTER_RX_RUNTS',
359 13: 'OFP_BSN_PORT_COUNTER_RX_GIANTS',
360 14: 'OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS',
361 15: 'OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS',
362 16: 'OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS',
363 17: 'OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT',
364 18: 'OFP_BSN_PORT_COUNTER_TX_COLLISIONS',
365 19: 'OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS',
366 20: 'OFP_BSN_PORT_COUNTER_TX_DEFERRED',
367 21: 'OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT',
Harshmeet Singh6f0c8932014-07-02 15:52:56 -0700368 22: 'OFP_BSN_PORT_COUNTER_RX_PACKETS',
369 23: 'OFP_BSN_PORT_COUNTER_TX_PACKETS',
370 24: 'OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS',
371 25: 'OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS',
372 26: 'OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS',
Rich Lane7dcdf022013-12-11 14:45:27 -0800373}
374
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700375# Identifiers from group ofp_bsn_tcp_flag
376OFP_BSN_TCP_FLAG_FIN = 1
377OFP_BSN_TCP_FLAG_SYN = 2
378OFP_BSN_TCP_FLAG_RST = 4
379OFP_BSN_TCP_FLAG_PSH = 8
380OFP_BSN_TCP_FLAG_ACK = 16
381OFP_BSN_TCP_FLAG_URG = 32
382OFP_BSN_TCP_FLAG_ECE = 64
383OFP_BSN_TCP_FLAG_CWR = 128
384OFP_BSN_TCP_FLAG_NS = 256
385
386ofp_bsn_tcp_flag_map = {
387 1: 'OFP_BSN_TCP_FLAG_FIN',
388 2: 'OFP_BSN_TCP_FLAG_SYN',
389 4: 'OFP_BSN_TCP_FLAG_RST',
390 8: 'OFP_BSN_TCP_FLAG_PSH',
391 16: 'OFP_BSN_TCP_FLAG_ACK',
392 32: 'OFP_BSN_TCP_FLAG_URG',
393 64: 'OFP_BSN_TCP_FLAG_ECE',
394 128: 'OFP_BSN_TCP_FLAG_CWR',
395 256: 'OFP_BSN_TCP_FLAG_NS',
396}
397
Rich Lane93b33132014-04-21 12:20:58 -0700398# Identifiers from group ofp_bsn_udf_anchor
399OFP_BSN_UDF_ANCHOR_PACKET_START = 0
400OFP_BSN_UDF_ANCHOR_L3_HEADER_START = 1
401OFP_BSN_UDF_ANCHOR_L4_HEADER_START = 2
402
403ofp_bsn_udf_anchor_map = {
404 0: 'OFP_BSN_UDF_ANCHOR_PACKET_START',
405 1: 'OFP_BSN_UDF_ANCHOR_L3_HEADER_START',
406 2: 'OFP_BSN_UDF_ANCHOR_L4_HEADER_START',
407}
408
Rich Lane5587ab12014-06-30 11:19:09 -0700409# Identifiers from group ofp_bsn_vlan_counter_constants
410OFP_BSN_VLAN_ALL = 65535
411
412ofp_bsn_vlan_counter_constants_map = {
413 65535: 'OFP_BSN_VLAN_ALL',
414}
415
Rich Lane93b33132014-04-21 12:20:58 -0700416# Identifiers from group ofp_bsn_vport_l2gre_flags
417OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
418OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
419OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700420OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lanef9530c42014-09-15 09:59:43 -0700421OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
Rich Lane93b33132014-04-21 12:20:58 -0700422
423ofp_bsn_vport_l2gre_flags_map = {
424 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
425 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
426 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700427 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lanef9530c42014-09-15 09:59:43 -0700428 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700429}
430
Dan Talaycof6202252013-07-02 01:00:29 -0700431# Identifiers from group ofp_bsn_vport_q_in_q_untagged
432OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
433
434ofp_bsn_vport_q_in_q_untagged_map = {
435 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
436}
437
Rich Laned53156a2013-08-05 17:17:33 -0700438# Identifiers from group ofp_bsn_vport_status
439OF_BSN_VPORT_STATUS_OK = 0
440OF_BSN_VPORT_STATUS_FAILED = 1
441
442ofp_bsn_vport_status_map = {
443 0: 'OF_BSN_VPORT_STATUS_OK',
444 1: 'OF_BSN_VPORT_STATUS_FAILED',
445}
446
Rich Lane5587ab12014-06-30 11:19:09 -0700447# Identifiers from group ofp_bsn_vrf_counter_constants
448OFP_BSN_VRF_ALL = 4294967295
449
450ofp_bsn_vrf_counter_constants_map = {
451 4294967295: 'OFP_BSN_VRF_ALL',
452}
453
Rich Lanec2ee4b82013-04-24 17:12:38 -0700454# Identifiers from group ofp_capabilities
455OFPC_FLOW_STATS = 1
456OFPC_TABLE_STATS = 2
457OFPC_PORT_STATS = 4
458OFPC_GROUP_STATS = 8
459OFPC_IP_REASM = 32
460OFPC_QUEUE_STATS = 64
461OFPC_PORT_BLOCKED = 256
462
463ofp_capabilities_map = {
464 1: 'OFPC_FLOW_STATS',
465 2: 'OFPC_TABLE_STATS',
466 4: 'OFPC_PORT_STATS',
467 8: 'OFPC_GROUP_STATS',
468 32: 'OFPC_IP_REASM',
469 64: 'OFPC_QUEUE_STATS',
470 256: 'OFPC_PORT_BLOCKED',
471}
472
473# Identifiers from group ofp_config_flags
474OFPC_FRAG_NORMAL = 0
475OFPC_FRAG_DROP = 1
476OFPC_FRAG_REASM = 2
477OFPC_FRAG_MASK = 3
478
479ofp_config_flags_map = {
480 0: 'OFPC_FRAG_NORMAL',
481 1: 'OFPC_FRAG_DROP',
482 2: 'OFPC_FRAG_REASM',
483 3: 'OFPC_FRAG_MASK',
484}
485
486# Identifiers from group ofp_controller_max_len
487OFPCML_MAX = 65509
488OFPCML_NO_BUFFER = 65535
489
490ofp_controller_max_len_map = {
491 65509: 'OFPCML_MAX',
492 65535: 'OFPCML_NO_BUFFER',
493}
494
495# Identifiers from group ofp_controller_role
496OFPCR_ROLE_NOCHANGE = 0
497OFPCR_ROLE_EQUAL = 1
498OFPCR_ROLE_MASTER = 2
499OFPCR_ROLE_SLAVE = 3
500
501ofp_controller_role_map = {
502 0: 'OFPCR_ROLE_NOCHANGE',
503 1: 'OFPCR_ROLE_EQUAL',
504 2: 'OFPCR_ROLE_MASTER',
505 3: 'OFPCR_ROLE_SLAVE',
506}
507
508# Identifiers from group ofp_error_type
509OFPET_HELLO_FAILED = 0
510OFPET_BAD_REQUEST = 1
511OFPET_BAD_ACTION = 2
512OFPET_BAD_INSTRUCTION = 3
513OFPET_BAD_MATCH = 4
514OFPET_FLOW_MOD_FAILED = 5
515OFPET_GROUP_MOD_FAILED = 6
516OFPET_PORT_MOD_FAILED = 7
517OFPET_TABLE_MOD_FAILED = 8
518OFPET_QUEUE_OP_FAILED = 9
519OFPET_SWITCH_CONFIG_FAILED = 10
520OFPET_ROLE_REQUEST_FAILED = 11
521OFPET_METER_MOD_FAILED = 12
522OFPET_TABLE_FEATURES_FAILED = 13
523OFPET_EXPERIMENTER = 65535
524
525ofp_error_type_map = {
526 0: 'OFPET_HELLO_FAILED',
527 1: 'OFPET_BAD_REQUEST',
528 2: 'OFPET_BAD_ACTION',
529 3: 'OFPET_BAD_INSTRUCTION',
530 4: 'OFPET_BAD_MATCH',
531 5: 'OFPET_FLOW_MOD_FAILED',
532 6: 'OFPET_GROUP_MOD_FAILED',
533 7: 'OFPET_PORT_MOD_FAILED',
534 8: 'OFPET_TABLE_MOD_FAILED',
535 9: 'OFPET_QUEUE_OP_FAILED',
536 10: 'OFPET_SWITCH_CONFIG_FAILED',
537 11: 'OFPET_ROLE_REQUEST_FAILED',
538 12: 'OFPET_METER_MOD_FAILED',
539 13: 'OFPET_TABLE_FEATURES_FAILED',
540 65535: 'OFPET_EXPERIMENTER',
541}
542
543# Identifiers from group ofp_flow_mod_command
544OFPFC_ADD = 0
545OFPFC_MODIFY = 1
546OFPFC_MODIFY_STRICT = 2
547OFPFC_DELETE = 3
548OFPFC_DELETE_STRICT = 4
549
550ofp_flow_mod_command_map = {
551 0: 'OFPFC_ADD',
552 1: 'OFPFC_MODIFY',
553 2: 'OFPFC_MODIFY_STRICT',
554 3: 'OFPFC_DELETE',
555 4: 'OFPFC_DELETE_STRICT',
556}
557
558# Identifiers from group ofp_flow_mod_failed_code
559OFPFMFC_UNKNOWN = 0
560OFPFMFC_TABLE_FULL = 1
561OFPFMFC_BAD_TABLE_ID = 2
562OFPFMFC_OVERLAP = 3
563OFPFMFC_EPERM = 4
564OFPFMFC_BAD_TIMEOUT = 5
565OFPFMFC_BAD_COMMAND = 6
566OFPFMFC_BAD_FLAGS = 7
567
568ofp_flow_mod_failed_code_map = {
569 0: 'OFPFMFC_UNKNOWN',
570 1: 'OFPFMFC_TABLE_FULL',
571 2: 'OFPFMFC_BAD_TABLE_ID',
572 3: 'OFPFMFC_OVERLAP',
573 4: 'OFPFMFC_EPERM',
574 5: 'OFPFMFC_BAD_TIMEOUT',
575 6: 'OFPFMFC_BAD_COMMAND',
576 7: 'OFPFMFC_BAD_FLAGS',
577}
578
579# Identifiers from group ofp_flow_mod_flags
580OFPFF_SEND_FLOW_REM = 1
581OFPFF_CHECK_OVERLAP = 2
582OFPFF_RESET_COUNTS = 4
583OFPFF_NO_PKT_COUNTS = 8
584OFPFF_NO_BYT_COUNTS = 16
Rich Lane6f4978c2013-10-20 21:33:52 -0700585OFPFF_BSN_SEND_IDLE = 128
Rich Lanec2ee4b82013-04-24 17:12:38 -0700586
587ofp_flow_mod_flags_map = {
588 1: 'OFPFF_SEND_FLOW_REM',
589 2: 'OFPFF_CHECK_OVERLAP',
590 4: 'OFPFF_RESET_COUNTS',
591 8: 'OFPFF_NO_PKT_COUNTS',
592 16: 'OFPFF_NO_BYT_COUNTS',
Rich Lane6f4978c2013-10-20 21:33:52 -0700593 128: 'OFPFF_BSN_SEND_IDLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700594}
595
596# Identifiers from group ofp_flow_removed_reason
597OFPRR_IDLE_TIMEOUT = 0
598OFPRR_HARD_TIMEOUT = 1
599OFPRR_DELETE = 2
600OFPRR_GROUP_DELETE = 3
601
602ofp_flow_removed_reason_map = {
603 0: 'OFPRR_IDLE_TIMEOUT',
604 1: 'OFPRR_HARD_TIMEOUT',
605 2: 'OFPRR_DELETE',
606 3: 'OFPRR_GROUP_DELETE',
607}
608
609# Identifiers from group ofp_group
610OFPG_MAX = 4294967040
611OFPG_ALL = 4294967292
612OFPG_ANY = 4294967295
613
614ofp_group_map = {
615 4294967040: 'OFPG_MAX',
616 4294967292: 'OFPG_ALL',
617 4294967295: 'OFPG_ANY',
618}
619
620# Identifiers from group ofp_group_capabilities
621OFPGFC_SELECT_WEIGHT = 1
622OFPGFC_SELECT_LIVENESS = 2
623OFPGFC_CHAINING = 4
624OFPGFC_CHAINING_CHECKS = 8
625
626ofp_group_capabilities_map = {
627 1: 'OFPGFC_SELECT_WEIGHT',
628 2: 'OFPGFC_SELECT_LIVENESS',
629 4: 'OFPGFC_CHAINING',
630 8: 'OFPGFC_CHAINING_CHECKS',
631}
632
633# Identifiers from group ofp_group_mod_command
634OFPGC_ADD = 0
635OFPGC_MODIFY = 1
636OFPGC_DELETE = 2
637
638ofp_group_mod_command_map = {
639 0: 'OFPGC_ADD',
640 1: 'OFPGC_MODIFY',
641 2: 'OFPGC_DELETE',
642}
643
644# Identifiers from group ofp_group_mod_failed_code
645OFPGMFC_GROUP_EXISTS = 0
646OFPGMFC_INVALID_GROUP = 1
647OFPGMFC_WEIGHT_UNSUPPORTED = 2
648OFPGMFC_OUT_OF_GROUPS = 3
649OFPGMFC_OUT_OF_BUCKETS = 4
650OFPGMFC_CHAINING_UNSUPPORTED = 5
651OFPGMFC_WATCH_UNSUPPORTED = 6
652OFPGMFC_LOOP = 7
653OFPGMFC_UNKNOWN_GROUP = 8
654OFPGMFC_CHAINED_GROUP = 9
655OFPGMFC_BAD_TYPE = 10
656OFPGMFC_BAD_COMMAND = 11
657OFPGMFC_BAD_BUCKET = 12
658OFPGMFC_BAD_WATCH = 13
659OFPGMFC_EPERM = 14
660
661ofp_group_mod_failed_code_map = {
662 0: 'OFPGMFC_GROUP_EXISTS',
663 1: 'OFPGMFC_INVALID_GROUP',
664 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
665 3: 'OFPGMFC_OUT_OF_GROUPS',
666 4: 'OFPGMFC_OUT_OF_BUCKETS',
667 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
668 6: 'OFPGMFC_WATCH_UNSUPPORTED',
669 7: 'OFPGMFC_LOOP',
670 8: 'OFPGMFC_UNKNOWN_GROUP',
671 9: 'OFPGMFC_CHAINED_GROUP',
672 10: 'OFPGMFC_BAD_TYPE',
673 11: 'OFPGMFC_BAD_COMMAND',
674 12: 'OFPGMFC_BAD_BUCKET',
675 13: 'OFPGMFC_BAD_WATCH',
676 14: 'OFPGMFC_EPERM',
677}
678
679# Identifiers from group ofp_group_type
680OFPGT_ALL = 0
681OFPGT_SELECT = 1
682OFPGT_INDIRECT = 2
683OFPGT_FF = 3
684
685ofp_group_type_map = {
686 0: 'OFPGT_ALL',
687 1: 'OFPGT_SELECT',
688 2: 'OFPGT_INDIRECT',
689 3: 'OFPGT_FF',
690}
691
692# Identifiers from group ofp_hello_elem_type
693OFPHET_VERSIONBITMAP = 1
694
695ofp_hello_elem_type_map = {
696 1: 'OFPHET_VERSIONBITMAP',
697}
698
699# Identifiers from group ofp_hello_failed_code
700OFPHFC_INCOMPATIBLE = 0
701OFPHFC_EPERM = 1
702
703ofp_hello_failed_code_map = {
704 0: 'OFPHFC_INCOMPATIBLE',
705 1: 'OFPHFC_EPERM',
706}
707
708# Identifiers from group ofp_instruction_type
709OFPIT_GOTO_TABLE = 1
710OFPIT_WRITE_METADATA = 2
711OFPIT_WRITE_ACTIONS = 3
712OFPIT_APPLY_ACTIONS = 4
713OFPIT_CLEAR_ACTIONS = 5
714OFPIT_METER = 6
715OFPIT_EXPERIMENTER = 65535
716
717ofp_instruction_type_map = {
718 1: 'OFPIT_GOTO_TABLE',
719 2: 'OFPIT_WRITE_METADATA',
720 3: 'OFPIT_WRITE_ACTIONS',
721 4: 'OFPIT_APPLY_ACTIONS',
722 5: 'OFPIT_CLEAR_ACTIONS',
723 6: 'OFPIT_METER',
724 65535: 'OFPIT_EXPERIMENTER',
725}
726
727# Identifiers from group ofp_ipv6exthdr_flags
728OFPIEH_NONEXT = 1
729OFPIEH_ESP = 2
730OFPIEH_AUTH = 4
731OFPIEH_DEST = 8
732OFPIEH_FRAG = 16
733OFPIEH_ROUTER = 32
734OFPIEH_HOP = 64
735OFPIEH_UNREP = 128
736OFPIEH_UNSEQ = 256
737
738ofp_ipv6exthdr_flags_map = {
739 1: 'OFPIEH_NONEXT',
740 2: 'OFPIEH_ESP',
741 4: 'OFPIEH_AUTH',
742 8: 'OFPIEH_DEST',
743 16: 'OFPIEH_FRAG',
744 32: 'OFPIEH_ROUTER',
745 64: 'OFPIEH_HOP',
746 128: 'OFPIEH_UNREP',
747 256: 'OFPIEH_UNSEQ',
748}
749
750# Identifiers from group ofp_match_type
751OFPMT_STANDARD = 0
752OFPMT_OXM = 1
753
754ofp_match_type_map = {
755 0: 'OFPMT_STANDARD',
756 1: 'OFPMT_OXM',
757}
758
759# Identifiers from group ofp_meter
760OFPM_MAX = 4294901760
761OFPM_SLOWPATH = 4294967293
762OFPM_CONTROLLER = 4294967294
763OFPM_ALL = 4294967295
764
765ofp_meter_map = {
766 4294901760: 'OFPM_MAX',
767 4294967293: 'OFPM_SLOWPATH',
768 4294967294: 'OFPM_CONTROLLER',
769 4294967295: 'OFPM_ALL',
770}
771
772# Identifiers from group ofp_meter_band_type
773OFPMBT_DROP = 1
774OFPMBT_DSCP_REMARK = 2
775OFPMBT_EXPERIMENTER = 65535
776
777ofp_meter_band_type_map = {
778 1: 'OFPMBT_DROP',
779 2: 'OFPMBT_DSCP_REMARK',
780 65535: 'OFPMBT_EXPERIMENTER',
781}
782
783# Identifiers from group ofp_meter_flags
784OFPMF_KBPS = 1
785OFPMF_PKTPS = 2
786OFPMF_BURST = 4
787OFPMF_STATS = 8
788
789ofp_meter_flags_map = {
790 1: 'OFPMF_KBPS',
791 2: 'OFPMF_PKTPS',
792 4: 'OFPMF_BURST',
793 8: 'OFPMF_STATS',
794}
795
796# Identifiers from group ofp_meter_mod_command
797OFPMC_ADD = 0
798OFPMC_MODIFY = 1
799OFPMC_DELETE = 2
800
801ofp_meter_mod_command_map = {
802 0: 'OFPMC_ADD',
803 1: 'OFPMC_MODIFY',
804 2: 'OFPMC_DELETE',
805}
806
807# Identifiers from group ofp_meter_mod_failed_code
808OFPMMFC_UNKNOWN = 0
809OFPMMFC_METER_EXISTS = 1
810OFPMMFC_INVALID_METER = 2
811OFPMMFC_UNKNOWN_METER = 3
812OFPMMFC_BAD_COMMAND = 4
813OFPMMFC_BAD_FLAGS = 5
814OFPMMFC_BAD_RATE = 6
815OFPMMFC_BAD_BURST = 7
816OFPMMFC_BAD_BAND = 8
817OFPMMFC_BAD_BAND_VALUE = 9
818OFPMMFC_OUT_OF_METERS = 10
819OFPMMFC_OUT_OF_BANDS = 11
820
821ofp_meter_mod_failed_code_map = {
822 0: 'OFPMMFC_UNKNOWN',
823 1: 'OFPMMFC_METER_EXISTS',
824 2: 'OFPMMFC_INVALID_METER',
825 3: 'OFPMMFC_UNKNOWN_METER',
826 4: 'OFPMMFC_BAD_COMMAND',
827 5: 'OFPMMFC_BAD_FLAGS',
828 6: 'OFPMMFC_BAD_RATE',
829 7: 'OFPMMFC_BAD_BURST',
830 8: 'OFPMMFC_BAD_BAND',
831 9: 'OFPMMFC_BAD_BAND_VALUE',
832 10: 'OFPMMFC_OUT_OF_METERS',
833 11: 'OFPMMFC_OUT_OF_BANDS',
834}
835
Rich Lanec2ee4b82013-04-24 17:12:38 -0700836# Identifiers from group ofp_oxm_class
837OFPXMC_NXM_0 = 0
838OFPXMC_NXM_1 = 1
839OFPXMC_OPENFLOW_BASIC = 32768
840OFPXMC_EXPERIMENTER = 65535
841
842ofp_oxm_class_map = {
843 0: 'OFPXMC_NXM_0',
844 1: 'OFPXMC_NXM_1',
845 32768: 'OFPXMC_OPENFLOW_BASIC',
846 65535: 'OFPXMC_EXPERIMENTER',
847}
848
849# Identifiers from group ofp_packet_in_reason
850OFPR_NO_MATCH = 0
851OFPR_ACTION = 1
852OFPR_INVALID_TTL = 2
Rich Laned9e3f7b2013-11-04 11:40:43 -0800853OFPR_BSN_NEW_HOST = 128
854OFPR_BSN_STATION_MOVE = 129
855OFPR_BSN_BAD_VLAN = 130
856OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131
Rich Lane5454b682014-01-14 17:07:36 -0800857OFPR_BSN_NO_ROUTE = 132
Rich Lane95f7fc92014-01-27 17:08:16 -0800858OFPR_BSN_ICMP_ECHO_REQUEST = 133
859OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134
860OFPR_BSN_DEST_HOST_UNREACHABLE = 135
861OFPR_BSN_DEST_PORT_UNREACHABLE = 136
862OFPR_BSN_FRAGMENTATION_REQUIRED = 137
863OFPR_BSN_ARP = 139
Rich Lane1b75abf2014-02-05 11:23:20 -0800864OFPR_BSN_DHCP = 140
Rich Lane9ec3fca2014-02-26 16:22:56 -0800865OFPR_BSN_DEBUG = 141
Rich Lanef50b7c32014-03-20 11:38:02 -0700866OFPR_BSN_PACKET_OF_DEATH = 142
Rich Lanec2ee4b82013-04-24 17:12:38 -0700867
868ofp_packet_in_reason_map = {
869 0: 'OFPR_NO_MATCH',
870 1: 'OFPR_ACTION',
871 2: 'OFPR_INVALID_TTL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800872 128: 'OFPR_BSN_NEW_HOST',
873 129: 'OFPR_BSN_STATION_MOVE',
874 130: 'OFPR_BSN_BAD_VLAN',
875 131: 'OFPR_BSN_DESTINATION_LOOKUP_FAILURE',
Rich Lane5454b682014-01-14 17:07:36 -0800876 132: 'OFPR_BSN_NO_ROUTE',
Rich Lane95f7fc92014-01-27 17:08:16 -0800877 133: 'OFPR_BSN_ICMP_ECHO_REQUEST',
878 134: 'OFPR_BSN_DEST_NETWORK_UNREACHABLE',
879 135: 'OFPR_BSN_DEST_HOST_UNREACHABLE',
880 136: 'OFPR_BSN_DEST_PORT_UNREACHABLE',
881 137: 'OFPR_BSN_FRAGMENTATION_REQUIRED',
882 139: 'OFPR_BSN_ARP',
Rich Lane1b75abf2014-02-05 11:23:20 -0800883 140: 'OFPR_BSN_DHCP',
Rich Lane9ec3fca2014-02-26 16:22:56 -0800884 141: 'OFPR_BSN_DEBUG',
Rich Lanef50b7c32014-03-20 11:38:02 -0700885 142: 'OFPR_BSN_PACKET_OF_DEATH',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700886}
887
888# Identifiers from group ofp_port
889OFPP_MAX = 4294967040
890OFPP_IN_PORT = 4294967288
891OFPP_TABLE = 4294967289
892OFPP_NORMAL = 4294967290
893OFPP_FLOOD = 4294967291
894OFPP_ALL = 4294967292
895OFPP_CONTROLLER = 4294967293
896OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800897OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700898
899ofp_port_map = {
900 4294967040: 'OFPP_MAX',
901 4294967288: 'OFPP_IN_PORT',
902 4294967289: 'OFPP_TABLE',
903 4294967290: 'OFPP_NORMAL',
904 4294967291: 'OFPP_FLOOD',
905 4294967292: 'OFPP_ALL',
906 4294967293: 'OFPP_CONTROLLER',
907 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800908 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700909}
910
911# Identifiers from group ofp_port_config
912OFPPC_PORT_DOWN = 1
913OFPPC_NO_RECV = 4
914OFPPC_NO_FWD = 32
915OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700916OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700917
918ofp_port_config_map = {
919 1: 'OFPPC_PORT_DOWN',
920 4: 'OFPPC_NO_RECV',
921 32: 'OFPPC_NO_FWD',
922 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700923 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700924}
925
926# Identifiers from group ofp_port_features
927OFPPF_10MB_HD = 1
928OFPPF_10MB_FD = 2
929OFPPF_100MB_HD = 4
930OFPPF_100MB_FD = 8
931OFPPF_1GB_HD = 16
932OFPPF_1GB_FD = 32
933OFPPF_10GB_FD = 64
934OFPPF_40GB_FD = 128
935OFPPF_100GB_FD = 256
936OFPPF_1TB_FD = 512
937OFPPF_OTHER = 1024
938OFPPF_COPPER = 2048
939OFPPF_FIBER = 4096
940OFPPF_AUTONEG = 8192
941OFPPF_PAUSE = 16384
942OFPPF_PAUSE_ASYM = 32768
Rich Laneccd32ed2014-11-10 17:48:24 -0800943OFPPF_BSN_BREAKOUT_CAPABLE = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700944
945ofp_port_features_map = {
946 1: 'OFPPF_10MB_HD',
947 2: 'OFPPF_10MB_FD',
948 4: 'OFPPF_100MB_HD',
949 8: 'OFPPF_100MB_FD',
950 16: 'OFPPF_1GB_HD',
951 32: 'OFPPF_1GB_FD',
952 64: 'OFPPF_10GB_FD',
953 128: 'OFPPF_40GB_FD',
954 256: 'OFPPF_100GB_FD',
955 512: 'OFPPF_1TB_FD',
956 1024: 'OFPPF_OTHER',
957 2048: 'OFPPF_COPPER',
958 4096: 'OFPPF_FIBER',
959 8192: 'OFPPF_AUTONEG',
960 16384: 'OFPPF_PAUSE',
961 32768: 'OFPPF_PAUSE_ASYM',
Rich Laneccd32ed2014-11-10 17:48:24 -0800962 2147483648: 'OFPPF_BSN_BREAKOUT_CAPABLE',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700963}
964
965# Identifiers from group ofp_port_mod_failed_code
966OFPPMFC_BAD_PORT = 0
967OFPPMFC_BAD_HW_ADDR = 1
968OFPPMFC_BAD_CONFIG = 2
969OFPPMFC_BAD_ADVERTISE = 3
970OFPPMFC_EPERM = 4
971
972ofp_port_mod_failed_code_map = {
973 0: 'OFPPMFC_BAD_PORT',
974 1: 'OFPPMFC_BAD_HW_ADDR',
975 2: 'OFPPMFC_BAD_CONFIG',
976 3: 'OFPPMFC_BAD_ADVERTISE',
977 4: 'OFPPMFC_EPERM',
978}
979
Rich Lanec2ee4b82013-04-24 17:12:38 -0700980# Identifiers from group ofp_port_reason
981OFPPR_ADD = 0
982OFPPR_DELETE = 1
983OFPPR_MODIFY = 2
984
985ofp_port_reason_map = {
986 0: 'OFPPR_ADD',
987 1: 'OFPPR_DELETE',
988 2: 'OFPPR_MODIFY',
989}
990
991# Identifiers from group ofp_port_state
992OFPPS_LINK_DOWN = 1
993OFPPS_BLOCKED = 2
994OFPPS_LIVE = 4
995
996ofp_port_state_map = {
997 1: 'OFPPS_LINK_DOWN',
998 2: 'OFPPS_BLOCKED',
999 4: 'OFPPS_LIVE',
1000}
1001
1002# Identifiers from group ofp_queue_op_failed_code
1003OFPQOFC_BAD_PORT = 0
1004OFPQOFC_BAD_QUEUE = 1
1005OFPQOFC_EPERM = 2
1006
1007ofp_queue_op_failed_code_map = {
1008 0: 'OFPQOFC_BAD_PORT',
1009 1: 'OFPQOFC_BAD_QUEUE',
1010 2: 'OFPQOFC_EPERM',
1011}
1012
1013# Identifiers from group ofp_queue_properties
1014OFPQT_MIN_RATE = 1
1015OFPQT_MAX_RATE = 2
1016OFPQT_EXPERIMENTER = 65535
1017
1018ofp_queue_properties_map = {
1019 1: 'OFPQT_MIN_RATE',
1020 2: 'OFPQT_MAX_RATE',
1021 65535: 'OFPQT_EXPERIMENTER',
1022}
1023
1024# Identifiers from group ofp_role_request_failed_code
1025OFPRRFC_STALE = 0
1026OFPRRFC_UNSUP = 1
1027OFPRRFC_BAD_ROLE = 2
1028
1029ofp_role_request_failed_code_map = {
1030 0: 'OFPRRFC_STALE',
1031 1: 'OFPRRFC_UNSUP',
1032 2: 'OFPRRFC_BAD_ROLE',
1033}
1034
Rich Lane6f4978c2013-10-20 21:33:52 -07001035# Identifiers from group ofp_stats_reply_flags
1036OFPSF_REPLY_MORE = 1
1037
1038ofp_stats_reply_flags_map = {
1039 1: 'OFPSF_REPLY_MORE',
1040}
1041
1042# Identifiers from group ofp_stats_request_flags
1043OFPSF_REQ_MORE = 1
1044
1045ofp_stats_request_flags_map = {
1046 1: 'OFPSF_REQ_MORE',
1047}
1048
1049# Identifiers from group ofp_stats_type
1050OFPST_DESC = 0
1051OFPST_FLOW = 1
1052OFPST_AGGREGATE = 2
1053OFPST_TABLE = 3
1054OFPST_PORT = 4
1055OFPST_QUEUE = 5
1056OFPST_GROUP = 6
1057OFPST_GROUP_DESC = 7
1058OFPST_GROUP_FEATURES = 8
1059OFPST_METER = 9
1060OFPST_METER_CONFIG = 10
1061OFPST_METER_FEATURES = 11
1062OFPST_TABLE_FEATURES = 12
1063OFPST_PORT_DESC = 13
1064OFPST_EXPERIMENTER = 65535
1065
1066ofp_stats_type_map = {
1067 0: 'OFPST_DESC',
1068 1: 'OFPST_FLOW',
1069 2: 'OFPST_AGGREGATE',
1070 3: 'OFPST_TABLE',
1071 4: 'OFPST_PORT',
1072 5: 'OFPST_QUEUE',
1073 6: 'OFPST_GROUP',
1074 7: 'OFPST_GROUP_DESC',
1075 8: 'OFPST_GROUP_FEATURES',
1076 9: 'OFPST_METER',
1077 10: 'OFPST_METER_CONFIG',
1078 11: 'OFPST_METER_FEATURES',
1079 12: 'OFPST_TABLE_FEATURES',
1080 13: 'OFPST_PORT_DESC',
1081 65535: 'OFPST_EXPERIMENTER',
1082}
1083
Rich Lanec2ee4b82013-04-24 17:12:38 -07001084# Identifiers from group ofp_switch_config_failed_code
1085OFPSCFC_BAD_FLAGS = 0
1086OFPSCFC_BAD_LEN = 1
1087OFPSCFC_EPERM = 2
1088
1089ofp_switch_config_failed_code_map = {
1090 0: 'OFPSCFC_BAD_FLAGS',
1091 1: 'OFPSCFC_BAD_LEN',
1092 2: 'OFPSCFC_EPERM',
1093}
1094
1095# Identifiers from group ofp_table
1096OFPTT_MAX = 254
1097OFPTT_ALL = 255
1098
1099ofp_table_map = {
1100 254: 'OFPTT_MAX',
1101 255: 'OFPTT_ALL',
1102}
1103
1104# Identifiers from group ofp_table_config
1105OFPTC_DEPRECATED_MASK = 3
1106
1107ofp_table_config_map = {
1108 3: 'OFPTC_DEPRECATED_MASK',
1109}
1110
1111# Identifiers from group ofp_table_feature_prop_type
1112OFPTFPT_INSTRUCTIONS = 0
1113OFPTFPT_INSTRUCTIONS_MISS = 1
1114OFPTFPT_NEXT_TABLES = 2
1115OFPTFPT_NEXT_TABLES_MISS = 3
1116OFPTFPT_WRITE_ACTIONS = 4
1117OFPTFPT_WRITE_ACTIONS_MISS = 5
1118OFPTFPT_APPLY_ACTIONS = 6
1119OFPTFPT_APPLY_ACTIONS_MISS = 7
1120OFPTFPT_MATCH = 8
1121OFPTFPT_WILDCARDS = 10
1122OFPTFPT_WRITE_SETFIELD = 12
1123OFPTFPT_WRITE_SETFIELD_MISS = 13
1124OFPTFPT_APPLY_SETFIELD = 14
1125OFPTFPT_APPLY_SETFIELD_MISS = 15
1126OFPTFPT_EXPERIMENTER = 65534
1127OFPTFPT_EXPERIMENTER_MISS = 65535
1128
1129ofp_table_feature_prop_type_map = {
1130 0: 'OFPTFPT_INSTRUCTIONS',
1131 1: 'OFPTFPT_INSTRUCTIONS_MISS',
1132 2: 'OFPTFPT_NEXT_TABLES',
1133 3: 'OFPTFPT_NEXT_TABLES_MISS',
1134 4: 'OFPTFPT_WRITE_ACTIONS',
1135 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
1136 6: 'OFPTFPT_APPLY_ACTIONS',
1137 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
1138 8: 'OFPTFPT_MATCH',
1139 10: 'OFPTFPT_WILDCARDS',
1140 12: 'OFPTFPT_WRITE_SETFIELD',
1141 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
1142 14: 'OFPTFPT_APPLY_SETFIELD',
1143 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
1144 65534: 'OFPTFPT_EXPERIMENTER',
1145 65535: 'OFPTFPT_EXPERIMENTER_MISS',
1146}
1147
1148# Identifiers from group ofp_table_features_failed_code
1149OFPTFFC_BAD_TABLE = 0
1150OFPTFFC_BAD_METADATA = 1
1151OFPTFFC_BAD_TYPE = 2
1152OFPTFFC_BAD_LEN = 3
1153OFPTFFC_BAD_ARGUMENT = 4
1154OFPTFFC_EPERM = 5
1155
1156ofp_table_features_failed_code_map = {
1157 0: 'OFPTFFC_BAD_TABLE',
1158 1: 'OFPTFFC_BAD_METADATA',
1159 2: 'OFPTFFC_BAD_TYPE',
1160 3: 'OFPTFFC_BAD_LEN',
1161 4: 'OFPTFFC_BAD_ARGUMENT',
1162 5: 'OFPTFFC_EPERM',
1163}
1164
1165# Identifiers from group ofp_table_mod_failed_code
1166OFPTMFC_BAD_TABLE = 0
1167OFPTMFC_BAD_CONFIG = 1
1168OFPTMFC_EPERM = 2
1169
1170ofp_table_mod_failed_code_map = {
1171 0: 'OFPTMFC_BAD_TABLE',
1172 1: 'OFPTMFC_BAD_CONFIG',
1173 2: 'OFPTMFC_EPERM',
1174}
1175
1176# Identifiers from group ofp_type
1177OFPT_HELLO = 0
1178OFPT_ERROR = 1
1179OFPT_ECHO_REQUEST = 2
1180OFPT_ECHO_REPLY = 3
1181OFPT_EXPERIMENTER = 4
1182OFPT_FEATURES_REQUEST = 5
1183OFPT_FEATURES_REPLY = 6
1184OFPT_GET_CONFIG_REQUEST = 7
1185OFPT_GET_CONFIG_REPLY = 8
1186OFPT_SET_CONFIG = 9
1187OFPT_PACKET_IN = 10
1188OFPT_FLOW_REMOVED = 11
1189OFPT_PORT_STATUS = 12
1190OFPT_PACKET_OUT = 13
1191OFPT_FLOW_MOD = 14
1192OFPT_GROUP_MOD = 15
1193OFPT_PORT_MOD = 16
1194OFPT_TABLE_MOD = 17
Rich Lane6f4978c2013-10-20 21:33:52 -07001195OFPT_STATS_REQUEST = 18
1196OFPT_STATS_REPLY = 19
Rich Lanec2ee4b82013-04-24 17:12:38 -07001197OFPT_BARRIER_REQUEST = 20
1198OFPT_BARRIER_REPLY = 21
1199OFPT_QUEUE_GET_CONFIG_REQUEST = 22
1200OFPT_QUEUE_GET_CONFIG_REPLY = 23
1201OFPT_ROLE_REQUEST = 24
1202OFPT_ROLE_REPLY = 25
1203OFPT_GET_ASYNC_REQUEST = 26
1204OFPT_GET_ASYNC_REPLY = 27
1205OFPT_SET_ASYNC = 28
1206OFPT_METER_MOD = 29
1207
1208ofp_type_map = {
1209 0: 'OFPT_HELLO',
1210 1: 'OFPT_ERROR',
1211 2: 'OFPT_ECHO_REQUEST',
1212 3: 'OFPT_ECHO_REPLY',
1213 4: 'OFPT_EXPERIMENTER',
1214 5: 'OFPT_FEATURES_REQUEST',
1215 6: 'OFPT_FEATURES_REPLY',
1216 7: 'OFPT_GET_CONFIG_REQUEST',
1217 8: 'OFPT_GET_CONFIG_REPLY',
1218 9: 'OFPT_SET_CONFIG',
1219 10: 'OFPT_PACKET_IN',
1220 11: 'OFPT_FLOW_REMOVED',
1221 12: 'OFPT_PORT_STATUS',
1222 13: 'OFPT_PACKET_OUT',
1223 14: 'OFPT_FLOW_MOD',
1224 15: 'OFPT_GROUP_MOD',
1225 16: 'OFPT_PORT_MOD',
1226 17: 'OFPT_TABLE_MOD',
Rich Lane6f4978c2013-10-20 21:33:52 -07001227 18: 'OFPT_STATS_REQUEST',
1228 19: 'OFPT_STATS_REPLY',
Rich Lanec2ee4b82013-04-24 17:12:38 -07001229 20: 'OFPT_BARRIER_REQUEST',
1230 21: 'OFPT_BARRIER_REPLY',
1231 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
1232 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
1233 24: 'OFPT_ROLE_REQUEST',
1234 25: 'OFPT_ROLE_REPLY',
1235 26: 'OFPT_GET_ASYNC_REQUEST',
1236 27: 'OFPT_GET_ASYNC_REPLY',
1237 28: 'OFPT_SET_ASYNC',
1238 29: 'OFPT_METER_MOD',
1239}
1240
1241# Identifiers from group ofp_vlan_id
1242OFPVID_NONE = 0
1243OFPVID_PRESENT = 4096
1244
1245ofp_vlan_id_map = {
1246 0: 'OFPVID_NONE',
1247 4096: 'OFPVID_PRESENT',
1248}
1249