Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_table_stats.h
1 /*
2  * cofmsg_table_stats.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_TABLE_STATS_H_
9 #define COFMSG_TABLE_STATS_H_ 1
10 
11 #include <vector>
12 
13 #include "rofl/common/openflow/messages/cofmsg_stats.h"
14 #include "rofl/common/openflow/coftablestats.h"
15 #include "rofl/common/openflow/coftablestatsarray.h"
16 
17 namespace rofl {
18 namespace openflow {
19 
25 {
26 private:
27 
28 
29 public:
30 
31 
36  uint8_t of_version = 0,
37  uint32_t xid = 0,
38  uint16_t flags = 0);
39 
40 
45  cofmsg_table_stats_request const& stats);
46 
47 
52  operator= (
53  cofmsg_table_stats_request const& stats);
54 
55 
59  virtual
61 
62 
67 
68 
72  virtual void
73  reset();
74 
75 
79  virtual uint8_t*
80  resize(size_t len);
81 
82 
86  virtual size_t
87  length() const;
88 
89 
93  virtual void
94  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
95 
96 
100  virtual void
101  unpack(uint8_t *buf, size_t buflen);
102 
103 
106  virtual void
107  validate();
108 
109 public:
110 
111  friend std::ostream&
112  operator<< (std::ostream& os, cofmsg_table_stats_request const& msg) {
113  os << dynamic_cast<cofmsg const&>( msg );
114  indent i(2);
115  os << dynamic_cast<cofmsg_stats const&>( msg );
116  os << indent(2) << "<cofmsg_table_stats_request >" << std::endl;
117  return os;
118  };
119 
120  std::string
121  str() const {
122  std::stringstream ss;
123  ss << "-Table-Stats-Request- " << cofmsg::str() << " ";
124  return ss.str();
125  };
126 };
127 
128 
133  public cofmsg_stats_reply
134 {
135 private:
136 
137  rofl::openflow::coftablestatsarray tablestatsarray;
138 
139  union {
140  uint8_t* ofhu_table_stats;
141  struct openflow10::ofp_table_stats* ofhu10_table_stats;
142  struct openflow12::ofp_table_stats* ofhu12_table_stats;
143  struct openflow13::ofp_table_stats* ofhu13_table_stats;
144  } ofhu;
145 
146 #define ofh_table_stats ofhu.ofhu_table_stats
147 #define ofh10_table_stats ofhu.ofhu10_table_stats
148 #define ofh12_table_stats ofhu.ofhu12_table_stats
149 #define ofh13_table_stats ofhu.ofhu13_table_stats
150 
151 public:
152 
153 
158  uint8_t of_version = 0,
159  uint32_t xid = 0,
160  uint16_t flags = 0,
162 
163 
168  cofmsg_table_stats_reply const& stats);
169 
170 
175  operator= (
176  cofmsg_table_stats_reply const& stats);
177 
178 
182  virtual
184 
185 
190 
191 
195  virtual void
196  reset();
197 
198 
202  virtual uint8_t*
203  resize(size_t len);
204 
205 
209  virtual size_t
210  length() const;
211 
212 
216  virtual void
217  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
218 
219 
223  virtual void
224  unpack(uint8_t *buf, size_t buflen);
225 
226 
229  virtual void
230  validate();
231 
232 
233 public:
234 
239  set_table_stats_array() { return tablestatsarray; };
240 
245  get_table_stats_array() const { return tablestatsarray; };
246 
247 public:
248 
249  friend std::ostream&
250  operator<< (std::ostream& os, cofmsg_table_stats_reply const& msg) {
251  os << indent(0) << dynamic_cast<cofmsg_stats const&>( msg );
252  os << indent(4) << "<cofmsg_table_stats_reply >" << std::endl;
253  indent i(6);
254  os << msg.tablestatsarray;
255  return os;
256  };
257 
258  std::string
259  str() const {
260  std::stringstream ss;
261  ss << "-Table-Stats-Reply- " << cofmsg::str() << " ";
262  return ss.str();
263  };
264 };
265 
266 } // end of namespace openflow
267 } // end of namespace rofl
268 
269 #endif /* COFMSG_TABLE_STATS_H_ */
cofmsg_table_stats_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, rofl::openflow::coftablestatsarray const &table_stats=rofl::openflow::coftablestatsarray())
Definition: cofmsg_table_stats.cc:180
Definition: cofmsg_stats.h:264
virtual void reset()
Definition: cofmsg_table_stats.cc:272
Definition: openflow12.h:1426
Definition: openflow13.h:1250
Definition: openflow10.h:847
virtual void validate()
Definition: cofmsg_table_stats.cc:154
Definition: cofmsg_stats.h:187
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_table_stats.cc:113
virtual ~cofmsg_table_stats_request()
Definition: cofmsg_table_stats.cc:68
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_table_stats.cc:323
cofmsg_table_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0)
Definition: cofmsg_table_stats.cc:5
Definition: cofmsg_table_stats.h:23
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_table_stats.cc:357
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_table_stats.cc:144
Definition: coftablestatsarray.h:19
virtual void validate()
Definition: cofmsg_table_stats.cc:367
virtual ~cofmsg_table_stats_reply()
Definition: cofmsg_table_stats.cc:264
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual size_t length() const
Definition: cofmsg_table_stats.cc:92
virtual size_t length() const
Definition: cofmsg_table_stats.cc:302
Definition: logging.h:76
virtual void reset()
Definition: cofmsg_table_stats.cc:76
Definition: cofmsg_table_stats.h:132