5 #ifndef COFBUCKETLIST_H
6 #define COFBUCKETLIST_H 1
13 #include "../endian_conversion.h"
16 #include "rofl/common/openflow/openflow.h"
17 #include "rofl/common/openflow/cofbucket.h"
31 std::map<uint32_t, cofbucket> buckets;
39 uint8_t ofp_version = openflow::OFP_VERSION_UNKNOWN);
71 get_version()
const {
return ofp_version; };
77 set_version(uint8_t ofp_version) { this->ofp_version = ofp_version; };
82 std::map<uint32_t, cofbucket>&
83 set_buckets() {
return buckets; };
88 std::map<uint32_t, cofbucket>
const&
89 get_buckets()
const {
return buckets; };
97 add_bucket(uint32_t bucket_id);
103 drop_bucket(uint32_t bucket_id);
109 set_bucket(uint32_t bucket_id);
115 get_bucket(uint32_t bucket_id)
const;
121 has_bucket(uint32_t bucket_id);
129 clear() { buckets.clear(); };
135 check_prerequisites()
const;
149 pack(uint8_t* buf,
size_t buflen);
155 unpack(uint8_t* buf,
size_t buflen);
163 unpack_of13(uint8_t* buf,
size_t buflen);
168 pack_of13(uint8_t* buf,
size_t buflen);
173 operator<< (std::ostream& os,
cofbuckets const& buckets) {
174 switch (buckets.get_version()) {
175 case rofl::openflow::OFP_VERSION_UNKNOWN: {
176 os <<
indent(0) <<
"<cofbuckets ";
177 os <<
"ofp-version:" << (int)buckets.ofp_version <<
" >" << std::endl;
180 case rofl::openflow12::OFP_VERSION:
181 case rofl::openflow13::OFP_VERSION: {
182 os <<
indent(0) <<
"<cofbuckets ";
183 os <<
"ofp-version:" << (int)buckets.ofp_version <<
" ";
184 os <<
"#buckets:" << buckets.buckets.size() <<
" >" << std::endl;
186 for (std::map<uint32_t, cofbucket>::const_iterator
187 it = buckets.buckets.begin(); it != buckets.buckets.end(); ++it) {
Definition: croflexception.h:73
Definition: cofbuckets.h:22
Definition: cofbucket.h:32
Definition: cofbuckets.h:28
Definition: cofbuckets.h:24
Definition: cofbuckets.h:25
Definition: cofbuckets.h:23
Definition: croflexception.h:27