8 #ifndef COFMSG_STATS_H_
9 #define COFMSG_STATS_H_ 1
11 #include "rofl/common/openflow/messages/cofmsg.h"
27 uint8_t* ofhu_stats_request;
33 #define ofh_stats_request ofhu.ofhu_stats_request
34 #define ofh10_stats_request ofhu.ofhu10_stats_request
35 #define ofh12_stats_request ofhu.ofhu12_stats_request
36 #define ofh13_multipart_request ofhu.ofhu13_multipart_request
45 uint8_t of_version = 0,
47 uint16_t stats_type = 0,
48 uint16_t stats_flags = 0,
49 uint8_t *data = (uint8_t*)0,
106 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
113 unpack(uint8_t *buf,
size_t buflen);
129 get_stats_type()
const;
135 set_stats_type(uint16_t type);
141 get_stats_flags()
const;
147 set_stats_flags(uint16_t flags);
158 operator<< (std::ostream& os,
cofmsg_stats const& msg) {
160 switch (msg.get_version()) {
161 case openflow10::OFP_VERSION: {
162 if (msg.get_stats_flags() & openflow10::OFPSF_REPLY_MORE)
163 s_flags.append(
"MORE ");
165 case openflow12::OFP_VERSION: {
166 if (msg.get_stats_flags() & openflow12::OFPSF_REPLY_MORE)
167 s_flags.append(
"MORE ");
169 case openflow13::OFP_VERSION: {
170 if (msg.get_stats_flags() & openflow13::OFPMPF_REPLY_MORE)
171 s_flags.append(
"MORE ");
174 s_flags.append(
"unsupported OF version");
177 os << dynamic_cast<cofmsg const&>( msg );
178 os <<
indent(2) <<
"<cofmsg_stats ";
179 os <<
"type:" << (int)msg.get_stats_type() <<
" ";
180 os <<
"flags:" << s_flags <<
" ";
181 os <<
">" << std::endl;;
196 uint8_t of_version = 0,
198 uint16_t stats_type = 0,
199 uint16_t stats_flags = 0,
200 uint8_t *data = (uint8_t*)0,
201 size_t datalen = 0) :
202 cofmsg_stats(of_version, xid, stats_type, stats_flags, data, datalen)
204 switch (of_version) {
205 case openflow::OFP_VERSION_UNKNOWN: {
208 case openflow10::OFP_VERSION: {
209 set_type(openflow10::OFPT_STATS_REQUEST);
211 case openflow12::OFP_VERSION: {
212 set_type(openflow12::OFPT_STATS_REQUEST);
214 case openflow13::OFP_VERSION: {
215 set_type(openflow13::OFPT_MULTIPART_REQUEST);
240 if (
this == &request)
243 cofmsg_stats::operator= (request);
274 uint8_t of_version = 0,
276 uint16_t stats_type = 0,
277 uint16_t stats_flags = 0,
278 uint8_t *data = (uint8_t*)0,
279 size_t datalen = 0) :
280 cofmsg_stats(of_version, xid, stats_type, stats_flags, data, datalen)
282 switch (of_version) {
283 case openflow::OFP_VERSION_UNKNOWN: {
286 case openflow10::OFP_VERSION: {
287 set_type(openflow10::OFPT_STATS_REPLY);
289 case openflow12::OFP_VERSION: {
290 set_type(openflow12::OFPT_STATS_REPLY);
292 case openflow13::OFP_VERSION: {
293 set_type(openflow13::OFPT_MULTIPART_REPLY);
321 cofmsg_stats::operator= (reply);
342 typedef cofmsg_stats_request cofmsg_multipart_request;
343 typedef cofmsg_stats_reply cofmsg_multipart_reply;
cofmsg_stats(uint8_t of_version=0, uint32_t xid=0, uint16_t stats_type=0, uint16_t stats_flags=0, uint8_t *data=(uint8_t *) 0, size_t datalen=0)
Definition: cofmsg_stats.cc:5
virtual ~cofmsg_stats()
Definition: cofmsg_stats.cc:101
Definition: croflexception.h:73
virtual ~cofmsg_stats_request()
Definition: cofmsg_stats.h:253
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_stats.cc:147
cofmsg_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t stats_type=0, uint16_t stats_flags=0, uint8_t *data=(uint8_t *) 0, size_t datalen=0)
Definition: cofmsg_stats.h:195
virtual void reset()
Definition: cofmsg_stats.cc:109
Definition: cofmsg_stats.h:264
virtual void validate()
Definition: cofmsg_stats.cc:214
virtual size_t length() const
Definition: cofmsg_stats.cc:126
Definition: cofmsg_stats.h:187
Definition: cofmsg_stats.h:19
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_stats.cc:184
virtual ~cofmsg_stats_reply()
Definition: cofmsg_stats.h:331
cofmsg_stats_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t stats_type=0, uint16_t stats_flags=0, uint8_t *data=(uint8_t *) 0, size_t datalen=0)
Definition: cofmsg_stats.h:273
Definition: openflow12.h:1292
Definition: openflow13.h:1026
Definition: openflow10.h:759