8 #ifndef COFHELLO_ELEM_H_
9 #define COFHELLO_ELEM_H_
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/logging.h"
13 #include "rofl/common/openflow/openflow.h"
26 uint8_t *ofhu_hello_elem_generic;
30 #define ofh_hello_elem_generic ofhu.ofhu_hello_elem_generic
31 #define ofh_hello_elem_header ofhu.ofhu13_hello_elem_header
45 uint8_t *buf,
size_t buflen);
84 pack(uint8_t *buf,
size_t buflen);
90 unpack(uint8_t *buf,
size_t buflen);
96 get_type()
const {
return be16toh(ofh_hello_elem_header->type); };
102 set_type(uint16_t type) { ofh_hello_elem_header->type = htobe16(type); };
108 get_length()
const {
return be16toh(ofh_hello_elem_header->length); };
114 set_length(uint16_t len) { ofh_hello_elem_header->length = htobe16(len); };
120 os <<
indent(0) <<
"<cofhello_elem type:" << elem.get_type()
121 <<
" length:" << elem.get_length() <<
" padding:" << (elem.length()-elem.get_length()) <<
" >" << std::endl;
Definition: cofhelloelem.h:19
void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: cofhelloelem.cc:85
Definition: cofhelloelem.h:18
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: cofhelloelem.cc:95
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
virtual uint8_t * resize(size_t len)
Resizes allocated memory area by calling C-function realloc().
Definition: cofhelloelem.cc:57
Definition: cofhelloelem.h:21
Definition: croflexception.h:27