14 #include "../endian_conversion.h"
17 #include "rofl/common/openflow/openflow.h"
18 #include "rofl/common/croflexception.h"
19 #include "rofl/common/cmemory.h"
20 #include "rofl/common/openflow/cofactions.h"
36 uint64_t packet_count;
50 uint8_t ofp_version = openflow::OFP_VERSION_UNKNOWN,
52 uint32_t watch_port = 0,
53 uint32_t watch_group = 0);
91 pack(uint8_t* bucket,
size_t bclen);
98 unpack(uint8_t* bucket,
size_t bclen);
120 check_prerequisites()
const;
128 get_version()
const {
return ofp_version; };
134 set_version(uint8_t ofp_version) { this->ofp_version = ofp_version; };
140 get_packet_count()
const {
return packet_count; };
146 set_packet_count(uint64_t packet_count) { this->packet_count = packet_count; };
152 get_byte_count()
const {
return byte_count; };
158 set_byte_count(uint64_t byte_count) { this->byte_count = byte_count; };
164 set_weight(uint16_t weight) { this->weight = weight; };
170 get_weight()
const {
return weight; };
176 set_watch_port(uint32_t watch_port) { this->watch_port = watch_port; };
182 get_watch_port()
const {
return watch_port; };
188 set_watch_group(uint32_t watch_group) { this->watch_group = watch_group; };
194 get_watch_group()
const {
return watch_group; };
200 set_actions() {
return actions; };
206 get_actions()
const {
return actions; };
213 pack_of12(uint8_t* buf,
size_t buflen);
218 unpack_of12(uint8_t *buf,
size_t buflen);
223 pack_of13(uint8_t* buf,
size_t buflen);
228 unpack_of13(uint8_t *buf,
size_t buflen);
233 operator<< (std::ostream& os,
cofbucket const& bucket) {
234 switch (bucket.get_version()) {
235 case rofl::openflow::OFP_VERSION_UNKNOWN: {
236 os <<
indent(0) <<
"<cofbucket ";
237 os <<
"ofp-version:" << (int)bucket.ofp_version <<
" >" << std::endl;
239 case rofl::openflow12::OFP_VERSION:
240 case rofl::openflow13::OFP_VERSION: {
241 os <<
indent(0) <<
"<cofbucket ";
242 os <<
"ofp-version:" << (int)bucket.ofp_version <<
" >" << std::endl;
244 os <<
indent(2) <<
"<weight: 0x" << (int)bucket.weight <<
" >" << std::endl;
245 os <<
indent(2) <<
"<watch-group: 0x" << (int)bucket.watch_group <<
" >" << std::endl;
246 os <<
indent(2) <<
"<watch-port: 0x" << (int)bucket.watch_port <<
" >" << std::endl;
247 os <<
indent(2) <<
"<packet-count: 0x" << (int)bucket.packet_count <<
" >" << std::endl;
248 os <<
indent(2) <<
"<byte-count: 0x" << (int)bucket.byte_count <<
" >" << std::endl;
250 os <<
indent(2) <<
"<actions: >" << std::endl;
252 os << bucket.actions;
Definition: croflexception.h:73
Definition: cofbucket.h:32
Definition: cofactions.h:22
Definition: cofbucket.h:27
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: cofbucket.h:28
Definition: cofbucket.h:26
Definition: croflexception.h:27