Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_queue_stats.h
1 /*
2  * cofmsg_queue_stats.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_QUEUE_STATS_H_
9 #define COFMSG_QUEUE_STATS_H_ 1
10 
11 #include <vector>
12 
13 #include "rofl/common/openflow/messages/cofmsg_stats.h"
14 #include "rofl/common/openflow/cofqueuestatsarray.h"
15 #include "rofl/common/openflow/cofqueuestats.h"
16 
17 namespace rofl {
18 namespace openflow {
19 
25 {
26 private:
27 
29 
30 public:
31 
32 
37  uint8_t of_version = 0,
38  uint32_t xid = 0,
39  uint16_t flags = 0,
41 
42 
47  cofmsg_queue_stats_request const& stats);
48 
49 
54  operator= (
55  cofmsg_queue_stats_request const& stats);
56 
57 
61  virtual
63 
64 
69 
70 
74  virtual void
75  reset();
76 
77 
81  virtual uint8_t*
82  resize(size_t len);
83 
84 
88  virtual size_t
89  length() const;
90 
91 
95  virtual void
96  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
97 
98 
102  virtual void
103  unpack(uint8_t *buf, size_t buflen);
104 
105 
108  virtual void
109  validate();
110 
111 
112 public:
113 
118  set_queue_stats();
119 
124  get_queue_stats() const;
125 
126 public:
127 
128  friend std::ostream&
129  operator<< (std::ostream& os, cofmsg_queue_stats_request const& msg) {
130  os << dynamic_cast<cofmsg const&>( msg );
131  os << indent(2) << "<cofmsg_queue_stats_request >" << std::endl;
132  indent i(4);
133  os << msg.queue_stats;
134  return os;
135  };
136 };
137 
138 
139 
140 
145  public cofmsg_stats_reply
146 {
147 private:
148 
149  rofl::openflow::cofqueuestatsarray queuestatsarray;
150 
151  union {
152  uint8_t* ofhu_queue_stats;
153  struct rofl::openflow10::ofp_queue_stats* ofhu10_queue_stats;
154  struct rofl::openflow12::ofp_queue_stats* ofhu12_queue_stats;
155  struct rofl::openflow13::ofp_queue_stats* ofhu13_queue_stats;
156  } ofh_ofhu;
157 
158 #define ofh_queue_stats ofh_ofhu.ofhu_queue_stats
159 #define ofh10_queue_stats ofh_ofhu.ofhu10_queue_stats
160 #define ofh12_queue_stats ofh_ofhu.ofhu12_queue_stats
161 #define ofh13_queue_stats ofh_ofhu.ofhu13_queue_stats
162 
163 public:
164 
165 
170  uint8_t of_version = 0,
171  uint32_t xid = 0,
172  uint16_t flags = 0,
174 
175 
180  cofmsg_queue_stats_reply const& stats);
181 
182 
187  operator= (
188  cofmsg_queue_stats_reply const& stats);
189 
190 
194  virtual
196 
197 
202 
203 
207  virtual void
208  reset();
209 
210 
214  virtual uint8_t*
215  resize(size_t len);
216 
217 
221  virtual size_t
222  length() const;
223 
224 
228  virtual void
229  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
230 
231 
235  virtual void
236  unpack(uint8_t *buf, size_t buflen);
237 
238 
241  virtual void
242  validate();
243 
244 
245 public:
246 
251  set_queue_stats_array() { return queuestatsarray; };
252 
257  get_queue_stats_array() const { return queuestatsarray; };
258 
259 public:
260 
261  friend std::ostream&
262  operator<< (std::ostream& os, cofmsg_queue_stats_reply const& msg) {
263  os << dynamic_cast<cofmsg const&>( msg );
264  os << indent(2) << "<cofmsg_queue_stats_reply >" << std::endl;
265  indent i(4);
266  os << msg.queuestatsarray;
267  return os;
268  };
269 };
270 
271 } // end of namespace openflow
272 } // end of namespace rofl
273 
274 #endif /* COFMSG_QUEUE_STATS_H_ */
virtual ~cofmsg_queue_stats_reply()
Definition: cofmsg_queue_stats.cc:291
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_queue_stats.cc:116
Definition: cofmsg_stats.h:264
cofmsg_queue_stats_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, rofl::openflow::cofqueuestatsarray const &queue_stats=rofl::openflow::cofqueuestatsarray())
Definition: cofmsg_queue_stats.cc:208
cofmsg_queue_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, rofl::openflow::cofqueue_stats_request const &queue_stats_request=rofl::openflow::cofqueue_stats_request())
Definition: cofmsg_queue_stats.cc:5
virtual void validate()
Definition: cofmsg_queue_stats.cc:394
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_queue_stats.cc:384
virtual void reset()
Definition: cofmsg_queue_stats.cc:79
Definition: cofmsg_stats.h:187
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_queue_stats.cc:350
Definition: cofmsg_queue_stats.h:144
virtual size_t length() const
Definition: cofmsg_queue_stats.cc:95
Definition: cofqueuestatsarray.h:19
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual ~cofmsg_queue_stats_request()
Definition: cofmsg_queue_stats.cc:71
Definition: cofmsg_queue_stats.h:23
virtual void reset()
Definition: cofmsg_queue_stats.cc:299
virtual void validate()
Definition: cofmsg_queue_stats.cc:160
Definition: logging.h:76
Definition: openflow12.h:1655
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_queue_stats.cc:150
Definition: openflow13.h:1435
virtual size_t length() const
Definition: cofmsg_queue_stats.cc:329
Definition: openflow10.h:992
Definition: cofqueuestats.h:22