Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmeterfeatures.h
1 /*
2  * cofmeterfeatures.h
3  *
4  * Created on: 26.05.2014
5  * Author: andi
6  */
7 
8 #ifndef COFMETERFEATURES_H_
9 #define COFMETERFEATURES_H_ 1
10 
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/openflow/openflow.h"
13 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
14 
15 namespace rofl {
16 namespace openflow {
17 
21 
23 {
24 public:
29  uint8_t of_version = 0,
30  uint8_t *buf = (uint8_t*)0,
31  size_t buflen = 0);
32 
33 
38  uint8_t of_version,
39  uint32_t max_meter,
40  uint32_t band_types,
41  uint32_t capabilities,
42  uint8_t max_bands,
43  uint8_t max_color);
44 
45 
46 
50  virtual
52 
53 
58  const cofmeter_features_reply& meter_features_reply);
59 
64  operator= (
65  const cofmeter_features_reply& meter_features_reply);
66 
70  bool
71  operator== (
72  const cofmeter_features_reply& meter_features_reply);
73 
74 public:
75 
79  void
80  clear();
81 
85  size_t
86  length() const;
87 
91  void
92  pack(uint8_t *buf, size_t buflen);
93 
97  void
98  unpack(uint8_t *buf, size_t buflen);
99 
100 public:
101 
105  void
106  set_version(uint8_t of_version) { this->of_version = of_version; };
107 
111  uint8_t
112  get_version() const { return of_version; };
113 
117  void
118  set_max_meter(uint32_t max_meter) { this->max_meter = max_meter; };
119 
123  uint32_t
124  get_max_meter() const { return max_meter; };
125 
129  void
130  set_band_types(uint32_t band_types) { this->band_types = band_types; };
131 
135  uint32_t
136  get_band_types() const { return band_types; };
137 
141  void
142  set_capabilities(uint32_t capabilities) { this->capabilities = capabilities; };
143 
147  uint32_t
148  get_capabilities() const { return capabilities; };
149 
153  void
154  set_max_bands(uint8_t max_bands) { this->max_bands = max_bands; };
155 
159  uint8_t
160  get_max_bands() const { return max_bands; };
161 
165  void
166  set_max_color(uint8_t max_color) { this->max_color = max_color; };
167 
171  uint8_t
172  get_max_color() const { return max_color; };
173 
174 
175 public:
176 
177  friend std::ostream&
178  operator<< (std::ostream& os, cofmeter_features_reply const& r) {
179  os << indent(0) << "<cofmeter_features_reply ofp-version: " << (int)r.get_version() << " >" << std::endl;
180  os << std::hex;
181  os << indent(2) << "<max-meter: 0x" << (unsigned int)r.get_max_meter() << " >" << std::endl;
182  os << indent(2) << "<band-types: 0x" << (unsigned int)r.get_band_types() << " >" << std::endl;
183  os << indent(2) << "<capabilities: 0x" << (unsigned int)r.get_capabilities() << " >" << std::endl;
184  os << indent(2) << "<max-bands: 0x" << (unsigned int)r.get_max_bands() << " >" << std::endl;
185  os << indent(2) << "<max-color: 0x" << (unsigned int)r.get_max_color() << " >" << std::endl;
186  os << std::dec;
187  return os;
188  };
189 
190 private: // data structures
191 
192  uint8_t of_version;
193  uint32_t max_meter;
194  uint32_t band_types;
195  uint32_t capabilities;
196  uint8_t max_bands;
197  uint8_t max_color;
198 };
199 
201 
202 } /* end of namespace openflow */
203 } /* end of namespace rofl */
204 
205 #endif /* COFMETERFEATURES_H_ */
Definition: cofmeterfeatures.h:22
Definition: cofmeterfeatures.h:18
Definition: cofmeterfeatures.h:20
Definition: cofmeterfeatures.h:19
Definition: logging.h:76
Definition: croflexception.h:27