]>
Commit | Line | Data |
---|---|---|
a930d4c5 | 1 | /* Copyright (c) 2008, 2011, 2012, 2013, 2014, 2016 The Board of Trustees of The Leland Stanford |
87ea5e5e BP |
2 | * Junior University |
3 | * | |
4 | * We are making the OpenFlow specification and associated documentation | |
5 | * (Software) available for public use and benefit with the expectation | |
6 | * that others will use, modify and enhance the Software and contribute | |
7 | * those enhancements back to the community. However, since we would | |
8 | * like to make the Software available for broadest use, with as few | |
9 | * restrictions as possible permission is hereby granted, free of | |
10 | * charge, to any person obtaining a copy of this Software to deal in | |
11 | * the Software under the copyrights without restriction, including | |
12 | * without limitation the rights to use, copy, modify, merge, publish, | |
13 | * distribute, sublicense, and/or sell copies of the Software, and to | |
14 | * permit persons to whom the Software is furnished to do so, subject to | |
15 | * the following conditions: | |
16 | * | |
17 | * The above copyright notice and this permission notice shall be | |
18 | * included in all copies or substantial portions of the Software. | |
19 | * | |
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |
24 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
25 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
26 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
27 | * SOFTWARE. | |
28 | * | |
29 | * The name and trademarks of copyright holder(s) may NOT be used in | |
30 | * advertising or publicity pertaining to the Software or any | |
31 | * derivatives without specific, written prior permission. | |
32 | */ | |
33 | ||
34 | /* | |
b79d45a1 | 35 | * Copyright (c) 2008-2015 Nicira, Inc. |
87ea5e5e BP |
36 | * |
37 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
38 | * you may not use this file except in compliance with the License. | |
39 | * You may obtain a copy of the License at: | |
40 | * | |
41 | * http://www.apache.org/licenses/LICENSE-2.0 | |
42 | * | |
43 | * Unless required by applicable law or agreed to in writing, software | |
44 | * distributed under the License is distributed on an "AS IS" BASIS, | |
45 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
46 | * See the License for the specific language governing permissions and | |
47 | * limitations under the License. | |
48 | */ | |
49 | ||
50 | #ifndef OPENFLOW_COMMON_H | |
51 | #define OPENFLOW_COMMON_H 1 | |
52 | ||
1825f2ec | 53 | #include <openvswitch/types.h> |
87ea5e5e BP |
54 | |
55 | #ifdef SWIG | |
56 | #define OFP_ASSERT(EXPR) /* SWIG can't handle OFP_ASSERT. */ | |
57 | #elif !defined(__cplusplus) | |
58 | /* Build-time assertion for use in a declaration context. */ | |
59 | #define OFP_ASSERT(EXPR) \ | |
60 | extern int (*build_assert(void))[ sizeof(struct { \ | |
61 | unsigned int build_assert_failed : (EXPR) ? 1 : -1; })] | |
62 | #else /* __cplusplus */ | |
63 | #include <boost/static_assert.hpp> | |
64 | #define OFP_ASSERT BOOST_STATIC_ASSERT | |
65 | #endif /* __cplusplus */ | |
66 | ||
67 | /* Version number: | |
68 | * Non-experimental versions released: 0x01 0x02 | |
69 | * Experimental versions released: 0x81 -- 0x99 | |
70 | */ | |
71 | /* The most significant bit being set in the version field indicates an | |
72 | * experimental OpenFlow version. | |
73 | */ | |
2e3fa633 SH |
74 | enum ofp_version { |
75 | OFP10_VERSION = 0x01, | |
76 | OFP11_VERSION = 0x02, | |
77 | OFP12_VERSION = 0x03, | |
c37c0382 | 78 | OFP13_VERSION = 0x04, |
42dccab5 | 79 | OFP14_VERSION = 0x05, |
b79d45a1 BP |
80 | OFP15_VERSION = 0x06, |
81 | OFP16_VERSION = 0x07 | |
2e3fa633 | 82 | }; |
87ea5e5e | 83 | |
514887ee BP |
84 | /* Vendor (aka experimenter) IDs. |
85 | * | |
86 | * These are used in various places in OpenFlow to identify an extension | |
87 | * defined by some vendor, as opposed to a standardized part of the core | |
88 | * OpenFlow protocol. | |
89 | * | |
90 | * Vendor IDs whose top 8 bits are 0 hold an Ethernet OUI in their low 24 bits. | |
91 | * The Open Networking Foundation assigns vendor IDs whose top 8 bits are | |
92 | * nonzero. | |
93 | * | |
94 | * A few vendor IDs are special: | |
95 | * | |
96 | * - OF_VENDOR_ID is not a real vendor ID and does not appear in the | |
97 | * OpenFlow protocol itself. It can occasionally be useful within Open | |
98 | * vSwitch to identify a standardized part of OpenFlow. | |
99 | * | |
100 | * - ONF_VENDOR_ID is being used within the ONF "extensibility" working | |
101 | * group to identify extensions being proposed for standardization. | |
52d29570 BP |
102 | * |
103 | * The list is sorted numerically. | |
514887ee BP |
104 | */ |
105 | #define OF_VENDOR_ID 0 | |
52d29570 | 106 | #define HPL_VENDOR_ID 0x000004EA /* HP Labs. */ |
c28a1f83 SH |
107 | #define NTR_VENDOR_ID 0x0000154d /* Netronome. */ |
108 | #define NTR_COMPAT_VENDOR_ID 0x00001540 /* Incorrect value used in v2.4. */ | |
514887ee BP |
109 | #define NX_VENDOR_ID 0x00002320 /* Nicira. */ |
110 | #define ONF_VENDOR_ID 0x4f4e4600 /* Open Networking Foundation. */ | |
d6e3feb5 | 111 | #define INTEL_VENDOR_ID 0x0000AA01 /* Intel */ |
514887ee | 112 | |
87ea5e5e | 113 | #define OFP_MAX_TABLE_NAME_LEN 32 |
87ea5e5e | 114 | |
125b0291 JP |
115 | #define OFP_OLD_PORT 6633 |
116 | #define OFP_PORT 6653 | |
87ea5e5e | 117 | |
31a9e63f JR |
118 | #define OFP_DEFAULT_MISS_SEND_LEN 128 |
119 | ||
120 | /* Values below this cutoff are 802.3 packets and the two bytes | |
121 | * following MAC addresses are used as a frame length. Otherwise, the | |
122 | * two bytes are used as the Ethernet type. | |
123 | */ | |
124 | #define OFP_DL_TYPE_ETH2_CUTOFF 0x0600 | |
125 | ||
126 | /* Value of dl_type to indicate that the frame does not include an | |
127 | * Ethernet type. | |
128 | */ | |
129 | #define OFP_DL_TYPE_NOT_ETH_TYPE 0x05ff | |
130 | ||
131 | /* Value used in "idle_timeout" and "hard_timeout" to indicate that the entry | |
132 | * is permanent. */ | |
133 | #define OFP_FLOW_PERMANENT 0 | |
134 | ||
135 | /* By default, choose a priority in the middle. */ | |
136 | #define OFP_DEFAULT_PRIORITY 0x8000 | |
137 | ||
138 | ||
9e1fd49b BP |
139 | /* Header on all OpenFlow packets. */ |
140 | struct ofp_header { | |
141 | uint8_t version; /* An OpenFlow version number, e.g. OFP10_VERSION. */ | |
142 | uint8_t type; /* One of the OFPT_ constants. */ | |
143 | ovs_be16 length; /* Length including this ofp_header. */ | |
144 | ovs_be32 xid; /* Transaction id associated with this packet. | |
145 | Replies use the same id as was in the request | |
146 | to facilitate pairing. */ | |
147 | }; | |
148 | OFP_ASSERT(sizeof(struct ofp_header) == 8); | |
149 | ||
31a9e63f JR |
150 | /* OFPT_ERROR: Error message (datapath -> controller). */ |
151 | struct ofp_error_msg { | |
152 | ovs_be16 type; | |
153 | ovs_be16 code; | |
154 | uint8_t data[0]; /* Variable-length data. Interpreted based | |
155 | on the type and code. */ | |
156 | }; | |
157 | OFP_ASSERT(sizeof(struct ofp_error_msg) == 4); | |
158 | ||
159 | enum ofp_config_flags { | |
160 | /* Handling of IP fragments. */ | |
161 | OFPC_FRAG_NORMAL = 0, /* No special handling for fragments. */ | |
162 | OFPC_FRAG_DROP = 1, /* Drop fragments. */ | |
163 | OFPC_FRAG_REASM = 2, /* Reassemble (only if OFPC_IP_REASM set). */ | |
164 | OFPC_FRAG_NX_MATCH = 3, /* Make first fragments available for matching. */ | |
165 | OFPC_FRAG_MASK = 3, | |
166 | ||
167 | /* OFPC_INVALID_TTL_TO_CONTROLLER is deprecated in OpenFlow 1.3 */ | |
168 | ||
169 | /* TTL processing - applicable for IP and MPLS packets. */ | |
170 | OFPC_INVALID_TTL_TO_CONTROLLER = 1 << 2, /* Send packets with invalid TTL | |
171 | to the controller. */ | |
172 | }; | |
173 | ||
174 | /* Switch configuration. */ | |
175 | struct ofp_switch_config { | |
176 | ovs_be16 flags; /* OFPC_* flags. */ | |
177 | ovs_be16 miss_send_len; /* Max bytes of new flow that datapath should | |
178 | send to the controller. */ | |
179 | }; | |
180 | OFP_ASSERT(sizeof(struct ofp_switch_config) == 4); | |
181 | ||
182 | ||
9e1fd49b BP |
183 | /* Common flags to indicate behavior of the physical port. These flags are |
184 | * used in ofp_port to describe the current configuration. They are used in | |
185 | * the ofp_port_mod message to configure the port's behavior. | |
186 | */ | |
187 | enum ofp_port_config { | |
188 | OFPPC_PORT_DOWN = 1 << 0, /* Port is administratively down. */ | |
189 | ||
190 | OFPPC_NO_RECV = 1 << 2, /* Drop all packets received by port. */ | |
191 | OFPPC_NO_FWD = 1 << 5, /* Drop packets forwarded to port. */ | |
192 | OFPPC_NO_PACKET_IN = 1 << 6 /* Do not send packet-in msgs for port. */ | |
193 | }; | |
194 | ||
195 | /* Common current state of the physical port. These are not configurable from | |
196 | * the controller. | |
197 | */ | |
198 | enum ofp_port_state { | |
199 | OFPPS_LINK_DOWN = 1 << 0, /* No physical link present. */ | |
200 | }; | |
201 | ||
202 | /* Common features of physical ports available in a datapath. */ | |
203 | enum ofp_port_features { | |
204 | OFPPF_10MB_HD = 1 << 0, /* 10 Mb half-duplex rate support. */ | |
205 | OFPPF_10MB_FD = 1 << 1, /* 10 Mb full-duplex rate support. */ | |
206 | OFPPF_100MB_HD = 1 << 2, /* 100 Mb half-duplex rate support. */ | |
207 | OFPPF_100MB_FD = 1 << 3, /* 100 Mb full-duplex rate support. */ | |
208 | OFPPF_1GB_HD = 1 << 4, /* 1 Gb half-duplex rate support. */ | |
209 | OFPPF_1GB_FD = 1 << 5, /* 1 Gb full-duplex rate support. */ | |
210 | OFPPF_10GB_FD = 1 << 6, /* 10 Gb full-duplex rate support. */ | |
211 | }; | |
212 | ||
c5562271 BP |
213 | /* Generic OpenFlow property header, as used by various messages in OF1.3+, and |
214 | * especially in OF1.4. | |
215 | * | |
216 | * The OpenFlow specs prefer to define a new structure with a specialized name | |
217 | * each time this property structure comes up: struct | |
218 | * ofp_port_desc_prop_header, struct ofp_controller_status_prop_header, struct | |
219 | * ofp_table_mod_prop_header, and more. They're all the same, so it's easier | |
220 | * to unify them. | |
221 | */ | |
222 | struct ofp_prop_header { | |
223 | ovs_be16 type; | |
224 | ovs_be16 len; | |
598ff4b2 BP |
225 | /* Followed by: |
226 | * - 'len - 4' bytes of payload. | |
227 | * - PAD_SIZE(len, 8) bytes of zeros. */ | |
c5562271 BP |
228 | }; |
229 | OFP_ASSERT(sizeof(struct ofp_prop_header) == 4); | |
230 | ||
231 | /* Generic OpenFlow experimenter property header. | |
232 | * | |
233 | * Again the OpenFlow specs define this over and over again and it's easier to | |
234 | * unify them. */ | |
235 | struct ofp_prop_experimenter { | |
236 | ovs_be16 type; /* Generally 0xffff (in one case 0xfffe). */ | |
237 | ovs_be16 len; /* Length in bytes of this property. */ | |
238 | ovs_be32 experimenter; /* Experimenter ID which takes the same form as | |
239 | * in struct ofp_experimenter_header. */ | |
240 | ovs_be32 exp_type; /* Experimenter defined. */ | |
598ff4b2 BP |
241 | /* Followed by: |
242 | * - 'len - 12' bytes of payload. | |
243 | * - PAD_SIZE(len, 8) bytes of zeros. */ | |
c5562271 BP |
244 | }; |
245 | OFP_ASSERT(sizeof(struct ofp_prop_experimenter) == 12); | |
246 | ||
9e1fd49b BP |
247 | /* Switch features. */ |
248 | struct ofp_switch_features { | |
9e1fd49b BP |
249 | ovs_be64 datapath_id; /* Datapath unique ID. The lower 48-bits are for |
250 | a MAC address, while the upper 16-bits are | |
251 | implementer-defined. */ | |
252 | ||
253 | ovs_be32 n_buffers; /* Max packets buffered at once. */ | |
254 | ||
255 | uint8_t n_tables; /* Number of tables supported by datapath. */ | |
2e1ae200 JR |
256 | uint8_t auxiliary_id; /* OF 1.3: Identify auxiliary connections */ |
257 | uint8_t pad[2]; /* Align to 64-bits. */ | |
9e1fd49b BP |
258 | |
259 | /* Features. */ | |
6b05acf8 | 260 | ovs_be32 capabilities; /* OFPC_*, OFPC10_*, OFPC11_*, OFPC12_*. */ |
2e1ae200 JR |
261 | ovs_be32 actions; /* Bitmap of supported "ofp_action_type"s. |
262 | * DEPRECATED in OpenFlow 1.1 */ | |
9e1fd49b BP |
263 | |
264 | /* Followed by an array of struct ofp10_phy_port or struct ofp11_port | |
2e1ae200 JR |
265 | * structures. The number is inferred from header.length. |
266 | * REMOVED in OpenFlow 1.3 */ | |
9e1fd49b | 267 | }; |
982697a4 | 268 | OFP_ASSERT(sizeof(struct ofp_switch_features) == 24); |
9e1fd49b BP |
269 | |
270 | /* Common capabilities supported by the datapath (struct ofp_switch_features, | |
271 | * member capabilities). */ | |
272 | enum ofp_capabilities { | |
273 | OFPC_FLOW_STATS = 1 << 0, /* Flow statistics. */ | |
274 | OFPC_TABLE_STATS = 1 << 1, /* Table statistics. */ | |
275 | OFPC_PORT_STATS = 1 << 2, /* Port statistics. */ | |
276 | OFPC_IP_REASM = 1 << 5, /* Can reassemble IP fragments. */ | |
277 | OFPC_QUEUE_STATS = 1 << 6, /* Queue statistics. */ | |
278 | OFPC_ARP_MATCH_IP = 1 << 7 /* Match IP addresses in ARP | |
279 | pkts. */ | |
280 | }; | |
281 | ||
50d25de6 SH |
282 | /* Why is this packet being sent to the controller? */ |
283 | enum ofp_packet_in_reason { | |
9bfe9334 | 284 | /* Standard reasons. */ |
50d25de6 SH |
285 | OFPR_NO_MATCH, /* No matching flow. */ |
286 | OFPR_ACTION, /* Action explicitly output to controller. */ | |
424467c6 SS |
287 | OFPR_INVALID_TTL, /* Packet has invalid TTL. */ |
288 | OFPR_ACTION_SET, /* Output to controller in action set */ | |
289 | OFPR_GROUP, /* Output to controller in group bucket */ | |
290 | OFPR_PACKET_OUT, /* Output to controller in packet-out */ | |
a930d4c5 BP |
291 | |
292 | #define OFPR10_BITS \ | |
293 | ((1u << OFPR_NO_MATCH) | (1u << OFPR_ACTION) | (1u << OFPR_INVALID_TTL)) | |
e19a6769 YHW |
294 | |
295 | /* From OF1.4+, OFPR_ACTION is split into four more descriptive reasons, | |
296 | * OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, and OFPR_PACKET_OUT. | |
297 | * OFPR_APPLY_ACTION shares the same number as OFPR_ACTION. */ | |
298 | #define OFPR14_ACTION_BITS \ | |
299 | ((1u << OFPR_ACTION_SET) | (1u << OFPR_GROUP) | (1u << OFPR_PACKET_OUT)) | |
a930d4c5 | 300 | #define OFPR14_BITS \ |
e19a6769 | 301 | (OFPR10_BITS | OFPR14_ACTION_BITS) |
a930d4c5 | 302 | |
9bfe9334 BP |
303 | /* Nonstandard reason--not exposed via OpenFlow. */ |
304 | OFPR_EXPLICIT_MISS, | |
305 | OFPR_IMPLICIT_MISS, | |
306 | ||
50d25de6 SH |
307 | OFPR_N_REASONS |
308 | }; | |
309 | ||
35805806 BP |
310 | enum ofp_flow_mod_command { |
311 | OFPFC_ADD, /* New flow. */ | |
312 | OFPFC_MODIFY, /* Modify all matching flows. */ | |
313 | OFPFC_MODIFY_STRICT, /* Modify entry strictly matching wildcards */ | |
314 | OFPFC_DELETE, /* Delete all matching flows. */ | |
315 | OFPFC_DELETE_STRICT /* Strictly match wildcards and priority. */ | |
316 | }; | |
317 | ||
318 | enum ofp_flow_mod_flags { | |
319 | OFPFF_SEND_FLOW_REM = 1 << 0, /* Send flow removed message when flow | |
320 | * expires or is deleted. */ | |
321 | OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ | |
322 | }; | |
323 | ||
50d25de6 SH |
324 | /* Why was this flow removed? */ |
325 | enum ofp_flow_removed_reason { | |
326 | OFPRR_IDLE_TIMEOUT, /* Flow idle time exceeded idle_timeout. */ | |
327 | OFPRR_HARD_TIMEOUT, /* Time exceeded hard_timeout. */ | |
04f68eb2 | 328 | OFPRR_DELETE, /* Evicted by a DELETE flow mod. */ |
1d31ece9 | 329 | OFPRR_GROUP_DELETE, /* Group was removed. */ |
638a19b0 | 330 | OFPRR_METER_DELETE, /* Meter was removed. */ |
99f837f8 | 331 | OFPRR_EVICTION, /* Switch eviction to free resources. */ |
f695ebfa | 332 | |
a930d4c5 BP |
333 | #define OFPRR10_BITS \ |
334 | ((1u << OFPRR_IDLE_TIMEOUT) | \ | |
335 | (1u << OFPRR_HARD_TIMEOUT) | \ | |
336 | (1u << OFPRR_DELETE)) | |
75754d04 | 337 | #define OFPRR13_BITS \ |
a930d4c5 | 338 | (OFPRR10_BITS | \ |
75754d04 JP |
339 | (1u << OFPRR_GROUP_DELETE)) |
340 | #define OFPRR14_BITS \ | |
341 | (OFPRR13_BITS | \ | |
a930d4c5 BP |
342 | (1u << OFPRR_METER_DELETE) | \ |
343 | (1u << OFPRR_EVICTION)) | |
344 | ||
f695ebfa | 345 | OVS_OFPRR_NONE /* OVS internal_use only, keep last!. */ |
50d25de6 SH |
346 | }; |
347 | ||
9e1fd49b BP |
348 | /* What changed about the physical port */ |
349 | enum ofp_port_reason { | |
350 | OFPPR_ADD, /* The port was added. */ | |
351 | OFPPR_DELETE, /* The port was removed. */ | |
d18cc1ee | 352 | OFPPR_MODIFY, /* Some attribute of the port has changed. */ |
a930d4c5 BP |
353 | |
354 | #define OFPPR_BITS ((1u << OFPPR_ADD) | \ | |
355 | (1u << OFPPR_DELETE) | \ | |
356 | (1u << OFPPR_MODIFY)) | |
357 | ||
d18cc1ee | 358 | OFPPR_N_REASONS /* Denotes number of reasons. */ |
9e1fd49b BP |
359 | }; |
360 | ||
361 | /* A physical port has changed in the datapath */ | |
362 | struct ofp_port_status { | |
9e1fd49b BP |
363 | uint8_t reason; /* One of OFPPR_*. */ |
364 | uint8_t pad[7]; /* Align to 64-bits. */ | |
8c3cc785 BP |
365 | /* Followed by struct ofp10_phy_port, struct ofp11_port, or struct |
366 | * ofp14_port. */ | |
9e1fd49b | 367 | }; |
982697a4 | 368 | OFP_ASSERT(sizeof(struct ofp_port_status) == 8); |
3a51996b | 369 | |
31a9e63f JR |
370 | enum ofp_stats_reply_flags { |
371 | OFPSF_REPLY_MORE = 1 << 0 /* More replies to follow. */ | |
372 | }; | |
373 | ||
e2b9ac44 BP |
374 | #define DESC_STR_LEN 256 |
375 | #define SERIAL_NUM_LEN 32 | |
376 | /* Body of reply to OFPST_DESC request. Each entry is a NULL-terminated ASCII | |
377 | * string. */ | |
378 | struct ofp_desc_stats { | |
379 | char mfr_desc[DESC_STR_LEN]; /* Manufacturer description. */ | |
380 | char hw_desc[DESC_STR_LEN]; /* Hardware description. */ | |
381 | char sw_desc[DESC_STR_LEN]; /* Software description. */ | |
382 | char serial_num[SERIAL_NUM_LEN]; /* Serial number. */ | |
383 | char dp_desc[DESC_STR_LEN]; /* Human readable description of | |
384 | the datapath. */ | |
385 | }; | |
386 | OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056); | |
387 | ||
388 | /* Reply to OFPST_AGGREGATE request. */ | |
389 | struct ofp_aggregate_stats_reply { | |
390 | ovs_32aligned_be64 packet_count; /* Number of packets in flows. */ | |
391 | ovs_32aligned_be64 byte_count; /* Number of bytes in flows. */ | |
392 | ovs_be32 flow_count; /* Number of flows. */ | |
393 | uint8_t pad[4]; /* Align to 64 bits. */ | |
394 | }; | |
395 | OFP_ASSERT(sizeof(struct ofp_aggregate_stats_reply) == 24); | |
396 | ||
04f68eb2 SH |
397 | /* The match type indicates the match structure (set of fields that compose the |
398 | * match) in use. The match type is placed in the type field at the beginning | |
399 | * of all match structures. The "OpenFlow Extensible Match" type corresponds | |
400 | * to OXM TLV format described below and must be supported by all OpenFlow | |
401 | * switches. Extensions that define other match types may be published on the | |
402 | * ONF wiki. Support for extensions is optional. | |
403 | */ | |
404 | enum ofp_match_type { | |
405 | OFPMT_STANDARD = 0, /* The match fields defined in the ofp11_match | |
406 | structure apply */ | |
6b05acf8 | 407 | OFPMT_OXM = 1, /* OpenFlow Extensible Match */ |
04f68eb2 SH |
408 | }; |
409 | ||
aa319503 BP |
410 | /* Group numbering. Groups can use any number up to OFPG_MAX. */ |
411 | enum ofp_group { | |
412 | /* Last usable group number. */ | |
413 | OFPG_MAX = 0xffffff00, | |
414 | ||
415 | /* Fake groups. */ | |
416 | OFPG_ALL = 0xfffffffc, /* All groups, for group delete commands. */ | |
417 | OFPG_ANY = 0xffffffff /* Wildcard, for flow stats requests. */ | |
418 | }; | |
419 | ||
f2e99d5d SH |
420 | /* Group configuration flags */ |
421 | enum ofp_group_capabilities { | |
422 | OFPGFC_SELECT_WEIGHT = 1 << 0, /* Support weight for select groups */ | |
423 | OFPGFC_SELECT_LIVENESS = 1 << 1, /* Support liveness for select groups */ | |
424 | OFPGFC_CHAINING = 1 << 2, /* Support chaining groups */ | |
425 | OFPGFC_CHAINING_CHECKS = 1 << 3, /* Check chaining for loops and delete */ | |
426 | }; | |
427 | ||
de6c85b0 SH |
428 | enum ofp_hello_elem_type { |
429 | OFPHET_VERSIONBITMAP = 1, /* Bitmap of version supported. */ | |
430 | }; | |
431 | ||
432 | /* Common header for all Hello Elements */ | |
433 | struct ofp_hello_elem_header { | |
434 | ovs_be16 type; /* One of OFPHET_*. */ | |
435 | ovs_be16 length; /* Length in bytes of this element. */ | |
436 | }; | |
437 | OFP_ASSERT(sizeof(struct ofp_hello_elem_header) == 4); | |
438 | ||
083761ad SH |
439 | /* Table numbering. Tables can use any number up to OFPT_MAX. */ |
440 | enum ofp_table { | |
441 | /* Last usable table number. */ | |
442 | OFPTT_MAX = 0xfe, | |
443 | ||
444 | /* Fake tables. */ | |
445 | OFPTT_ALL = 0xff /* Wildcard table used for table config, | |
446 | flow stats and flow deletes. */ | |
447 | }; | |
448 | ||
3767b631 | 449 | enum ofp_table_config { |
41b34c7d SH |
450 | /* OpenFlow 1.1 and 1.2 defined this field as shown. |
451 | * OpenFlow 1.3 and later mark this field as deprecated, but have not | |
452 | * reused it for any new purpose. */ | |
453 | OFPTC11_TABLE_MISS_CONTROLLER = 0 << 0, /* Send to controller. */ | |
454 | OFPTC11_TABLE_MISS_CONTINUE = 1 << 0, /* Go to next table, like OF1.0. */ | |
455 | OFPTC11_TABLE_MISS_DROP = 2 << 0, /* Drop the packet. */ | |
456 | OFPTC11_TABLE_MISS_MASK = 3 << 0, | |
457 | ||
458 | /* OpenFlow 1.4. */ | |
459 | OFPTC14_EVICTION = 1 << 2, /* Allow table to evict flows. */ | |
460 | OFPTC14_VACANCY_EVENTS = 1 << 3, /* Enable vacancy events. */ | |
3767b631 SH |
461 | }; |
462 | ||
2482b0b0 JS |
463 | /* Header and packet type name spaces. */ |
464 | enum ofp_header_type_namespaces { | |
465 | OFPHTN_ONF = 0, /* ONF namespace. */ | |
466 | OFPHTN_ETHERTYPE = 1, /* ns_type is an Ethertype. */ | |
467 | OFPHTN_IP_PROTO = 2, /* ns_type is a IP protocol number. */ | |
468 | OFPHTN_UDP_TCP_PORT = 3, /* ns_type is a TCP or UDP port. */ | |
469 | OFPHTN_IPV4_OPTION = 4, /* ns_type is an IPv4 option number. */ | |
470 | }; | |
471 | ||
87ea5e5e | 472 | #endif /* openflow/openflow-common.h */ |