8 #ifndef COFMSG_CONFIG_H_
9 #define COFMSG_CONFIG_H_ 1
11 #include "rofl/common/openflow/messages/cofmsg.h"
29 uint8_t of_version = 0,
79 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
86 unpack(uint8_t *buf,
size_t buflen);
98 os << indent(0) << dynamic_cast<cofmsg const&>( msg );
99 os <<
indent(2) <<
"<cofmsg_get_config_request >" << std::endl;;
105 std::stringstream ss;
106 ss <<
"-Get-Config-Request- " << cofmsg::str() <<
" ";
121 uint8_t* ofhu_switch_config;
127 #define ofh_switch_config ofhu.ofhu_switch_config
128 #define ofh10_switch_config ofhu.ofhu10_switch_config
129 #define ofh12_switch_config ofhu.ofhu12_switch_config
130 #define ofh13_switch_config ofhu.ofhu13_switch_config
139 uint8_t of_version = 0,
142 uint16_t miss_send_len = 0);
198 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
205 unpack(uint8_t *buf,
size_t buflen);
227 set_flags(uint16_t flags);
233 get_miss_send_len()
const;
239 set_miss_send_len(uint16_t miss_send_len);
246 switch (msg.get_version()) {
247 case rofl::openflow10::OFP_VERSION: {
248 if ((msg.get_flags() & rofl::openflow10::OFPC_FRAG_DROP) == rofl::openflow10::OFPC_FRAG_NORMAL)
249 s_flags.append(
"FRAG-NORMAL ");
250 if (msg.get_flags() & rofl::openflow10::OFPC_FRAG_DROP)
251 s_flags.append(
"FRAG-DROP ");
252 if (msg.get_flags() & rofl::openflow10::OFPC_FRAG_REASM)
253 s_flags.append(
"FRAG-REASM ");
255 case rofl::openflow12::OFP_VERSION: {
256 if ((msg.get_flags() & rofl::openflow12::OFPC_FRAG_DROP) == rofl::openflow12::OFPC_FRAG_NORMAL)
257 s_flags.append(
"FRAG-NORMAL ");
258 if (msg.get_flags() & rofl::openflow12::OFPC_FRAG_DROP)
259 s_flags.append(
"FRAG-DROP ");
260 if (msg.get_flags() & rofl::openflow12::OFPC_FRAG_REASM)
261 s_flags.append(
"FRAG-REASM ");
262 if (msg.get_flags() & rofl::openflow12::OFPC_INVALID_TTL_TO_CONTROLLER)
263 s_flags.append(
"INVALID-TTL-TO-CONTROLLER ");
265 case rofl::openflow13::OFP_VERSION: {
266 if ((msg.get_flags() & rofl::openflow13::OFPC_FRAG_DROP) == rofl::openflow13::OFPC_FRAG_NORMAL)
267 s_flags.append(
"FRAG-NORMAL ");
268 if (msg.get_flags() & rofl::openflow13::OFPC_FRAG_DROP)
269 s_flags.append(
"FRAG-DROP ");
270 if (msg.get_flags() & rofl::openflow13::OFPC_FRAG_REASM)
271 s_flags.append(
"FRAG-REASM ");
274 s_flags.append(
"unsupported OF version");
277 os << indent(0) << dynamic_cast<cofmsg const&>( msg );
278 os <<
indent(2) <<
"<cofmsg_get_config_reply ";
279 os <<
"miss-send-len:" << (int)msg.get_miss_send_len() <<
" ";
280 os <<
"flags:" << s_flags <<
" ";
281 os <<
" >" << std::endl;
287 std::stringstream ss;
288 ss <<
"-Get-Config-Reply- " << cofmsg::str() <<
" ";
289 ss <<
"miss_send_len: " << (
unsigned int)get_miss_send_len() <<
", ";
291 switch (get_version()) {
292 case rofl::openflow10::OFP_VERSION: {
293 if ((get_flags() & rofl::openflow10::OFPC_FRAG_DROP) == rofl::openflow10::OFPC_FRAG_NORMAL)
294 s_flags.append(
"FRAG-NORMAL ");
295 if (get_flags() & rofl::openflow10::OFPC_FRAG_DROP)
296 s_flags.append(
"FRAG-DROP ");
297 if (get_flags() & rofl::openflow10::OFPC_FRAG_REASM)
298 s_flags.append(
"FRAG-REASM ");
300 case rofl::openflow12::OFP_VERSION: {
301 if ((get_flags() & rofl::openflow12::OFPC_FRAG_DROP) == rofl::openflow12::OFPC_FRAG_NORMAL)
302 s_flags.append(
"FRAG-NORMAL ");
303 if (get_flags() & rofl::openflow12::OFPC_FRAG_DROP)
304 s_flags.append(
"FRAG-DROP ");
305 if (get_flags() & rofl::openflow12::OFPC_FRAG_REASM)
306 s_flags.append(
"FRAG-REASM ");
307 if (get_flags() & rofl::openflow12::OFPC_INVALID_TTL_TO_CONTROLLER)
308 s_flags.append(
"INVALID-TTL-TO-CONTROLLER ");
310 case rofl::openflow13::OFP_VERSION: {
311 if ((get_flags() & rofl::openflow13::OFPC_FRAG_DROP) == rofl::openflow13::OFPC_FRAG_NORMAL)
312 s_flags.append(
"FRAG-NORMAL ");
313 if (get_flags() & rofl::openflow13::OFPC_FRAG_DROP)
314 s_flags.append(
"FRAG-DROP ");
315 if (get_flags() & rofl::openflow13::OFPC_FRAG_REASM)
316 s_flags.append(
"FRAG-REASM ");
319 s_flags.append(
"unsupported OF version");
322 ss <<
"flags: " << s_flags <<
" ";
338 uint8_t* ofhu_switch_config;
344 #define ofh_switch_config ofhu.ofhu_switch_config
345 #define ofh10_switch_config ofhu.ofhu10_switch_config
346 #define ofh12_switch_config ofhu.ofhu12_switch_config
347 #define ofh13_switch_config ofhu.ofhu13_switch_config
356 uint8_t of_version = 0,
359 uint16_t miss_send_len = 0);
415 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
422 unpack(uint8_t *buf,
size_t buflen);
444 set_flags(uint16_t flags);
450 get_miss_send_len()
const;
456 set_miss_send_len(uint16_t miss_send_len);
463 switch (msg.get_version()) {
464 case rofl::openflow10::OFP_VERSION: {
465 if ((msg.get_flags() & rofl::openflow10::OFPC_FRAG_DROP) == rofl::openflow10::OFPC_FRAG_NORMAL)
466 s_flags.append(
"FRAG-NORMAL ");
467 if (msg.get_flags() & rofl::openflow10::OFPC_FRAG_DROP)
468 s_flags.append(
"FRAG-DROP ");
469 if (msg.get_flags() & rofl::openflow10::OFPC_FRAG_REASM)
470 s_flags.append(
"FRAG-REASM ");
472 case rofl::openflow12::OFP_VERSION: {
473 if ((msg.get_flags() & rofl::openflow12::OFPC_FRAG_DROP) == rofl::openflow12::OFPC_FRAG_NORMAL)
474 s_flags.append(
"FRAG-NORMAL ");
475 if (msg.get_flags() & rofl::openflow12::OFPC_FRAG_DROP)
476 s_flags.append(
"FRAG-DROP ");
477 if (msg.get_flags() & rofl::openflow12::OFPC_FRAG_REASM)
478 s_flags.append(
"FRAG-REASM ");
479 if (msg.get_flags() & rofl::openflow12::OFPC_INVALID_TTL_TO_CONTROLLER)
480 s_flags.append(
"INVALID-TTL-TO-CONTROLLER ");
482 case rofl::openflow13::OFP_VERSION: {
483 if ((msg.get_flags() & rofl::openflow13::OFPC_FRAG_DROP) == rofl::openflow13::OFPC_FRAG_NORMAL)
484 s_flags.append(
"FRAG-NORMAL ");
485 if (msg.get_flags() & rofl::openflow13::OFPC_FRAG_DROP)
486 s_flags.append(
"FRAG-DROP ");
487 if (msg.get_flags() & rofl::openflow13::OFPC_FRAG_REASM)
488 s_flags.append(
"FRAG-REASM ");
491 s_flags.append(
"unsupported OF version");
494 os << dynamic_cast<cofmsg const&>( msg );
495 os <<
indent(2) <<
"<cofmsg_set_config ";
496 os <<
"miss-send-len:" << (int)msg.get_miss_send_len() <<
" ";
497 os <<
"flags:" << s_flags <<
" ";
498 os <<
" >" << std::endl;
504 std::stringstream ss;
505 ss <<
"-Set-Config-Reply- " << cofmsg::str() <<
" ";
506 ss <<
"miss_send_len: " << (
unsigned int)get_miss_send_len() <<
", ";
508 switch (get_version()) {
509 case rofl::openflow10::OFP_VERSION: {
510 if ((get_flags() & rofl::openflow10::OFPC_FRAG_DROP) == rofl::openflow10::OFPC_FRAG_NORMAL)
511 s_flags.append(
"FRAG-NORMAL ");
512 if (get_flags() & rofl::openflow10::OFPC_FRAG_DROP)
513 s_flags.append(
"FRAG-DROP ");
514 if (get_flags() & rofl::openflow10::OFPC_FRAG_REASM)
515 s_flags.append(
"FRAG-REASM ");
517 case rofl::openflow12::OFP_VERSION: {
518 if ((get_flags() & rofl::openflow12::OFPC_FRAG_DROP) == rofl::openflow12::OFPC_FRAG_NORMAL)
519 s_flags.append(
"FRAG-NORMAL ");
520 if (get_flags() & rofl::openflow12::OFPC_FRAG_DROP)
521 s_flags.append(
"FRAG-DROP ");
522 if (get_flags() & rofl::openflow12::OFPC_FRAG_REASM)
523 s_flags.append(
"FRAG-REASM ");
524 if (get_flags() & rofl::openflow12::OFPC_INVALID_TTL_TO_CONTROLLER)
525 s_flags.append(
"INVALID-TTL-TO-CONTROLLER ");
527 case rofl::openflow13::OFP_VERSION: {
528 if ((get_flags() & rofl::openflow13::OFPC_FRAG_DROP) == rofl::openflow13::OFPC_FRAG_NORMAL)
529 s_flags.append(
"FRAG-NORMAL ");
530 if (get_flags() & rofl::openflow13::OFPC_FRAG_DROP)
531 s_flags.append(
"FRAG-DROP ");
532 if (get_flags() & rofl::openflow13::OFPC_FRAG_REASM)
533 s_flags.append(
"FRAG-REASM ");
536 s_flags.append(
"unsupported OF version");
539 ss <<
"flags: " << s_flags <<
" ";
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_config.cc:102
Definition: cofmsg_config.h:115
virtual ~cofmsg_get_config_reply()
Definition: cofmsg_config.cc:217
virtual ~cofmsg_set_config()
Definition: cofmsg_config.cc:494
virtual size_t length() const
Definition: cofmsg_config.cc:242
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_config.cc:86
cofmsg_get_config_reply(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, uint16_t miss_send_len=0)
Definition: cofmsg_config.cc:140
virtual void validate()
Definition: cofmsg_config.cc:112
virtual void validate()
Definition: cofmsg_config.cc:578
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_config.cc:263
Definition: openflow12.h:194
virtual void reset()
Definition: cofmsg_config.cc:70
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_config.cc:291
Definition: cofmsg_config.h:19
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_config.cc:568
virtual void reset()
Definition: cofmsg_config.cc:225
virtual size_t length() const
Definition: cofmsg_config.cc:519
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_config.cc:540
virtual ~cofmsg_get_config_request()
Definition: cofmsg_config.cc:62
Definition: openflow13.h:731
cofmsg_set_config(uint8_t of_version=0, uint32_t xid=0, uint16_t flags=0, uint16_t miss_send_len=0)
Definition: cofmsg_config.cc:417
virtual void validate()
Definition: cofmsg_config.cc:301
cofmsg_get_config_request(uint8_t of_version=0, uint32_t xid=0)
Definition: cofmsg_config.cc:5
virtual size_t length() const
Definition: cofmsg_config.cc:78
Definition: openflow10.h:173
virtual void reset()
Definition: cofmsg_config.cc:502
Definition: cofmsg_config.h:332