]>
Commit | Line | Data |
---|---|---|
53931554 | 1 | /* |
c2d936a4 | 2 | * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. |
53931554 BP |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | /* OpenFlow: protocol between controller and datapath. */ | |
18 | ||
19 | #ifndef OPENFLOW_OPENFLOW10_H | |
20 | #define OPENFLOW_OPENFLOW10_H 1 | |
21 | ||
1825f2ec | 22 | #include <openflow/openflow-common.h> |
53931554 | 23 | |
c6100d92 BP |
24 | /* Port number(s) meaning |
25 | * --------------- -------------------------------------- | |
26 | * 0x0000 not assigned a meaning by OpenFlow 1.0 | |
27 | * 0x0001...0xfeff "physical" ports | |
c61f3870 BP |
28 | * 0xff00...0xfff6 "reserved" but not assigned a meaning by OpenFlow 1.x |
29 | * 0xfff7...0xffff "reserved" OFPP_* ports with assigned meanings | |
c6100d92 | 30 | */ |
53931554 | 31 | |
4e022ec0 AW |
32 | /* Ranges. */ |
33 | #define OFPP_MAX OFP_PORT_C(0xff00) /* Max # of switch ports. */ | |
c61f3870 | 34 | #define OFPP_FIRST_RESV OFP_PORT_C(0xfff7) /* First assigned reserved port. */ |
4e022ec0 AW |
35 | #define OFPP_LAST_RESV OFP_PORT_C(0xffff) /* Last assigned reserved port. */ |
36 | ||
37 | /* Reserved output "ports". */ | |
c61f3870 | 38 | #define OFPP_UNSET OFP_PORT_C(0xfff7) /* For OXM_OF_ACTSET_OUTPUT only. */ |
4e022ec0 AW |
39 | #define OFPP_IN_PORT OFP_PORT_C(0xfff8) /* Where the packet came in. */ |
40 | #define OFPP_TABLE OFP_PORT_C(0xfff9) /* Perform actions in flow table. */ | |
41 | #define OFPP_NORMAL OFP_PORT_C(0xfffa) /* Process with normal L2/L3. */ | |
42 | #define OFPP_FLOOD OFP_PORT_C(0xfffb) /* All ports except input port and | |
43 | * ports disabled by STP. */ | |
44 | #define OFPP_ALL OFP_PORT_C(0xfffc) /* All ports except input port. */ | |
45 | #define OFPP_CONTROLLER OFP_PORT_C(0xfffd) /* Send to controller. */ | |
46 | #define OFPP_LOCAL OFP_PORT_C(0xfffe) /* Local openflow "port". */ | |
47 | #define OFPP_NONE OFP_PORT_C(0xffff) /* Not associated with any port. */ | |
53931554 | 48 | |
9e1fd49b BP |
49 | /* OpenFlow 1.0 specific capabilities supported by the datapath (struct |
50 | * ofp_switch_features, member capabilities). */ | |
51 | enum ofp10_capabilities { | |
52 | OFPC10_STP = 1 << 3, /* 802.1d spanning tree. */ | |
53 | OFPC10_RESERVED = 1 << 4, /* Reserved, must not be set. */ | |
53931554 BP |
54 | }; |
55 | ||
9e1fd49b BP |
56 | /* OpenFlow 1.0 specific flags to indicate behavior of the physical port. |
57 | * These flags are used in ofp10_phy_port to describe the current | |
58 | * configuration. They are used in the ofp10_port_mod message to configure the | |
59 | * port's behavior. | |
53931554 | 60 | */ |
9e1fd49b BP |
61 | enum ofp10_port_config { |
62 | OFPPC10_NO_STP = 1 << 1, /* Disable 802.1D spanning tree on port. */ | |
63 | OFPPC10_NO_RECV_STP = 1 << 3, /* Drop received 802.1D STP packets. */ | |
64 | OFPPC10_NO_FLOOD = 1 << 4, /* Do not include port when flooding. */ | |
65 | #define OFPPC10_ALL (OFPPC_PORT_DOWN | OFPPC10_NO_STP | OFPPC_NO_RECV | \ | |
66 | OFPPC10_NO_RECV_STP | OFPPC10_NO_FLOOD | OFPPC_NO_FWD | \ | |
67 | OFPPC_NO_PACKET_IN) | |
53931554 BP |
68 | }; |
69 | ||
9e1fd49b BP |
70 | /* OpenFlow 1.0 specific current state of the physical port. These are not |
71 | * configurable from the controller. | |
53931554 | 72 | */ |
9e1fd49b BP |
73 | enum ofp10_port_state { |
74 | /* The OFPPS10_STP_* bits have no effect on switch operation. The | |
53931554 BP |
75 | * controller must adjust OFPPC_NO_RECV, OFPPC_NO_FWD, and |
76 | * OFPPC_NO_PACKET_IN appropriately to fully implement an 802.1D spanning | |
77 | * tree. */ | |
9e1fd49b BP |
78 | OFPPS10_STP_LISTEN = 0 << 8, /* Not learning or relaying frames. */ |
79 | OFPPS10_STP_LEARN = 1 << 8, /* Learning but not relaying frames. */ | |
80 | OFPPS10_STP_FORWARD = 2 << 8, /* Learning and relaying frames. */ | |
81 | OFPPS10_STP_BLOCK = 3 << 8, /* Not part of spanning tree. */ | |
82 | OFPPS10_STP_MASK = 3 << 8 /* Bit mask for OFPPS10_STP_* values. */ | |
83 | ||
84 | #define OFPPS10_ALL (OFPPS_LINK_DOWN | OFPPS10_STP_MASK) | |
53931554 BP |
85 | }; |
86 | ||
9e1fd49b BP |
87 | /* OpenFlow 1.0 specific features of physical ports available in a datapath. */ |
88 | enum ofp10_port_features { | |
89 | OFPPF10_COPPER = 1 << 7, /* Copper medium. */ | |
90 | OFPPF10_FIBER = 1 << 8, /* Fiber medium. */ | |
91 | OFPPF10_AUTONEG = 1 << 9, /* Auto-negotiation. */ | |
92 | OFPPF10_PAUSE = 1 << 10, /* Pause. */ | |
93 | OFPPF10_PAUSE_ASYM = 1 << 11 /* Asymmetric pause. */ | |
53931554 BP |
94 | }; |
95 | ||
96 | /* Description of a physical port */ | |
9e1fd49b | 97 | struct ofp10_phy_port { |
53931554 | 98 | ovs_be16 port_no; |
74ff3298 | 99 | struct eth_addr hw_addr; |
53931554 BP |
100 | char name[OFP_MAX_PORT_NAME_LEN]; /* Null-terminated */ |
101 | ||
9e1fd49b BP |
102 | ovs_be32 config; /* Bitmap of OFPPC_* and OFPPC10_* flags. */ |
103 | ovs_be32 state; /* Bitmap of OFPPS_* and OFPPS10_* flags. */ | |
53931554 | 104 | |
9e1fd49b BP |
105 | /* Bitmaps of OFPPF_* and OFPPF10_* that describe features. All bits |
106 | * zeroed if unsupported or unavailable. */ | |
53931554 BP |
107 | ovs_be32 curr; /* Current features. */ |
108 | ovs_be32 advertised; /* Features being advertised by the port. */ | |
109 | ovs_be32 supported; /* Features supported by the port. */ | |
110 | ovs_be32 peer; /* Features advertised by peer. */ | |
111 | }; | |
9e1fd49b | 112 | OFP_ASSERT(sizeof(struct ofp10_phy_port) == 48); |
53931554 BP |
113 | |
114 | /* Modify behavior of the physical port */ | |
9e1fd49b | 115 | struct ofp10_port_mod { |
53931554 | 116 | ovs_be16 port_no; |
74ff3298 JR |
117 | struct eth_addr hw_addr; /* The hardware address is not configurable. This |
118 | is used to sanity-check the request, so it must | |
119 | be the same as returned in an ofp10_phy_port | |
120 | struct. */ | |
53931554 BP |
121 | |
122 | ovs_be32 config; /* Bitmap of OFPPC_* flags. */ | |
123 | ovs_be32 mask; /* Bitmap of OFPPC_* flags to be changed. */ | |
124 | ||
125 | ovs_be32 advertise; /* Bitmap of "ofp_port_features"s. Zero all | |
126 | bits to prevent any action taking place. */ | |
127 | uint8_t pad[4]; /* Pad to 64-bits. */ | |
128 | }; | |
982697a4 | 129 | OFP_ASSERT(sizeof(struct ofp10_port_mod) == 24); |
e8f9a7bb VG |
130 | |
131 | struct ofp10_packet_queue { | |
132 | ovs_be32 queue_id; /* id for the specific queue. */ | |
133 | ovs_be16 len; /* Length in bytes of this queue desc. */ | |
134 | uint8_t pad[2]; /* 64-bit alignment. */ | |
135 | /* Followed by any number of queue properties expressed using | |
136 | * ofp_queue_prop_header, to fill out a total of 'len' bytes. */ | |
137 | }; | |
138 | OFP_ASSERT(sizeof(struct ofp10_packet_queue) == 8); | |
53931554 | 139 | |
688af176 SH |
140 | /* Query for port queue configuration. */ |
141 | struct ofp10_queue_get_config_request { | |
688af176 SH |
142 | ovs_be16 port; /* Port to be queried. Should refer |
143 | to a valid physical port (i.e. < OFPP_MAX) */ | |
144 | uint8_t pad[2]; | |
145 | /* 32-bit alignment. */ | |
146 | }; | |
982697a4 | 147 | OFP_ASSERT(sizeof(struct ofp10_queue_get_config_request) == 4); |
688af176 SH |
148 | |
149 | /* Queue configuration for a given port. */ | |
150 | struct ofp10_queue_get_config_reply { | |
688af176 SH |
151 | ovs_be16 port; |
152 | uint8_t pad[6]; | |
153 | /* struct ofp10_packet_queue queues[0]; List of configured queues. */ | |
154 | }; | |
982697a4 | 155 | OFP_ASSERT(sizeof(struct ofp10_queue_get_config_reply) == 8); |
688af176 | 156 | |
53931554 | 157 | /* Packet received on port (datapath -> controller). */ |
31a9e63f | 158 | struct ofp10_packet_in { |
53931554 BP |
159 | ovs_be32 buffer_id; /* ID assigned by datapath. */ |
160 | ovs_be16 total_len; /* Full length of frame. */ | |
161 | ovs_be16 in_port; /* Port on which frame was received. */ | |
162 | uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */ | |
163 | uint8_t pad; | |
164 | uint8_t data[0]; /* Ethernet frame, halfway through 32-bit word, | |
165 | so the IP header is 32-bit aligned. The | |
166 | amount of data is inferred from the length | |
167 | field in the header. Because of padding, | |
168 | offsetof(struct ofp_packet_in, data) == | |
169 | sizeof(struct ofp_packet_in) - 2. */ | |
170 | }; | |
31a9e63f | 171 | OFP_ASSERT(sizeof(struct ofp10_packet_in) == 12); |
53931554 | 172 | |
53931554 | 173 | /* Send packet (controller -> datapath). */ |
31a9e63f | 174 | struct ofp10_packet_out { |
53931554 BP |
175 | ovs_be32 buffer_id; /* ID assigned by datapath or UINT32_MAX. */ |
176 | ovs_be16 in_port; /* Packet's input port (OFPP_NONE if none). */ | |
177 | ovs_be16 actions_len; /* Size of action array in bytes. */ | |
178 | /* Followed by: | |
179 | * - Exactly 'actions_len' bytes (possibly 0 bytes, and always a multiple | |
180 | * of 8) containing actions. | |
181 | * - If 'buffer_id' == UINT32_MAX, packet data to fill out the remainder | |
182 | * of the message length. | |
183 | */ | |
184 | }; | |
31a9e63f | 185 | OFP_ASSERT(sizeof(struct ofp10_packet_out) == 8); |
53931554 | 186 | |
53931554 | 187 | /* Flow wildcards. */ |
31a9e63f | 188 | enum ofp10_flow_wildcards { |
eec25dc1 BP |
189 | OFPFW10_IN_PORT = 1 << 0, /* Switch input port. */ |
190 | OFPFW10_DL_VLAN = 1 << 1, /* VLAN vid. */ | |
191 | OFPFW10_DL_SRC = 1 << 2, /* Ethernet source address. */ | |
192 | OFPFW10_DL_DST = 1 << 3, /* Ethernet destination address. */ | |
193 | OFPFW10_DL_TYPE = 1 << 4, /* Ethernet frame type. */ | |
194 | OFPFW10_NW_PROTO = 1 << 5, /* IP protocol. */ | |
195 | OFPFW10_TP_SRC = 1 << 6, /* TCP/UDP source port. */ | |
196 | OFPFW10_TP_DST = 1 << 7, /* TCP/UDP destination port. */ | |
53931554 BP |
197 | |
198 | /* IP source address wildcard bit count. 0 is exact match, 1 ignores the | |
199 | * LSB, 2 ignores the 2 least-significant bits, ..., 32 and higher wildcard | |
200 | * the entire field. This is the *opposite* of the usual convention where | |
201 | * e.g. /24 indicates that 8 bits (not 24 bits) are wildcarded. */ | |
eec25dc1 BP |
202 | OFPFW10_NW_SRC_SHIFT = 8, |
203 | OFPFW10_NW_SRC_BITS = 6, | |
204 | OFPFW10_NW_SRC_MASK = (((1 << OFPFW10_NW_SRC_BITS) - 1) | |
205 | << OFPFW10_NW_SRC_SHIFT), | |
206 | OFPFW10_NW_SRC_ALL = 32 << OFPFW10_NW_SRC_SHIFT, | |
53931554 BP |
207 | |
208 | /* IP destination address wildcard bit count. Same format as source. */ | |
eec25dc1 BP |
209 | OFPFW10_NW_DST_SHIFT = 14, |
210 | OFPFW10_NW_DST_BITS = 6, | |
211 | OFPFW10_NW_DST_MASK = (((1 << OFPFW10_NW_DST_BITS) - 1) | |
212 | << OFPFW10_NW_DST_SHIFT), | |
213 | OFPFW10_NW_DST_ALL = 32 << OFPFW10_NW_DST_SHIFT, | |
53931554 | 214 | |
eec25dc1 BP |
215 | OFPFW10_DL_VLAN_PCP = 1 << 20, /* VLAN priority. */ |
216 | OFPFW10_NW_TOS = 1 << 21, /* IP ToS (DSCP field, 6 bits). */ | |
53931554 BP |
217 | |
218 | /* Wildcard all fields. */ | |
eec25dc1 | 219 | OFPFW10_ALL = ((1 << 22) - 1) |
53931554 BP |
220 | }; |
221 | ||
222 | /* The wildcards for ICMP type and code fields use the transport source | |
223 | * and destination port fields, respectively. */ | |
eec25dc1 BP |
224 | #define OFPFW10_ICMP_TYPE OFPFW10_TP_SRC |
225 | #define OFPFW10_ICMP_CODE OFPFW10_TP_DST | |
53931554 | 226 | |
53931554 | 227 | /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate |
f9515094 | 228 | * special conditions. All ones indicates that 802.1Q header is not present. |
53931554 | 229 | */ |
0c436519 | 230 | #define OFP10_VLAN_NONE 0xffff |
53931554 BP |
231 | |
232 | /* Fields to match against flows */ | |
eec25dc1 | 233 | struct ofp10_match { |
53931554 BP |
234 | ovs_be32 wildcards; /* Wildcard fields. */ |
235 | ovs_be16 in_port; /* Input switch port. */ | |
74ff3298 JR |
236 | struct eth_addr dl_src; /* Ethernet source address. */ |
237 | struct eth_addr dl_dst; /* Ethernet destination address. */ | |
53931554 BP |
238 | ovs_be16 dl_vlan; /* Input VLAN. */ |
239 | uint8_t dl_vlan_pcp; /* Input VLAN priority. */ | |
240 | uint8_t pad1[1]; /* Align to 64-bits. */ | |
241 | ovs_be16 dl_type; /* Ethernet frame type. */ | |
242 | uint8_t nw_tos; /* IP ToS (DSCP field, 6 bits). */ | |
243 | uint8_t nw_proto; /* IP protocol or lower 8 bits of | |
244 | ARP opcode. */ | |
245 | uint8_t pad2[2]; /* Align to 64-bits. */ | |
246 | ovs_be32 nw_src; /* IP source address. */ | |
247 | ovs_be32 nw_dst; /* IP destination address. */ | |
248 | ovs_be16 tp_src; /* TCP/UDP source port. */ | |
249 | ovs_be16 tp_dst; /* TCP/UDP destination port. */ | |
250 | }; | |
eec25dc1 | 251 | OFP_ASSERT(sizeof(struct ofp10_match) == 40); |
53931554 | 252 | |
35805806 | 253 | enum ofp10_flow_mod_flags { |
1828ae51 | 254 | OFPFF10_EMERG = 1 << 2 /* Part of "emergency flow cache". */ |
53931554 BP |
255 | }; |
256 | ||
257 | /* Flow setup and teardown (controller -> datapath). */ | |
35805806 | 258 | struct ofp10_flow_mod { |
eec25dc1 | 259 | struct ofp10_match match; /* Fields to match */ |
53931554 BP |
260 | ovs_be64 cookie; /* Opaque controller-issued identifier. */ |
261 | ||
262 | /* Flow actions. */ | |
263 | ovs_be16 command; /* One of OFPFC_*. */ | |
264 | ovs_be16 idle_timeout; /* Idle time before discarding (seconds). */ | |
265 | ovs_be16 hard_timeout; /* Max time before discarding (seconds). */ | |
266 | ovs_be16 priority; /* Priority level of flow entry. */ | |
267 | ovs_be32 buffer_id; /* Buffered packet to apply to (or -1). | |
268 | Not meaningful for OFPFC_DELETE*. */ | |
269 | ovs_be16 out_port; /* For OFPFC_DELETE* commands, require | |
270 | matching entries to include this as an | |
271 | output port. A value of OFPP_NONE | |
272 | indicates no restriction. */ | |
273 | ovs_be16 flags; /* One of OFPFF_*. */ | |
c2d936a4 BP |
274 | |
275 | /* Followed by OpenFlow actions whose length is inferred from the length | |
276 | * field in the OpenFlow header. */ | |
53931554 | 277 | }; |
35805806 | 278 | OFP_ASSERT(sizeof(struct ofp10_flow_mod) == 64); |
53931554 | 279 | |
53931554 | 280 | /* Flow removed (datapath -> controller). */ |
31a9e63f | 281 | struct ofp10_flow_removed { |
eec25dc1 | 282 | struct ofp10_match match; /* Description of fields. */ |
53931554 BP |
283 | ovs_be64 cookie; /* Opaque controller-issued identifier. */ |
284 | ||
285 | ovs_be16 priority; /* Priority level of flow entry. */ | |
286 | uint8_t reason; /* One of OFPRR_*. */ | |
287 | uint8_t pad[1]; /* Align to 32-bits. */ | |
288 | ||
289 | ovs_be32 duration_sec; /* Time flow was alive in seconds. */ | |
290 | ovs_be32 duration_nsec; /* Time flow was alive in nanoseconds beyond | |
291 | duration_sec. */ | |
292 | ovs_be16 idle_timeout; /* Idle timeout from original flow mod. */ | |
293 | uint8_t pad2[2]; /* Align to 64-bits. */ | |
294 | ovs_be64 packet_count; | |
295 | ovs_be64 byte_count; | |
296 | }; | |
31a9e63f | 297 | OFP_ASSERT(sizeof(struct ofp10_flow_removed) == 80); |
53931554 | 298 | |
53931554 | 299 | /* Statistics request or reply message. */ |
e2b9ac44 | 300 | struct ofp10_stats_msg { |
53931554 BP |
301 | struct ofp_header header; |
302 | ovs_be16 type; /* One of the OFPST_* constants. */ | |
303 | ovs_be16 flags; /* Requests: always 0. | |
304 | * Replies: 0 or OFPSF_REPLY_MORE. */ | |
305 | }; | |
e2b9ac44 | 306 | OFP_ASSERT(sizeof(struct ofp10_stats_msg) == 12); |
53931554 | 307 | |
53931554 | 308 | /* Stats request of type OFPST_AGGREGATE or OFPST_FLOW. */ |
e2b9ac44 | 309 | struct ofp10_flow_stats_request { |
eec25dc1 | 310 | struct ofp10_match match; /* Fields to match. */ |
53931554 BP |
311 | uint8_t table_id; /* ID of table to read (from ofp_table_stats) |
312 | or 0xff for all tables. */ | |
313 | uint8_t pad; /* Align to 32 bits. */ | |
314 | ovs_be16 out_port; /* Require matching entries to include this | |
315 | as an output port. A value of OFPP_NONE | |
316 | indicates no restriction. */ | |
317 | }; | |
e2b9ac44 | 318 | OFP_ASSERT(sizeof(struct ofp10_flow_stats_request) == 44); |
53931554 BP |
319 | |
320 | /* Body of reply to OFPST_FLOW request. */ | |
e2b9ac44 | 321 | struct ofp10_flow_stats { |
53931554 BP |
322 | ovs_be16 length; /* Length of this entry. */ |
323 | uint8_t table_id; /* ID of table flow came from. */ | |
324 | uint8_t pad; | |
eec25dc1 | 325 | struct ofp10_match match; /* Description of fields. */ |
53931554 BP |
326 | ovs_be32 duration_sec; /* Time flow has been alive in seconds. */ |
327 | ovs_be32 duration_nsec; /* Time flow has been alive in nanoseconds | |
328 | beyond duration_sec. */ | |
329 | ovs_be16 priority; /* Priority of the entry. Only meaningful | |
330 | when this is not an exact-match entry. */ | |
331 | ovs_be16 idle_timeout; /* Number of seconds idle before expiration. */ | |
332 | ovs_be16 hard_timeout; /* Number of seconds before expiration. */ | |
333 | uint8_t pad2[6]; /* Align to 64 bits. */ | |
334 | ovs_32aligned_be64 cookie; /* Opaque controller-issued identifier. */ | |
335 | ovs_32aligned_be64 packet_count; /* Number of packets in flow. */ | |
336 | ovs_32aligned_be64 byte_count; /* Number of bytes in flow. */ | |
c2d936a4 | 337 | /* Followed by OpenFlow actions whose length is inferred from 'length'. */ |
53931554 | 338 | }; |
e2b9ac44 | 339 | OFP_ASSERT(sizeof(struct ofp10_flow_stats) == 88); |
53931554 BP |
340 | |
341 | /* Body of reply to OFPST_TABLE request. */ | |
e2b9ac44 | 342 | struct ofp10_table_stats { |
53931554 BP |
343 | uint8_t table_id; /* Identifier of table. Lower numbered tables |
344 | are consulted first. */ | |
345 | uint8_t pad[3]; /* Align to 32-bits. */ | |
346 | char name[OFP_MAX_TABLE_NAME_LEN]; | |
eec25dc1 | 347 | ovs_be32 wildcards; /* Bitmap of OFPFW10_* wildcards that are |
53931554 BP |
348 | supported by the table. */ |
349 | ovs_be32 max_entries; /* Max number of entries supported. */ | |
350 | ovs_be32 active_count; /* Number of active entries. */ | |
351 | ovs_32aligned_be64 lookup_count; /* # of packets looked up in table. */ | |
352 | ovs_32aligned_be64 matched_count; /* Number of packets that hit table. */ | |
353 | }; | |
e2b9ac44 | 354 | OFP_ASSERT(sizeof(struct ofp10_table_stats) == 64); |
53931554 BP |
355 | |
356 | /* Stats request of type OFPST_PORT. */ | |
e2b9ac44 | 357 | struct ofp10_port_stats_request { |
53931554 BP |
358 | ovs_be16 port_no; /* OFPST_PORT message may request statistics |
359 | for a single port (specified with port_no) | |
360 | or for all ports (port_no == OFPP_NONE). */ | |
361 | uint8_t pad[6]; | |
362 | }; | |
e2b9ac44 | 363 | OFP_ASSERT(sizeof(struct ofp10_port_stats_request) == 8); |
53931554 BP |
364 | |
365 | /* Body of reply to OFPST_PORT request. If a counter is unsupported, set | |
366 | * the field to all ones. */ | |
e2b9ac44 | 367 | struct ofp10_port_stats { |
53931554 BP |
368 | ovs_be16 port_no; |
369 | uint8_t pad[6]; /* Align to 64-bits. */ | |
370 | ovs_32aligned_be64 rx_packets; /* Number of received packets. */ | |
371 | ovs_32aligned_be64 tx_packets; /* Number of transmitted packets. */ | |
372 | ovs_32aligned_be64 rx_bytes; /* Number of received bytes. */ | |
373 | ovs_32aligned_be64 tx_bytes; /* Number of transmitted bytes. */ | |
374 | ovs_32aligned_be64 rx_dropped; /* Number of packets dropped by RX. */ | |
375 | ovs_32aligned_be64 tx_dropped; /* Number of packets dropped by TX. */ | |
376 | ovs_32aligned_be64 rx_errors; /* Number of receive errors. This is a | |
377 | super-set of receive errors and should be | |
378 | great than or equal to the sum of all | |
379 | rx_*_err values. */ | |
380 | ovs_32aligned_be64 tx_errors; /* Number of transmit errors. This is a | |
381 | super-set of transmit errors. */ | |
382 | ovs_32aligned_be64 rx_frame_err; /* Number of frame alignment errors. */ | |
383 | ovs_32aligned_be64 rx_over_err; /* Number of packets with RX overrun. */ | |
384 | ovs_32aligned_be64 rx_crc_err; /* Number of CRC errors. */ | |
385 | ovs_32aligned_be64 collisions; /* Number of collisions. */ | |
386 | }; | |
e2b9ac44 | 387 | OFP_ASSERT(sizeof(struct ofp10_port_stats) == 104); |
53931554 BP |
388 | |
389 | /* All ones is used to indicate all queues in a port (for stats retrieval). */ | |
390 | #define OFPQ_ALL 0xffffffff | |
391 | ||
392 | /* Body for stats request of type OFPST_QUEUE. */ | |
e2b9ac44 | 393 | struct ofp10_queue_stats_request { |
53931554 BP |
394 | ovs_be16 port_no; /* All ports if OFPP_ALL. */ |
395 | uint8_t pad[2]; /* Align to 32-bits. */ | |
396 | ovs_be32 queue_id; /* All queues if OFPQ_ALL. */ | |
397 | }; | |
e2b9ac44 | 398 | OFP_ASSERT(sizeof(struct ofp10_queue_stats_request) == 8); |
53931554 BP |
399 | |
400 | /* Body for stats reply of type OFPST_QUEUE consists of an array of this | |
401 | * structure type. */ | |
e2b9ac44 | 402 | struct ofp10_queue_stats { |
53931554 BP |
403 | ovs_be16 port_no; |
404 | uint8_t pad[2]; /* Align to 32-bits. */ | |
405 | ovs_be32 queue_id; /* Queue id. */ | |
406 | ovs_32aligned_be64 tx_bytes; /* Number of transmitted bytes. */ | |
407 | ovs_32aligned_be64 tx_packets; /* Number of transmitted packets. */ | |
408 | ovs_32aligned_be64 tx_errors; /* # of packets dropped due to overrun. */ | |
409 | }; | |
e2b9ac44 | 410 | OFP_ASSERT(sizeof(struct ofp10_queue_stats) == 32); |
53931554 BP |
411 | |
412 | /* Vendor extension stats message. */ | |
982697a4 | 413 | struct ofp10_vendor_stats_msg { |
e2b9ac44 | 414 | struct ofp10_stats_msg osm; /* Type OFPST_VENDOR. */ |
53931554 BP |
415 | ovs_be32 vendor; /* Vendor ID: |
416 | * - MSB 0: low-order bytes are IEEE OUI. | |
417 | * - MSB != 0: defined by OpenFlow | |
418 | * consortium. */ | |
419 | /* Followed by vendor-defined arbitrary additional data. */ | |
420 | }; | |
982697a4 | 421 | OFP_ASSERT(sizeof(struct ofp10_vendor_stats_msg) == 16); |
53931554 | 422 | |
53931554 | 423 | #endif /* openflow/openflow-1.0.h */ |