Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofgroupfeaturesstats.h
1 /*
2  * cofflowstatsrequest.h
3  *
4  * Created on: 14.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFGROUPFEATURESSTATS_H_
9 #define COFGROUPFEATURESSTATS_H_ 1
10 
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/openflow/cofmatch.h"
13 #include "rofl/common/openflow/cofactions.h"
14 #include "rofl/common/openflow/cofinstructions.h"
15 #include "rofl/common/openflow/openflow.h"
16 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
17 
18 namespace rofl {
19 namespace openflow {
20 
22 {
23 private: // data structures
24 
25  uint8_t of_version;
26  uint32_t types;
27  uint32_t capabilities;
28  std::vector<uint32_t> max_groups;
29  std::vector<uint32_t> actions;
30 
31 public: // data structures
32 
33 
34 public:
39  uint8_t of_version = 0,
40  uint8_t *buf = (uint8_t*)0,
41  size_t buflen = 0);
42 
43 
48  uint8_t of_version,
49  uint32_t types,
50  uint32_t capabilities,
51  std::vector<uint32_t> const& max_groups,
52  std::vector<uint32_t> const& actions);
53 
54 
58  virtual
60 
61 
66  cofgroup_features_stats_reply const& group_features_stats);
67 
72  operator= (
73  cofgroup_features_stats_reply const& group_features_stats);
74 
75 
79  void
80  pack(uint8_t *buf, size_t buflen) const;
81 
82 
86  void
87  unpack(uint8_t *buf, size_t buflen);
88 
89 
93  size_t
94  length() const;
95 
96 
97 public:
98 
99 
103  uint8_t
104  get_version() const;
105 
106 
110  void
111  set_version(uint8_t of_version);
112 
113 
117  uint32_t
118  get_types() const;
119 
120 
124  void
125  set_types(uint32_t types);
126 
127 
131  uint32_t
132  get_capabilities() const;
133 
134 
138  void
139  set_capabilities(uint32_t capabilities);
140 
141 
145  std::vector<uint32_t>&
146  set_max_groups();
147 
151  std::vector<uint32_t> const&
152  get_max_groups() const;
153 
157  std::vector<uint32_t>&
158  set_actions();
159 
163  std::vector<uint32_t> const&
164  get_actions() const;
165 
166 public:
167 
168  friend std::ostream&
169  operator<< (std::ostream& os, cofgroup_features_stats_reply const& reply) {
170  os << indent(0) << "<cofgroup_features_stats_reply >" << std::endl;
171  os << indent(2) << "<types: 0x" << std::hex << (int)reply.get_types() << std::dec << " >" << std::endl;
172  os << indent(2) << "<capabilities: 0x" << std::hex << (int)reply.get_capabilities() << std::dec << " >" << std::endl;
173  for (unsigned int i = 0; i < reply.max_groups.size(); ++i) {
174  os << indent(2) << "<max-groups[" << i << "]: " << (int)reply.max_groups[i] << " >" << std::endl;
175  }
176  for (unsigned int i = 0; i < reply.actions.size(); ++i) {
177  os << indent(2) << "<actions[" << i << "]: 0x" << std::hex << (int)reply.max_groups[i] << std::dec << " >" << std::endl;
178  }
179  return os;
180  };
181 };
182 
183 } /* end of namespace */
184 } /* end of namespace */
185 
186 #endif /* COFGROUPFEATURESSTATS_H_ */
Definition: cofgroupfeaturesstats.h:21
Definition: logging.h:76