8 #ifndef COFAGGRSTATS_H_
9 #define COFAGGRSTATS_H_ 1
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/openflow/cofmatch.h"
13 #include "rofl/common/openflow/cofactions.h"
14 #include "rofl/common/openflow/cofinstructions.h"
15 #include "rofl/common/openflow/openflow.h"
16 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
43 uint8_t of_version = openflow::OFP_VERSION_UNKNOWN,
44 uint8_t *buf = (uint8_t*)0,
67 uint64_t cookie_mask);
95 pack(uint8_t *buf,
size_t buflen);
102 unpack(uint8_t *buf,
size_t buflen);
116 set_version(uint8_t of_version);
130 set_table_id(uint8_t table_id);
137 get_table_id()
const;
144 set_out_port(uint32_t out_port);
151 get_out_port()
const;
158 set_out_group(uint32_t out_group);
165 get_out_group()
const;
173 set_cookie(uint64_t cookie);
187 set_cookie_mask(uint64_t cookie_mask);
194 get_cookie_mask()
const;
207 switch (aggr_stats_request.get_version()) {
208 case rofl::openflow::OFP_VERSION_UNKNOWN: {
209 os <<
indent(0) <<
"<cofaggr_stats_request >" << std::endl;
211 case rofl::openflow10::OFP_VERSION: {
212 os <<
indent(0) <<
"<cofaggr_stats_request >" << std::endl;
213 os <<
indent(2) <<
"<table-id:" << (int)aggr_stats_request.get_table_id() <<
" >" << std::endl;
214 os <<
indent(2) <<
"<out-port:0x" << std::hex << (int)aggr_stats_request.get_out_port() << std::dec <<
" >" << std::endl;
216 os << aggr_stats_request.match;
219 case rofl::openflow12::OFP_VERSION: {
220 os <<
indent(0) <<
"<cofaggr_stats_request >" << std::endl;
221 os <<
indent(2) <<
"<table-id:" << (int)aggr_stats_request.get_table_id() <<
" >" << std::endl;
222 os <<
indent(2) <<
"<out-port:0x" << std::hex << (int)aggr_stats_request.get_out_port() << std::dec <<
" >" << std::endl;
223 os <<
indent(2) <<
"<out-group:0x" << std::hex << (int)aggr_stats_request.get_out_group() << std::dec <<
" >" << std::endl;
224 os <<
indent(2) <<
"<cookie:0x" << std::hex << (
unsigned long long)aggr_stats_request.get_cookie() << std::dec <<
" >" << std::endl;
225 os <<
indent(2) <<
"<cookie-mask:0x" << std::hex << (
unsigned long long)aggr_stats_request.get_cookie_mask() << std::dec <<
" >" << std::endl;
227 os << aggr_stats_request.match;
230 case rofl::openflow13::OFP_VERSION: {
231 os <<
indent(0) <<
"<cofaggr_stats_request >" << std::endl;
232 os <<
indent(2) <<
"<table-id:" << (int)aggr_stats_request.get_table_id() <<
" >" << std::endl;
233 os <<
indent(2) <<
"<out-port:0x" << std::hex << (int)aggr_stats_request.get_out_port() << std::dec <<
" >" << std::endl;
234 os <<
indent(2) <<
"<out-group:0x" << std::hex << (int)aggr_stats_request.get_out_group() << std::dec <<
" >" << std::endl;
235 os <<
indent(2) <<
"<cookie:0x" << std::hex << (
unsigned long long)aggr_stats_request.get_cookie() << std::dec <<
" >" << std::endl;
236 os <<
indent(2) <<
"<cookie-mask:0x" << std::hex << (
unsigned long long)aggr_stats_request.get_cookie_mask() << std::dec <<
" >" << std::endl;
238 os << aggr_stats_request.match;
256 uint64_t packet_count;
268 uint8_t of_version = 0,
269 uint8_t *buf = (uint8_t*)0,
278 uint64_t packet_count,
280 uint32_t flow_count);
308 pack(uint8_t *buf,
size_t buflen);
315 unpack(uint8_t *buf,
size_t buflen);
329 set_version(uint8_t of_version);
343 get_packet_count()
const;
350 get_byte_count()
const;
357 get_flow_count()
const;
364 set_packet_count(uint64_t packet_count);
371 set_byte_count(uint64_t byte_count);
378 set_flow_count(uint32_t flow_count);
384 switch (reply.get_version()) {
385 case rofl::openflow::OFP_VERSION_UNKNOWN: {
386 os <<
indent(0) <<
"<cofaggr_stats_reply >" << std::endl;
388 case rofl::openflow10::OFP_VERSION:
389 case rofl::openflow12::OFP_VERSION:
390 case rofl::openflow13::OFP_VERSION: {
391 os <<
indent(0) <<
"<cofaggr_stats_reply >" << std::endl;
392 os <<
indent(2) <<
"<packet-count:" << (int)reply.get_packet_count() <<
" >" << std::endl;
393 os <<
indent(2) <<
"<byte-count:" << (int)reply.get_byte_count() <<
" >" << std::endl;
394 os <<
indent(2) <<
"<flow-count:" << (int)reply.get_flow_count() <<
" >" << std::endl;
Definition: croflexception.h:73
Definition: cofmatch.h:35
Definition: cofaggrstats.h:251
Definition: cofaggrstats.h:21