Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_role.h
1 /*
2  * cofmsg_role.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_ROLE_H
9 #define COFMSG_ROLE_H 1
10 
11 #include "rofl/common/openflow/messages/cofmsg.h"
12 #include "rofl/common/openflow/cofrole.h"
13 
14 namespace rofl {
15 namespace openflow {
16 
21  public cofmsg
22 {
24 
25 public:
26 
27 
32  uint8_t of_version = 0,
33  uint32_t xid = 0,
35 
36 
41  cofmsg_role_request const& role);
42 
43 
48  operator= (
49  cofmsg_role_request const& role);
50 
51 
55  virtual
57 
58 
62  cofmsg_role_request(cmemory *memarea);
63 
64 
68  virtual void
69  reset();
70 
71 public:
72 
76  virtual size_t
77  length() const;
78 
79 
83  virtual void
84  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
85 
86 
90  virtual void
91  unpack(uint8_t *buf, size_t buflen);
92 
93 
96  virtual void
97  validate();
98 
99 
100 public:
101 
106  set_role() { return role; };
107 
112  get_role() const { return role; };
113 
114 public:
115 
116  friend std::ostream&
117  operator<< (std::ostream& os, cofmsg_role_request const& msg) {
118  os << dynamic_cast<cofmsg const&>( msg );
119  os << indent(0) << "<cofmsg_role_request >" << std::endl;
120  rofl::indent i(2);
121  os << msg.role;
122  return os;
123  };
124 };
125 
126 
127 
132  public cofmsg
133 {
135 
136 public:
137 
138 
143  uint8_t of_version = 0,
144  uint32_t xid = 0,
146 
147 
152  cofmsg_role_reply const& role);
153 
154 
159  operator= (
160  cofmsg_role_reply const& role);
161 
162 
166  virtual
168 
169 
173  cofmsg_role_reply(cmemory *memarea);
174 
175 
179  virtual void
180  reset();
181 
182 public:
183 
187  virtual size_t
188  length() const;
189 
190 
194  virtual void
195  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
196 
197 
201  virtual void
202  unpack(uint8_t *buf, size_t buflen);
203 
204 
207  virtual void
208  validate();
209 
210 
211 public:
212 
217  set_role() { return role; };
218 
223  get_role() const { return role; };
224 
225 public:
226 
227  friend std::ostream&
228  operator<< (std::ostream& os, cofmsg_role_reply const& msg) {
229  os << dynamic_cast<cofmsg const&>( msg );
230  os << indent(0) << "<cofmsg_role_reply >" << std::endl;
231  rofl::indent i(2);
232  os << msg.role;
233  return os;
234  };
235 };
236 
237 } // end of namespace openflow
238 } // end of namespace rofl
239 
240 #endif /* COFMSG_ROLE_H_ */
Definition: cofmsg_role.h:131
virtual void reset()
Definition: cofmsg_role.cc:264
virtual ~cofmsg_role_reply()
Definition: cofmsg_role.cc:256
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_role.cc:103
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_role.cc:291
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_role.cc:134
virtual void validate()
Definition: cofmsg_role.cc:332
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_role.cc:322
virtual size_t length() const
Definition: cofmsg_role.cc:85
cofmsg_role_reply(uint8_t of_version=0, uint32_t xid=0, rofl::openflow::cofrole const &role=rofl::openflow::cofrole())
Definition: cofmsg_role.cc:193
virtual void reset()
Definition: cofmsg_role.cc:76
cofmsg_role_request(uint8_t of_version=0, uint32_t xid=0, rofl::openflow::cofrole const &role=rofl::openflow::cofrole())
Definition: cofmsg_role.cc:5
Definition: cofrole.h:23
Definition: cofmsg_role.h:20
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual void validate()
Definition: cofmsg_role.cc:144
virtual size_t length() const
Definition: cofmsg_role.cc:273
Definition: logging.h:76
virtual ~cofmsg_role_request()
Definition: cofmsg_role.cc:68
Definition: cofmsg.h:62