Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_queue_get_config.h
1 /*
2  * cofmsg_queue_get_config.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_QUEUE_GET_CONFIG_H_
9 #define COFMSG_QUEUE_GET_CONFIG_H_ 1
10 
11 #include <ostream>
12 
13 #include "rofl/common/openflow/messages/cofmsg.h"
14 #include "rofl/common/openflow/cofpacketqueues.h"
15 
16 namespace rofl {
17 namespace openflow {
18 
23  public cofmsg
24 {
25 private:
26 
27  union {
28  uint8_t* ofhu_queue_get_config_request;
29  struct openflow10::ofp_queue_get_config_request* ofhu10_queue_get_config_request;
30  struct openflow12::ofp_queue_get_config_request* ofhu12_queue_get_config_request;
31  struct openflow13::ofp_queue_get_config_request* ofhu13_queue_get_config_request;
32  } ofhu;
33 
34 #define ofh_queue_get_config_request ofhu.ofhu_queue_get_config_request
35 #define ofh10_queue_get_config_request ofhu.ofhu10_queue_get_config_request
36 #define ofh12_queue_get_config_request ofhu.ofhu12_queue_get_config_request
37 #define ofh13_queue_get_config_request ofhu.ofhu13_queue_get_config_request
38 
39 public:
40 
41 
46  uint8_t of_version = 0,
47  uint32_t xid = 0,
48  uint32_t port_no = 0);
49 
50 
55  cofmsg_queue_get_config_request const& queue_get_config);
56 
57 
62  operator= (
63  cofmsg_queue_get_config_request const& queue_get_config);
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 
122 
126  uint32_t
127  get_port_no() const;
128 
132  void
133  set_port_no(uint32_t port_no);
134 
135 public:
136 
137  friend std::ostream&
138  operator<< (std::ostream& os, cofmsg_queue_get_config_request const& msg) {
139  os << dynamic_cast<cofmsg const&>( msg );
140  os << indent(0) << "<cofmsg_queue_get_config_request >" << std::endl;
141  os << indent(2) << "<port-no:0x" << std::hex << (int)msg.get_port_no() << std::dec << " >" << std::endl;
142  return os;
143  };
144 };
145 
146 
147 
148 
153  public cofmsg
154 {
155 private:
156 
157  cofpacket_queues pql;
158 
159  union {
160  uint8_t* ofhu_queue_get_config_reply;
161  struct openflow10::ofp_queue_get_config_reply* ofhu10_queue_get_config_reply;
162  struct openflow12::ofp_queue_get_config_reply* ofhu12_queue_get_config_reply;
163  struct openflow13::ofp_queue_get_config_reply* ofhu13_queue_get_config_reply;
164  } ofhu;
165 
166 #define ofh_queue_get_config_reply ofhu.ofhu_queue_get_config_reply
167 #define ofh10_queue_get_config_reply ofhu.ofhu10_queue_get_config_reply
168 #define ofh12_queue_get_config_reply ofhu.ofhu12_queue_get_config_reply
169 #define ofh13_queue_get_config_reply ofhu.ofhu13_queue_get_config_reply
170 
171 public:
172 
173 
178  uint8_t of_version = 0,
179  uint32_t xid = 0,
180  uint32_t port_no = 0,
181  cofpacket_queues const &pql = cofpacket_queues(openflow12::OFP_VERSION));
182 #if 0
183  uint8_t *data = (uint8_t*)0,
184  size_t datalen = 0);
185 #endif
186 
191  cofmsg_queue_get_config_reply const& queue_get_config);
192 
193 
198  operator= (
199  cofmsg_queue_get_config_reply const& queue_get_config);
200 
201 
205  virtual
207 
208 
213 
214 
218  virtual void
219  reset();
220 
221 
225  virtual uint8_t*
226  resize(size_t len);
227 
228 
232  virtual size_t
233  length() const;
234 
235 
239  virtual void
240  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
241 
242 
246  virtual void
247  unpack(uint8_t *buf, size_t buflen);
248 
249 
252  virtual void
253  validate();
254 
255 
256 public:
257 
258 
262  uint32_t
263  get_port_no() const;
264 
268  void
269  set_port_no(uint32_t port_no);
270 
275  get_queues();
276 
277 public:
278 
279  friend std::ostream&
280  operator<< (std::ostream& os, cofmsg_queue_get_config_reply const& msg) {
281  os << dynamic_cast<cofmsg const&>( msg );
282  os << indent(0) << "<cofmsg_queue_get_config_request >" << std::endl;
283  os << indent(2) << "<port-no:0x" << std::hex << (int)msg.get_port_no() << std::dec << " >" << std::endl;
284  indent i(4);
285  os << msg.pql;
286  return os;
287  };
288 };
289 
290 } // end of namespace openflow
291 } // end of namespace rofl
292 
293 #endif /* COFMSG_QUEUE_GET_CONFIG_H_ */
Definition: cofmsg_queue_get_config.h:22
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_queue_get_config.cc:351
virtual ~cofmsg_queue_get_config_request()
Definition: cofmsg_queue_get_config.cc:75
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_queue_get_config.cc:382
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_queue_get_config.cc:154
cofmsg_queue_get_config_reply(uint8_t of_version=0, uint32_t xid=0, uint32_t port_no=0, cofpacket_queues const &pql=cofpacket_queues(openflow12::OFP_VERSION))
Definition: cofmsg_queue_get_config.cc:233
cofmsg_queue_get_config_request(uint8_t of_version=0, uint32_t xid=0, uint32_t port_no=0)
Definition: cofmsg_queue_get_config.cc:5
Definition: cofmsg_queue_get_config.h:152
virtual ~cofmsg_queue_get_config_reply()
Definition: cofmsg_queue_get_config.cc:306
virtual void validate()
Definition: cofmsg_queue_get_config.cc:392
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual size_t length() const
Definition: cofmsg_queue_get_config.cc:99
virtual size_t length() const
Definition: cofmsg_queue_get_config.cc:330
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_queue_get_config.cc:120
Definition: logging.h:76
virtual void reset()
Definition: cofmsg_queue_get_config.cc:83
virtual void validate()
Definition: cofmsg_queue_get_config.cc:164
virtual void reset()
Definition: cofmsg_queue_get_config.cc:314
Definition: cofpacketqueues.h:19
Definition: cofmsg.h:62