8 #ifndef COFHELLOELEMVERSIONBITMAP_H_
9 #define COFHELLOELEMVERSIONBITMAP_H_
14 #include "rofl/common/openflow/cofhelloelem.h"
25 std::vector<uint32_t> bitmaps;
28 uint8_t *ofhu_hello_elem_versionbitmap_generic;
32 #define ofh_hello_elem_version_bitmap_generic ofhu.ofhu_hello_elem_versionbitmap_generic
33 #define ofh_versionbitmap ofhu.ofhu13_versionbitmap
46 uint8_t *buf,
size_t buflen);
98 pack(uint8_t *buf,
size_t buflen);
104 unpack(uint8_t *buf,
size_t buflen);
112 add_ofp_version(uint8_t ofp_version);
118 drop_ofp_version(uint8_t ofp_version);
124 has_ofp_version(uint8_t ofp_version)
const;
130 clear_ofp_versions();
136 get_highest_ofp_version()
const;
142 os << dynamic_cast<cofhello_elem const&>( elem );
143 os <<
indent(2) <<
"<cofhello_elem_versionbitmap >" << std::endl;
144 for (
unsigned int i = 0; i < elem.bitmaps.size(); i++) {
145 os <<
indent(4) <<
"<bitmap[" << i <<
"] 0x" <<
146 std::setfill(
'0') << std::setw(8) <<
147 std::hex << elem.bitmaps[i] << std::dec <<
148 std::setw(0) << std::setfill(
' ') <<
" >" << std::endl;
155 std::stringstream ss;
156 ss <<
"VersionBitmap ";
157 if (has_ofp_version(rofl::openflow10::OFP_VERSION)) {
160 if (has_ofp_version(rofl::openflow12::OFP_VERSION)) {
163 if (has_ofp_version(rofl::openflow13::OFP_VERSION)) {
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: cofhelloelemversionbitmap.cc:151
Definition: cofhelloelemversionbitmap.h:22
void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: cofhelloelemversionbitmap.cc:133
cofhello_elem_versionbitmap operator&(cofhello_elem_versionbitmap const &versionbitmap) const
Calculates (*this AND versionbitmap) and returns a new copy of cofhello_elem_versionbitmap.
Definition: cofhelloelemversionbitmap.cc:84
Definition: cofhelloelemversionbitmap.h:19
virtual uint8_t * resize(size_t len)
Resizes allocated memory area by calling C-function realloc().
Definition: cofhelloelemversionbitmap.cc:104
Definition: cofhelloelem.h:18
Definition: cofhelloelemversionbitmap.h:20
Definition: openflow13.h:2047
Definition: cofhelloelem.h:21