Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_aggr_stats.h
1 /*
2  * cofmsg_aggr_stats.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_AGGR_STATS_H
9 #define COFMSG_AGGR_STATS_H 1
10 
11 #include "rofl/common/openflow/messages/cofmsg_stats.h"
12 #include "rofl/common/openflow/cofaggrstats.h"
13 
14 namespace rofl {
15 namespace openflow {
16 
22 {
23 private:
24 
25  cofaggr_stats_request aggr_stats;
26 
27  union {
28  uint8_t *ofhu_aggr_stats;
29  struct rofl::openflow10::ofp_aggregate_stats_request *ofhu10_aggr_stats;
30  struct rofl::openflow12::ofp_aggregate_stats_request *ofhu12_aggr_stats;
31  struct rofl::openflow13::ofp_aggregate_stats_request *ofhu13_aggr_stats;
32  } ofhu;
33 
34 #define ofh_aggr_stats ofhu.ofhu_aggr_stats
35 #define ofh10_aggr_stats ofhu.ofhu10_aggr_stats
36 #define ofh12_aggr_stats ofhu.ofhu12_aggr_stats
37 #define ofh13_aggr_stats ofhu.ofhu13_aggr_stats
38 
39 public:
40 
41 
46  uint8_t of_version = 0,
47  uint32_t xid = 0,
48  uint16_t flags = 0,
49  cofaggr_stats_request const& aggr_stats = cofaggr_stats_request());
50 
51 
56  cofmsg_aggr_stats_request const& stats);
57 
58 
63  operator= (
64  cofmsg_aggr_stats_request const& stats);
65 
66 
70  virtual
72 
73 
78 
79 
83  virtual void
84  reset();
85 
86 
90  virtual uint8_t*
91  resize(size_t len);
92 
93 
97  virtual size_t
98  length() const;
99 
100 
104  virtual void
105  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
106 
107 
111  virtual void
112  unpack(uint8_t *buf, size_t buflen);
113 
114 
117  virtual void
118  validate();
119 
120 
121 public:
122 
123 
128  get_aggr_stats();
129 
130 public:
131 
132  friend std::ostream&
133  operator<< (std::ostream& os, cofmsg_aggr_stats_request const& msg) {
134  os << indent(0) << dynamic_cast<cofmsg const&>( msg );
135  os << indent(2) << "<cofmsg_aggr_stats_request >" << std::endl;
136  indent i(4);
137  os << msg.aggr_stats;
138  return os;
139  };
140 };
141 
142 
143 
148  public cofmsg_stats_reply
149 {
150 private:
151 
152  cofaggr_stats_reply aggr_stats;
153 
154  union {
155  uint8_t* ofhu_aggr_stats;
156  struct rofl::openflow10::ofp_aggregate_stats_reply* ofhu10_aggr_stats;
157  struct rofl::openflow12::ofp_aggregate_stats_reply* ofhu12_aggr_stats;
158  struct rofl::openflow13::ofp_aggregate_stats_reply* ofhu13_aggr_stats;
159  } ofhu;
160 
161 #define ofh_aggr_stats ofhu.ofhu_aggr_stats
162 #define ofh10_aggr_stats ofhu.ofhu10_aggr_stats
163 #define ofh12_aggr_stats ofhu.ofhu12_aggr_stats
164 #define ofh13_aggr_stats ofhu.ofhu13_aggr_stats
165 
166 public:
167 
168 
173  uint8_t of_version = 0,
174  uint32_t xid = 0,
175  uint16_t flags = 0,
176  cofaggr_stats_reply const& aggr_stats = cofaggr_stats_reply());
177 
178 
183  cofmsg_aggr_stats_reply const& stats);
184 
185 
190  operator= (
191  cofmsg_aggr_stats_reply const& stats);
192 
193 
197  virtual
199 
200 
205 
206 
210  virtual void
211  reset();
212 
213 
217  virtual uint8_t*
218  resize(size_t len);
219 
220 
224  virtual size_t
225  length() const;
226 
227 
231  virtual void
232  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
233 
234 
238  virtual void
239  unpack(uint8_t *buf, size_t buflen);
240 
241 
244  virtual void
245  validate();
246 
247 
248 public:
249 
254  set_aggr_stats();
255 
259  cofaggr_stats_reply const&
260  get_aggr_stats() const;
261 
262 public:
263 
264  friend std::ostream&
265  operator<< (std::ostream& os, cofmsg_aggr_stats_reply const& msg) {
266  os << indent(0) << dynamic_cast<cofmsg const&>( msg );
267  os << indent(2) << "<cofmsg_aggr_stats_reply >" << std::endl;
268  indent i(4);
269  os << msg.aggr_stats;
270  return os;
271  };
272 };
273 
274 } // end of namespace openflow
275 } // end of namespace rofl
276 
277 #endif /* COFMSG_AGGR_STATS_H_ */
cofmsg_aggr_stats_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, cofaggr_stats_reply const &aggr_stats=cofaggr_stats_reply())
Definition: cofmsg_aggr_stats.cc:229
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_aggr_stats.cc:174
Definition: openflow12.h:1391
virtual size_t length() const
Definition: cofmsg_aggr_stats.cc:123
Definition: openflow13.h:1237
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_aggr_stats.cc:368
virtual void reset()
Definition: cofmsg_aggr_stats.cc:317
virtual void validate()
Definition: cofmsg_aggr_stats.cc:408
Definition: cofmsg_stats.h:264
virtual void reset()
Definition: cofmsg_aggr_stats.cc:93
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_aggr_stats.cc:398
Definition: cofmsg_stats.h:187
Definition: cofmsg_aggr_stats.h:147
cofmsg_aggr_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, cofaggr_stats_request const &aggr_stats=cofaggr_stats_request())
Definition: cofmsg_aggr_stats.cc:6
virtual size_t length() const
Definition: cofmsg_aggr_stats.cc:347
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: cofmsg_aggr_stats.h:20
virtual void validate()
Definition: cofmsg_aggr_stats.cc:184
Definition: logging.h:76
virtual ~cofmsg_aggr_stats_request()
Definition: cofmsg_aggr_stats.cc:85
Definition: cofaggrstats.h:251
virtual ~cofmsg_aggr_stats_reply()
Definition: cofmsg_aggr_stats.cc:309
Definition: cofaggrstats.h:21
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_aggr_stats.cc:144