8 #ifndef COFPORTSTATS_H_
9 #define COFPORTSTATS_H_ 1
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/openflow/cofactions.h"
13 #include "rofl/common/openflow/cofinstructions.h"
14 #include "rofl/common/openflow/openflow.h"
15 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
39 uint8_t of_version = 0,
40 uint8_t *buf = (uint8_t*)0,
76 pack(uint8_t *buf,
size_t buflen)
const;
83 unpack(uint8_t *buf,
size_t buflen);
97 set_version(uint8_t of_version);
117 os <<
indent(0) <<
"<cofport_stats_request >" << std::endl;
118 os <<
indent(2) <<
"<port-no: 0x" << std::hex << (int)r.get_portno() << std::dec <<
" >" << std::endl;
139 uint64_t rx_frame_err;
140 uint64_t rx_over_err;
143 uint32_t duration_sec;
144 uint32_t duration_nsec;
155 uint8_t of_version = 0,
156 uint8_t *buf = (uint8_t*)0,
174 uint64_t rx_frame_err,
175 uint64_t rx_over_err,
178 uint32_t durarion_sec,
179 uint32_t duration_nsec);
214 pack(uint8_t *buf,
size_t buflen)
const;
221 unpack(uint8_t *buf,
size_t buflen);
242 set_version(uint8_t of_version);
262 get_rx_packets()
const;
268 get_tx_packets()
const;
274 get_rx_bytes()
const;
280 get_tx_bytes()
const;
286 get_rx_dropped()
const;
292 get_tx_dropped()
const;
298 get_rx_errors()
const;
304 get_tx_errors()
const;
310 get_rx_frame_err()
const;
316 get_rx_over_err()
const;
322 get_rx_crc_err()
const;
328 get_collisions()
const;
334 get_duration_sec()
const;
340 get_duration_nsec()
const;
346 set_port_no(uint32_t port_no);
352 set_rx_packets(uint64_t rx_packets);
358 set_tx_packets(uint64_t tx_packets);
364 set_rx_bytes(uint64_t rx_bytes);
370 set_tx_bytes(uint64_t tx_bytes);
376 set_rx_dropped(uint64_t rx_dropped);
382 set_tx_dropped(uint64_t tx_dropped);
388 set_rx_errors(uint64_t rx_errors);
394 set_tx_errors(uint64_t tx_errors);
400 set_rx_frame_err(uint64_t rx_frame_err);
406 set_rx_over_err(uint64_t rx_over_err);
412 set_rx_crc_err(uint64_t rx_crc_err);
418 set_collisions(uint64_t collisions);
424 set_duration_sec(uint32_t duration_sec);
430 set_duration_nsec(uint32_t duration_nsec);
436 os <<
indent(0) <<
"<cofport_stats_reply >" << std::endl;
438 os <<
indent(2) <<
"<port-no: 0x" << (int)r.get_port_no() <<
" >" << std::endl;
439 os <<
indent(2) <<
"<rx-packets: 0x" << (
unsigned long long)r.get_rx_packets() <<
" >" << std::endl;
440 os <<
indent(2) <<
"<tx-packets: 0x" << (
unsigned long long)r.get_tx_packets() <<
" >" << std::endl;
441 os <<
indent(2) <<
"<rx-bytes: 0x" << (
unsigned long long)r.get_rx_bytes() <<
" >" << std::endl;
442 os <<
indent(2) <<
"<tx-bytes: 0x" << (
unsigned long long)r.get_tx_bytes() <<
" >" << std::endl;
443 os <<
indent(2) <<
"<rx-dropped: 0x" << (
unsigned long long)r.get_rx_dropped() <<
" >" << std::endl;
444 os <<
indent(2) <<
"<tx-dropped: 0x" << (
unsigned long long)r.get_tx_dropped() <<
" >" << std::endl;
445 os <<
indent(2) <<
"<rx-errors: 0x" << (
unsigned long long)r.get_rx_errors() <<
" >" << std::endl;
446 os <<
indent(2) <<
"<tx-errors: 0x" << (
unsigned long long)r.get_tx_errors() <<
" >" << std::endl;
447 os <<
indent(2) <<
"<rx-frame-err: 0x" << (
unsigned long long)r.get_rx_frame_err() <<
" >" << std::endl;
448 os <<
indent(2) <<
"<rx-over-err: 0x" << (
unsigned long long)r.get_rx_over_err() <<
" >" << std::endl;
449 os <<
indent(2) <<
"<rx-crc-err: 0x" << (
unsigned long long)r.get_rx_crc_err() <<
" >" << std::endl;
450 os <<
indent(2) <<
"<collisions: 0x" << (
unsigned long long)r.get_collisions() <<
" >" << std::endl;
452 switch (r.get_version()) {
453 case rofl::openflow13::OFP_VERSION: {
454 os <<
indent(2) <<
"<duration-sec: " << (
unsigned long long)r.get_duration_sec() <<
" >" << std::endl;
455 os <<
indent(2) <<
"<duration-nsec: " << (
unsigned long long)r.get_duration_nsec() <<
" >" << std::endl;
Definition: cofportstats.h:22
Definition: cofportstats.h:21
Definition: cofportstats.h:24
Definition: cofportstats.h:125
Definition: cofportstats.h:20
Definition: croflexception.h:27