8 #ifndef COFTABLEFEATURES_H_
9 #define COFTABLEFEATURES_H_ 1
13 #include "rofl/common/cmemory.h"
14 #include "rofl/common/croflexception.h"
15 #include "rofl/common/openflow/openflow.h"
16 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
17 #include "rofl/common/openflow/coftablefeatureprops.h"
35 uint8_t* ofhu_table_features_generic;
39 #define ofh_tf_generic ofh_ofhu.ofhu_table_features_generic
40 #define ofh_table_features ofh_ofhu.ofhu_table_features
49 uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN);
84 pack(uint8_t* buf,
size_t buflen);
90 unpack(uint8_t* buf,
size_t buflen);
98 get_version()
const {
return ofp_version; };
104 set_version(uint8_t ofp_version) { this->ofp_version = ofp_version; };
110 get_length()
const {
return be16toh(ofh_table_features->length); };
116 set_length(uint16_t length) { ofh_table_features->length = htobe16(length); };
122 get_table_id()
const {
return ofh_table_features->table_id; };
128 set_table_id(uint8_t table_id) { ofh_table_features->table_id = table_id; };
135 return std::string(ofh_table_features->name, strnlen(ofh_table_features->name, OFP_MAX_TABLE_NAME_LEN));
142 set_name(std::string
const& name) {
143 memset(ofh_table_features->name, 0, OFP_MAX_TABLE_NAME_LEN);
144 strncpy(ofh_table_features->name, name.c_str(), OFP_MAX_TABLE_NAME_LEN);
151 get_metadata_match()
const {
return be64toh(ofh_table_features->metadata_match); };
157 set_metadata_match(uint64_t metadata_match) { ofh_table_features->metadata_match = htobe64(metadata_match); };
163 get_metadata_write()
const {
return be64toh(ofh_table_features->metadata_write); };
169 set_metadata_write(uint64_t metadata_write) { ofh_table_features->metadata_write = htobe64(metadata_write); };
175 get_config()
const {
return be32toh(ofh_table_features->config); };
181 set_config(uint32_t config) { ofh_table_features->config = htobe32(config); };
187 get_max_entries()
const {
return be32toh(ofh_table_features->max_entries); };
193 set_max_entries(uint32_t max_entries) { ofh_table_features->max_entries = htobe32(max_entries); };
199 get_properties()
const {
return table_feature_props; };
205 set_properties() {
return table_feature_props; };
211 os <<
indent(0) <<
"<coftable_features >" << std::endl;
212 os <<
indent(2) <<
"<table-id: " << (int)msg.get_table_id() <<
" >" << std::endl;
213 os <<
indent(2) <<
"<name: " << msg.get_name() <<
" >" << std::endl;
215 os <<
indent(2) <<
"<metadata-match: 0x"<< (
unsigned long long)msg.get_metadata_match() <<
" >" << std::endl;
216 os <<
indent(2) <<
"<metadata-write: 0x"<< (
unsigned long long)msg.get_metadata_write() <<
" >" << std::endl;
217 os <<
indent(2) <<
"<config: 0x" << (
unsigned int)msg.get_config() <<
" >" << std::endl;
218 os <<
indent(2) <<
"<max-entries: 0x" << (
unsigned int)msg.get_max_entries() <<
" >" << std::endl;
221 os << msg.get_properties();
Definition: coftablefeatures.h:23
Definition: coftablefeatures.h:24
Definition: coftablefeatures.h:26
Definition: openflow13.h:1274
Definition: coftablefeatureprops.h:29
void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatures.cc:87
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatures.cc:64
Definition: coftablefeatures.h:22
Definition: croflexception.h:27