Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_meter_stats.h
1 /*
2  * cofmsg_meter_stats.h
3  *
4  * Created on: 27.05.2014
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_METER_STATS_H_
9 #define COFMSG_METER_STATS_H_ 1
10 
11 #include <inttypes.h>
12 #include <map>
13 
14 #include "rofl/common/openflow/messages/cofmsg_stats.h"
15 #include "rofl/common/openflow/cofmeterstatsarray.h"
16 
17 namespace rofl {
18 namespace openflow {
19 
25 {
26 public:
27 
28 
33  uint8_t of_version,
34  uint32_t xid,
35  uint16_t stats_flags,
36  uint32_t meter_id);
37 
38 
43  uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN,
44  uint32_t xid = 0,
45  uint16_t stats_flags = 0,
47 
48 
53  const cofmsg_meter_stats_request& msg);
54 
55 
60  operator= (
61  const cofmsg_meter_stats_request& msg);
62 
63 
67  virtual
69 
70 
75  rofl::cmemory *memarea);
76 
77 public:
78 
82  virtual size_t
83  length() const;
84 
85 
89  virtual void
90  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
91 
92 
96  virtual void
97  unpack(uint8_t *buf, size_t buflen);
98 
99 
102  virtual void
103  validate();
104 
105 
106 public:
107 
112  set_meter_stats() { return mstats; };
113 
118  get_meter_stats() const { return mstats; };
119 
120 
121 public:
122 
123  friend std::ostream&
124  operator<< (std::ostream& os, cofmsg_meter_stats_request const& msg) {
125  os << dynamic_cast<cofmsg_stats_request const&>( msg );
126  os << indent(2) << "<cofmsg_meter_request >" << std::endl;
127  rofl::indent i(4); os << msg.get_meter_stats();
128  return os;
129  };
130 
131 private:
132 
134 };
135 
136 
137 
138 
139 
140 
141 
142 
147  public cofmsg_stats_reply
148 {
149 public:
150 
151 
156  uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN,
157  uint32_t xid = 0,
158  uint16_t stats_flags = 0,
160 
161 
166  const cofmsg_meter_stats_reply& msg);
167 
168 
173  operator= (
174  const cofmsg_meter_stats_reply& msg);
175 
176 
180  virtual
182 
183 
188 
189 
193  virtual void
194  reset();
195 
196 
200  virtual uint8_t*
201  resize(size_t len);
202 
203 
207  virtual size_t
208  length() const;
209 
210 
214  virtual void
215  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
216 
217 
221  virtual void
222  unpack(uint8_t *buf, size_t buflen);
223 
224 
227  virtual void
228  validate();
229 
230 public:
231 
236  get_meter_stats_array() const { return array; };
237 
242  set_meter_stats_array() { return array; };
243 
244 
245 public:
246 
247  friend std::ostream&
248  operator<< (std::ostream& os, cofmsg_meter_stats_reply const& msg) {
249  os << dynamic_cast<cofmsg_stats_reply const&>( msg );
250  os << indent(2) << "<cofmsg_meter_stats_reply >" << std::endl;
251  indent i(4); os << msg.get_meter_stats_array();
252  return os;
253  };
254 
255 private:
256 
258 };
259 
260 } // end of namespace openflow
261 } // end of namespace rofl
262 
263 #endif /* COFMSG_METER_STATS_H_ */
virtual size_t length() const
Definition: cofmsg_meter_stats.cc:95
Definition: cofmsg_meter_stats.h:146
Definition: cofmsg_stats.h:264
Definition: cofmsg_stats.h:187
virtual ~cofmsg_meter_stats_request()
Definition: cofmsg_meter_stats.cc:87
virtual size_t length() const
Definition: cofmsg_meter_stats.cc:260
cofmsg_meter_stats_request(uint8_t of_version, uint32_t xid, uint16_t stats_flags, uint32_t meter_id)
Definition: cofmsg_meter_stats.cc:5
virtual void reset()
Definition: cofmsg_meter_stats.cc:242
Definition: cofmeterstatsarray.h:19
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_meter_stats.cc:304
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
cofmsg_meter_stats_reply(uint8_t of_version=rofl::openflow::OFP_VERSION_UNKNOWN, uint32_t xid=0, uint16_t stats_flags=0, const rofl::openflow::cofmeterstatsarray &array=rofl::openflow::cofmeterstatsarray())
Definition: cofmsg_meter_stats.cc:177
virtual ~cofmsg_meter_stats_reply()
Definition: cofmsg_meter_stats.cc:234
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_meter_stats.cc:274
Definition: logging.h:76
virtual void validate()
Definition: cofmsg_meter_stats.cc:149
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_meter_stats.cc:109
Definition: cofmsg_meter_stats.h:23
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_meter_stats.cc:139
virtual void validate()
Definition: cofmsg_meter_stats.cc:314
Definition: cofmeterstats.h:23