Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_desc_stats.h
1 /*
2  * cofmsg_desc_stats.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_DESC_STATS_H_
9 #define COFMSG_DESC_STATS_H_ 1
10 
11 #include "rofl/common/openflow/messages/cofmsg_stats.h"
12 #include "rofl/common/openflow/cofdescstats.h"
13 
14 namespace rofl {
15 namespace openflow {
16 
17 
23 {
24 private:
25 
26 public:
27 
28 
33  uint8_t of_version = 0,
34  uint32_t xid = 0,
35  uint16_t flags = 0);
36 
37 
42  cofmsg_desc_stats_request const& stats);
43 
44 
49  operator= (
50  cofmsg_desc_stats_request const& stats);
51 
52 
56  virtual
58 
59 
64 
65 
69  virtual void
70  reset();
71 
72 
76  virtual uint8_t*
77  resize(size_t len);
78 
79 
83  virtual size_t
84  length() const;
85 
86 
90  virtual void
91  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
92 
93 
97  virtual void
98  unpack(uint8_t *buf, size_t buflen);
99 
100 
103  virtual void
104  validate();
105 
106 public:
107 
108  friend std::ostream&
109  operator<< (std::ostream& os, cofmsg_desc_stats_request const& msg) {
110  os << dynamic_cast<cofmsg_stats_request const&>( msg );
111  os << indent(2) << "<cofmsg_desc_stats_request >" << std::endl;
112  return os;
113  };
114 };
115 
116 
117 
122  public cofmsg_stats_reply
123 {
124 private:
125 
126  cofdesc_stats_reply desc_stats;
127 
128  union {
129  uint8_t* ofhu_desc_stats;
130  struct openflow10::ofp_desc_stats* ofhu10_desc_stats;
131  struct openflow12::ofp_desc_stats* ofhu12_desc_stats;
132  // TODO: OF1.3
133  } ofhu;
134 
135 #define ofh_desc_stats ofhu.ofhu_desc_stats
136 #define ofh10_desc_stats ofhu.ofhu10_desc_stats
137 #define ofh12_desc_stats ofhu.ofhu12_desc_stats
138 // TODO OF1.3
139 
140 public:
141 
142 
147  uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN,
148  uint32_t xid = 0,
149  uint16_t flags = 0,
150  cofdesc_stats_reply const& desc_stats = cofdesc_stats_reply());
151 
152 
157  cofmsg_desc_stats_reply const& stats);
158 
159 
164  operator= (
165  cofmsg_desc_stats_reply const& stats);
166 
167 
171  virtual
173 
174 
179 
180 
184  virtual void
185  reset();
186 
187 
191  virtual uint8_t*
192  resize(size_t len);
193 
194 
198  virtual size_t
199  length() const;
200 
201 
205  virtual void
206  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
207 
208 
212  virtual void
213  unpack(uint8_t *buf, size_t buflen);
214 
215 
218  virtual void
219  validate();
220 
221 
222 public:
223 
224 
229  get_desc_stats();
230 
231 public:
232 
233  friend std::ostream&
234  operator<< (std::ostream& os, cofmsg_desc_stats_reply const& msg) {
235  os << dynamic_cast<cofmsg_stats_reply const&>( msg );
236  os << indent(2) << "<cofmsg_desc_stats_reply >" << std::endl;
237  indent i(2);
238  os << msg.desc_stats;
239  return os;
240  };
241 };
242 
243 } // end of namespace openflow
244 } // end of namespace rofl
245 
246 #endif /* COFMSG_DESC_STATS_H_ */
virtual size_t length() const
Definition: cofmsg_desc_stats.cc:288
Definition: cofmsg_stats.h:264
virtual void validate()
Definition: cofmsg_desc_stats.cc:146
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_desc_stats.cc:307
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_desc_stats.cc:108
virtual ~cofmsg_desc_stats_request()
Definition: cofmsg_desc_stats.cc:65
Definition: cofmsg_desc_stats.h:121
Definition: cofdescstats.h:18
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_desc_stats.cc:337
Definition: cofmsg_desc_stats.h:21
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_desc_stats.cc:136
virtual void reset()
Definition: cofmsg_desc_stats.cc:73
Definition: cofmsg_stats.h:187
virtual void reset()
Definition: cofmsg_desc_stats.cc:260
virtual void validate()
Definition: cofmsg_desc_stats.cc:347
virtual size_t length() const
Definition: cofmsg_desc_stats.cc:89
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: openflow10.h:783
Definition: openflow12.h:1318
Definition: logging.h:76
cofmsg_desc_stats_reply(uint8_t of_version=rofl::openflow::OFP_VERSION_UNKNOWN, uint32_t xid=0, uint16_t flags=0, cofdesc_stats_reply const &desc_stats=cofdesc_stats_reply())
Definition: cofmsg_desc_stats.cc:172
cofmsg_desc_stats_request(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0)
Definition: cofmsg_desc_stats.cc:6
virtual ~cofmsg_desc_stats_reply()
Definition: cofmsg_desc_stats.cc:252