Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_group_stats.h
1 /*
2  * cofmsg_group_stats.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_GROUP_STATS_H_
9 #define COFMSG_GROUP_STATS_H_ 1
10 
11 #include "rofl/common/openflow/messages/cofmsg_stats.h"
12 #include "rofl/common/openflow/cofgroupstatsarray.h"
13 #include "rofl/common/openflow/cofgroupstats.h"
14 
15 namespace rofl {
16 namespace openflow {
17 
23 {
24 private:
25 
27 
28  union {
29  uint8_t* ofhu_group_stats;
30  struct rofl::openflow12::ofp_group_stats_request* ofhu12_group_stats;
31  struct rofl::openflow13::ofp_group_stats_request* ofhu13_group_stats;
32  } ofhu;
33 
34 #define ofh_group_stats ofhu.ofhu_group_stats
35 #define ofh12_group_stats ofhu.ofhu12_group_stats
36 #define ofh13_group_stats ofhu.ofhu13_group_stats
37 
38 public:
39 
40 
45  uint8_t of_version = 0,
46  uint32_t xid = 0,
47  uint16_t flags = 0,
49 
50 
55  cofmsg_group_stats_request const& stats);
56 
57 
62  operator= (
63  cofmsg_group_stats_request const& stats);
64 
65 
69  virtual
71 
72 
77 
78 
82  virtual void
83  reset();
84 
85 
89  virtual uint8_t*
90  resize(size_t len);
91 
92 
96  virtual size_t
97  length() const;
98 
99 
103  virtual void
104  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
105 
106 
110  virtual void
111  unpack(uint8_t *buf, size_t buflen);
112 
113 
116  virtual void
117  validate();
118 
119 
120 public:
121 
126  set_group_stats();
127 
132  get_group_stats() const;
133 
134 public:
135 
136  friend std::ostream&
137  operator<< (std::ostream& os, cofmsg_group_stats_request const& msg) {
138  os << dynamic_cast<cofmsg const&>( msg );
139  os << indent(2) << "<cofmsg_group_stats_request >" << std::endl;
140  indent i(4);
141  os << msg.group_stats;
142  return os;
143  };
144 };
145 
146 
147 
148 
153  public cofmsg_stats_reply
154 {
155 private:
156 
157  rofl::openflow::cofgroupstatsarray groupstatsarray;
158 
159  union {
160  uint8_t* ofhu_group_stats;
161  struct rofl::openflow12::ofp_group_stats* ofhu12_group_stats;
162  struct rofl::openflow13::ofp_group_stats* ofhu13_group_stats;
163  } ofhu;
164 
165 #define ofh_group_stats ofhu.ofhu_group_stats
166 #define ofh12_group_stats ofhu.ofhu12_group_stats
167 #define ofh13_group_stats ofhu.ofhu13_group_stats
168 
169 public:
170 
171 
176  uint8_t of_version = 0,
177  uint32_t xid = 0,
178  uint16_t flags = 0,
180 
181 
186  cofmsg_group_stats_reply const& stats);
187 
188 
193  operator= (
194  cofmsg_group_stats_reply const& stats);
195 
196 
200  virtual
202 
203 
208 
209 
213  virtual void
214  reset();
215 
216 
220  virtual uint8_t*
221  resize(size_t len);
222 
223 
227  virtual size_t
228  length() const;
229 
230 
234  virtual void
235  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
236 
237 
241  virtual void
242  unpack(uint8_t *buf, size_t buflen);
243 
244 
247  virtual void
248  validate();
249 
250 
251 public:
252 
257  set_group_stats_array() { return groupstatsarray; };
258 
263  get_group_stats_array() const { return groupstatsarray; };
264 
265 public:
266 
267  friend std::ostream&
268  operator<< (std::ostream& os, cofmsg_group_stats_reply const& msg) {
269  os << dynamic_cast<cofmsg const&>( msg );
270  os << indent(2) << "<cofmsg_group_stats_reply >" << std::endl;
271  indent i(4);
272  os << msg.groupstatsarray;
273  return os;
274  };
275 };
276 
277 } // end of namespace openflow
278 } // end of namespace rofl
279 
280 #endif /* COFMSG_GROUP_STATS_H_ */
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_group_stats.cc:344
cofmsg_group_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, rofl::openflow::cofgroup_stats_request const &group_stats=rofl::openflow::cofgroup_stats_request())
Definition: cofmsg_group_stats.cc:5
virtual void validate()
Definition: cofmsg_group_stats.cc:383
Definition: openflow12.h:1491
Definition: cofmsg_stats.h:264
virtual ~cofmsg_group_stats_reply()
Definition: cofmsg_group_stats.cc:291
Definition: openflow13.h:1452
Definition: cofmsg_stats.h:187
Definition: openflow12.h:1505
Definition: cofmsg_group_stats.h:152
Definition: openflow13.h:1466
virtual ~cofmsg_group_stats_request()
Definition: cofmsg_group_stats.cc:78
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_group_stats.cc:131
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_group_stats.cc:161
Definition: cofgroupstatsarray.h:19
Definition: cofgroupstats.h:23
virtual void validate()
Definition: cofmsg_group_stats.cc:171
virtual size_t length() const
Definition: cofmsg_group_stats.cc:326
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual size_t length() const
Definition: cofmsg_group_stats.cc:113
cofmsg_group_stats_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, rofl::openflow::cofgroupstatsarray const &groups=rofl::openflow::cofgroupstatsarray())
Definition: cofmsg_group_stats.cc:215
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_group_stats.cc:373
Definition: logging.h:76
Definition: cofmsg_group_stats.h:21
virtual void reset()
Definition: cofmsg_group_stats.cc:86
virtual void reset()
Definition: cofmsg_group_stats.cc:299