1 /* Copyright (c) 2008, 2014 The Board of Trustees of The Leland Stanford
3 * Copyright (c) 2011, 2014 Open Networking Foundation
5 * We are making the OpenFlow specification and associated documentation
6 * (Software) available for public use and benefit with the expectation
7 * that others will use, modify and enhance the Software and contribute
8 * those enhancements back to the community. However, since we would
9 * like to make the Software available for broadest use, with as few
10 * restrictions as possible permission is hereby granted, free of
11 * charge, to any person obtaining a copy of this Software to deal in
12 * the Software under the copyrights without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sublicense, and/or sell copies of the Software, and to
15 * permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
25 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * The name and trademarks of copyright holder(s) may NOT be used in
31 * advertising or publicity pertaining to the Software or any
32 * derivatives without specific, written prior permission.
35 /* OpenFlow: protocol between controller and datapath. */
38 #define OPENFLOW_15_H 1
40 #include <openflow/openflow-common.h>
42 /* Body for ofp15_multipart_request of type OFPMP_PORT_DESC. */
43 struct ofp15_port_desc_request {
44 ovs_be32 port_no; /* All ports if OFPP_ANY. */
45 uint8_t pad[4]; /* Align to 64 bits. */
47 OFP_ASSERT(sizeof(struct ofp15_port_desc_request) == 8);
50 enum ofp15_group_mod_command {
51 /* Present since OpenFlow 1.1 - 1.4 */
52 OFPGC15_ADD = 0, /* New group. */
53 OFPGC15_MODIFY = 1, /* Modify all matching groups. */
54 OFPGC15_DELETE = 2, /* Delete all matching groups. */
56 /* New in OpenFlow 1.5 */
57 OFPGC15_INSERT_BUCKET = 3,/* Insert action buckets to the already available
58 list of action buckets in a matching group */
59 /* OFPGCXX_YYY = 4, */ /* Reserved for future use. */
60 OFPGC15_REMOVE_BUCKET = 5,/* Remove all action buckets or any specific
61 action bucket from matching group */
64 /* Group bucket property types. */
65 enum ofp15_group_bucket_prop_type {
66 OFPGBPT15_WEIGHT = 0, /* Select groups only. */
67 OFPGBPT15_WATCH_PORT = 1, /* Fast failover groups only. */
68 OFPGBPT15_WATCH_GROUP = 2, /* Fast failover groups only. */
69 OFPGBPT15_EXPERIMENTER = 0xFFFF, /* Experimenter defined. */
72 /* Bucket for use in groups. */
74 ovs_be16 len; /* Length the bucket in bytes, including
75 this header and any padding to make it
77 ovs_be16 action_array_len; /* Length of all actions in bytes. */
78 ovs_be32 bucket_id; /* Bucket Id used to identify bucket*/
79 /* Followed by exactly len - 8 bytes of group bucket properties. */
81 * - Exactly 'action_array_len' bytes containing an array of
82 * struct ofp_action_*.
83 * - Zero or more bytes of group bucket properties to fill out the
84 * overall length in header.length. */
86 OFP_ASSERT(sizeof(struct ofp15_bucket) == 8);
88 /* Bucket Id can be any value between 0 and OFPG_BUCKET_MAX */
89 enum ofp15_group_bucket {
90 OFPG15_BUCKET_MAX = 0xffffff00, /* Last usable bucket ID */
91 OFPG15_BUCKET_FIRST = 0xfffffffd, /* First bucket ID in the list of action
92 buckets of a group. This is applicable
93 for OFPGC15_INSERT_BUCKET and
94 OFPGC15_REMOVE_BUCKET commands */
95 OFPG15_BUCKET_LAST = 0xfffffffe, /* Last bucket ID in the list of action
96 buckets of a group. This is applicable
97 for OFPGC15_INSERT_BUCKET and
98 OFPGC15_REMOVE_BUCKET commands */
99 OFPG15_BUCKET_ALL = 0xffffffff /* All action buckets in a group,
100 This is applicable for
101 only OFPGC15_REMOVE_BUCKET command */
104 /* Group property types. */
105 enum ofp_group_prop_type {
106 OFPGPT15_EXPERIMENTER = 0xFFFF, /* Experimenter defined. */
109 /* Group setup and teardown (controller -> datapath). */
110 struct ofp15_group_mod {
111 ovs_be16 command; /* One of OFPGC15_*. */
112 uint8_t type; /* One of OFPGT11_*. */
113 uint8_t pad; /* Pad to 64 bits. */
114 ovs_be32 group_id; /* Group identifier. */
115 ovs_be16 bucket_array_len; /* Length of action buckets data. */
116 uint8_t pad1[2]; /* Pad to 64 bits. */
117 ovs_be32 command_bucket_id; /* Bucket Id used as part of
118 * OFPGC15_INSERT_BUCKET and
119 * OFPGC15_REMOVE_BUCKET commands
122 * - Exactly 'bucket_array_len' bytes containing an array of
123 * struct ofp15_bucket.
124 * - Zero or more bytes of group properties to fill out the overall
125 * length in header.length. */
127 OFP_ASSERT(sizeof(struct ofp15_group_mod) == 16);
129 /* Body for ofp15_multipart_request of type OFPMP_GROUP_DESC. */
130 struct ofp15_group_desc_request {
131 ovs_be32 group_id; /* All groups if OFPG_ALL. */
132 uint8_t pad[4]; /* Align to 64 bits. */
134 OFP_ASSERT(sizeof(struct ofp15_group_desc_request) == 8);
136 /* Body of reply to OFPMP_GROUP_DESC request. */
137 struct ofp15_group_desc_stats {
138 ovs_be16 length; /* Length of this entry. */
139 uint8_t type; /* One of OFPGT11_*. */
140 uint8_t pad; /* Pad to 64 bits. */
141 ovs_be32 group_id; /* Group identifier. */
142 ovs_be16 bucket_list_len; /* Length of action buckets data. */
143 uint8_t pad2[6]; /* Pad to 64 bits. */
145 * - Exactly 'bucket_list_len' bytes containing an array of
147 * - Zero or more bytes of group properties to fill out the overall
148 * length in header.length. */
150 OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16);
152 #endif /* openflow/openflow-1.5.h */