15 #include "rofl/common/cclock.h"
16 #include "rofl/common/logging.h"
17 #include "rofl/common/croflexception.h"
18 #include "rofl/common/openflow/messages/cofmsg_stats.h"
19 #include "rofl/common/openflow/messages/cofmsg_desc_stats.h"
20 #include "rofl/common/openflow/messages/cofmsg_flow_stats.h"
21 #include "rofl/common/openflow/messages/cofmsg_aggr_stats.h"
22 #include "rofl/common/openflow/messages/cofmsg_table_stats.h"
23 #include "rofl/common/openflow/messages/cofmsg_port_stats.h"
24 #include "rofl/common/openflow/messages/cofmsg_queue_stats.h"
25 #include "rofl/common/openflow/messages/cofmsg_group_stats.h"
26 #include "rofl/common/openflow/messages/cofmsg_group_desc_stats.h"
27 #include "rofl/common/openflow/messages/cofmsg_group_features_stats.h"
28 #include "rofl/common/openflow/messages/cofmsg_meter_stats.h"
29 #include "rofl/common/openflow/messages/cofmsg_meter_config_stats.h"
30 #include "rofl/common/openflow/messages/cofmsg_meter_features_stats.h"
31 #include "rofl/common/openflow/messages/cofmsg_table_features_stats.h"
32 #include "rofl/common/openflow/messages/cofmsg_port_desc_stats.h"
46 static time_t
const DEFAULT_EXPIRATION_DELTA_SEC = 8;
47 static time_t
const DEFAULT_EXPIRATION_DELTA_NSEC = 0;
76 operator= (
csegmsg const& segmsg);
91 time_t delta_sec = 0, time_t delta_nsec = 0);
97 get_xid()
const {
return xid; };
135 operator<< (std::ostream& os,
csegmsg const& msg) {
136 os <<
rofl::indent(0) <<
"<csegmsg" <<
" >" << std::endl;
139 os <<
rofl::indent(2) <<
"<xid: 0x" << std::hex << (int)msg.xid << std::dec <<
" >" << std::endl;
141 switch (msg.msg->get_version()) {
142 case rofl::openflow13::OFP_VERSION: {
144 switch (msg.msg->get_type()) {
145 case rofl::openflow13::OFPT_MULTIPART_REQUEST: {
147 switch (msg.msg->get_stats_type()) {
148 case rofl::openflow13::OFPMP_DESC: {
149 os << dynamic_cast<rofl::openflow::cofmsg_desc_stats_request const&>( *(msg.msg) );
151 case rofl::openflow13::OFPMP_FLOW: {
152 os << dynamic_cast<rofl::openflow::cofmsg_flow_stats_request const&>( *(msg.msg) );
154 case rofl::openflow13::OFPMP_AGGREGATE: {
155 os << dynamic_cast<rofl::openflow::cofmsg_aggr_stats_request const&>( *(msg.msg) );
157 case rofl::openflow13::OFPMP_TABLE: {
158 os << dynamic_cast<rofl::openflow::cofmsg_table_stats_request const&>( *(msg.msg) );
160 case rofl::openflow13::OFPMP_PORT_STATS: {
161 os << dynamic_cast<rofl::openflow::cofmsg_port_stats_request const&>( *(msg.msg) );
163 case rofl::openflow13::OFPMP_QUEUE: {
164 os << dynamic_cast<rofl::openflow::cofmsg_queue_stats_request const&>( *(msg.msg) );
166 case rofl::openflow13::OFPMP_GROUP: {
167 os << dynamic_cast<rofl::openflow::cofmsg_group_stats_request const&>( *(msg.msg) );
169 case rofl::openflow13::OFPMP_GROUP_DESC: {
170 os << dynamic_cast<rofl::openflow::cofmsg_group_desc_stats_request const&>( *(msg.msg) );
172 case rofl::openflow13::OFPMP_GROUP_FEATURES: {
173 os << dynamic_cast<rofl::openflow::cofmsg_group_features_stats_request const&>( *(msg.msg) );
176 case rofl::openflow13::OFPMP_TABLE_FEATURES: {
177 os << dynamic_cast<rofl::openflow::cofmsg_table_features_stats_request const&>( *(msg.msg) );
179 case rofl::openflow13::OFPMP_PORT_DESC: {
180 os << dynamic_cast<rofl::openflow::cofmsg_port_desc_stats_request const&>( *(msg.msg) );
188 case rofl::openflow13::OFPT_MULTIPART_REPLY: {
190 switch (msg.msg->get_stats_type()) {
191 case rofl::openflow13::OFPMP_DESC: {
192 os << dynamic_cast<rofl::openflow::cofmsg_desc_stats_reply const&>( *(msg.msg) );
194 case rofl::openflow13::OFPMP_FLOW: {
195 os << dynamic_cast<rofl::openflow::cofmsg_flow_stats_reply const&>( *(msg.msg) );
197 case rofl::openflow13::OFPMP_AGGREGATE: {
198 os << dynamic_cast<rofl::openflow::cofmsg_aggr_stats_reply const&>( *(msg.msg) );
200 case rofl::openflow13::OFPMP_TABLE: {
201 os << dynamic_cast<rofl::openflow::cofmsg_table_stats_reply const&>( *(msg.msg) );
203 case rofl::openflow13::OFPMP_PORT_STATS: {
204 os << dynamic_cast<rofl::openflow::cofmsg_port_stats_reply const&>( *(msg.msg) );
206 case rofl::openflow13::OFPMP_QUEUE: {
207 os << dynamic_cast<rofl::openflow::cofmsg_queue_stats_reply const&>( *(msg.msg) );
209 case rofl::openflow13::OFPMP_GROUP: {
210 os << dynamic_cast<rofl::openflow::cofmsg_group_stats_reply const&>( *(msg.msg) );
212 case rofl::openflow13::OFPMP_GROUP_DESC: {
213 os << dynamic_cast<rofl::openflow::cofmsg_group_desc_stats_reply const&>( *(msg.msg) );
215 case rofl::openflow13::OFPMP_GROUP_FEATURES: {
216 os << dynamic_cast<rofl::openflow::cofmsg_group_features_stats_reply const&>( *(msg.msg) );
219 case rofl::openflow13::OFPMP_TABLE_FEATURES: {
220 os << dynamic_cast<rofl::openflow::cofmsg_table_features_stats_reply const&>( *(msg.msg) );
222 case rofl::openflow13::OFPMP_PORT_DESC: {
223 os << dynamic_cast<rofl::openflow::cofmsg_port_desc_stats_reply const&>( *(msg.msg) );
Definition: croflexception.h:65
Definition: cofmsg_stats.h:19
Definition: croflexception.h:27
rofl::openflow::cofmsg_stats * retrieve_and_detach_msg()
Returns pointer to this->msg and sets this->msg to NULL. The object resides on heap and must be destr...
Definition: csegmsg.cc:373
void store_and_merge_msg(rofl::openflow::cofmsg_stats const &msg)
Merges payload from msg within this->msg. Checks stats sub-type first.
Definition: csegmsg.cc:206