Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmeterbandstats.h
1 /*
2  * cofmeterbandstats.h
3  *
4  * Created on: 25.05.2014
5  * Author: andreas
6  */
7 
8 #ifndef COFMETERBANDSTATS_H_
9 #define COFMETERBANDSTATS_H_
10 
11 #include <inttypes.h>
12 #include <iostream>
13 
14 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
15 #include "rofl/common/openflow/openflow.h"
16 #include "rofl/common/logging.h"
17 
18 namespace rofl {
19 namespace openflow {
20 
23 
25 public:
26 
31  uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN);
32 
33 
38 
39 
44  const cofmeter_band_stats& mbs);
45 
46 
50  const cofmeter_band_stats&
51  operator= (
52  const cofmeter_band_stats& mbs);
53 
57  const bool
58  operator== (
59  const cofmeter_band_stats& mbs) const;
60 
61 public:
62 
66  size_t
67  length() const;
68 
72  void
73  pack(uint8_t *buf, size_t buflen);
74 
78  void
79  unpack(uint8_t *buf, size_t buflen);
80 
81 
82 public:
83 
87  void
88  set_version(uint8_t of_version) { this->of_version = of_version; };
89 
93  uint8_t
94  get_version() const { return of_version; };
95 
99  void
100  set_packet_band_count(uint64_t packet_band_count) {
101  this->packet_band_count = packet_band_count;
102  };
103 
107  uint64_t
108  get_packet_band_count() const { return packet_band_count; };
109 
113  void
114  set_byte_band_count(uint64_t byte_band_count) {
115  this->byte_band_count = byte_band_count;
116  };
117 
121  uint64_t
122  get_byte_band_count() const { return byte_band_count; };
123 
124 public:
125 
126  friend std::ostream&
127  operator<< (std::ostream& os, const cofmeter_band_stats& mbs) {
128  os << rofl::indent(0) << "<cofmeter_band_stats "
129  << std::hex
130  << "packet_band_count: 0x" << mbs.get_packet_band_count() << " "
131  << "byte_band_count: 0x" << mbs.get_byte_band_count() << " "
132  << ">"
133  << std::dec << std::endl;
134  return os;
135  };
136 
137 private:
138 
139  uint8_t of_version;
140  uint64_t packet_band_count;
141  uint64_t byte_band_count;
142 };
143 
144 }; // end of namespace openflow
145 }; // end of namespace rofl
146 
147 #endif /* COFMETERBANDSTATS_H_ */
Definition: cofmeterbandstats.h:21
Definition: cofmeterbandstats.h:22
Definition: cofmeterbandstats.h:24
Definition: logging.h:76
Definition: croflexception.h:27