8 #ifndef COFTABLESTATS_H_
9 #define COFTABLESTATS_H_ 1
11 #include "rofl/common/cmemory.h"
12 #include "rofl/common/openflow/openflow.h"
13 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
32 uint32_t write_actions;
33 uint32_t apply_actions;
34 uint64_t write_setfields;
35 uint64_t apply_setfields;
36 uint64_t metadata_match;
37 uint64_t metadata_write;
38 uint32_t instructions;
41 uint32_t active_count;
42 uint64_t lookup_count;
43 uint64_t matched_count;
51 uint8_t of_version = 0);
62 uint32_t active_count,
63 uint64_t lookup_count,
64 uint64_t matched_count);
75 uint32_t write_actions,
76 uint32_t apply_actions,
77 uint64_t write_setfields,
78 uint64_t apply_setfields,
79 uint64_t metadata_match,
80 uint64_t metadata_write,
81 uint32_t instructions,
84 uint32_t active_count,
85 uint64_t lookup_count,
86 uint64_t matched_count);
94 uint32_t active_count,
95 uint64_t lookup_count,
96 uint64_t matched_count);
136 set_version(uint8_t of_version);
150 get_table_id()
const;
156 set_table_id(uint8_t table_id);
168 set_name(std::string
const& name);
180 set_match(uint64_t match);
186 get_wildcards()
const;
192 set_wildcards(uint64_t wildcards);
198 get_write_actions()
const;
204 set_write_actions(uint32_t write_actions);
210 get_apply_actions()
const;
216 set_apply_actions(uint32_t apply_actions);
222 get_write_setfields()
const;
228 set_write_setfields(uint64_t write_setfields);
234 get_apply_setfields()
const;
240 set_apply_setfields(uint64_t apply_setfields);
246 get_metadata_match()
const;
252 set_metadata_match(uint64_t metadata_match);
258 get_metadata_write()
const;
264 set_metadata_write(uint64_t metadata_write);
270 get_instructions()
const;
276 set_instructions(uint32_t instructions);
282 set_config(uint32_t config);
294 set_max_entries(uint32_t max_entries);
300 get_max_entries()
const;
306 set_active_count(uint32_t active_count);
312 get_active_count()
const;
318 set_lookup_count(uint64_t lookup_count);
324 get_lookup_count()
const;
330 set_matched_count(uint64_t matched_count);
336 get_matched_count()
const;
342 pack(uint8_t *buf,
size_t buflen)
const;
348 unpack(uint8_t *buf,
size_t buflen);
354 switch (tsr.of_version) {
355 case rofl::openflow10::OFP_VERSION: {
356 os <<
indent(0) <<
"<coftable_stats_reply ";
357 os <<
"table-id:" << (int)(tsr.table_id) <<
" ";
358 os <<
"name:" << tsr.name <<
" ";
360 os <<
"match: 0x" << (
unsigned long long)tsr.match <<
" ";
361 os <<
"wildcards: 0x" << (
unsigned long long)tsr.wildcards <<
" >" << std::endl;
363 os <<
indent(2) <<
"<max_entries: 0x" << (
unsigned int)tsr.max_entries <<
" ";
364 os <<
"active-count: 0x" << (
unsigned int)tsr.active_count <<
" ";
365 os <<
"lookup-count: 0x" << (
unsigned long long)tsr.lookup_count <<
" ";
366 os <<
"matched-count: 0x" << (
unsigned long long)tsr.matched_count <<
" ";
368 os <<
">" << std::endl;
370 case rofl::openflow12::OFP_VERSION: {
371 os <<
indent(0) <<
"<coftable_stats_reply ";
372 os <<
"table-id:" << (int)(tsr.table_id) <<
" ";
373 os <<
"name:" << tsr.name <<
" ";
375 os <<
"match: 0x" << (
unsigned long long)tsr.match <<
" ";
376 os <<
"wildcards: 0x" << (
unsigned long long)tsr.wildcards <<
" >" << std::endl;
377 os <<
indent(2) <<
"<write-actions: 0x" << (
unsigned int)tsr.write_actions <<
" ";
378 os <<
"apply-actions: 0x" << (
unsigned int)tsr.apply_actions <<
" ";
379 os <<
"write-setfields: 0x" << (
unsigned long long)tsr.write_setfields <<
" ";
380 os <<
"apply-setfields: 0x" << (
unsigned long long)tsr.apply_setfields <<
" >" << std::endl;;
381 os <<
indent(2) <<
"<metadata-match: 0x" << (
unsigned long long)tsr.metadata_match <<
" ";
382 os <<
"metadata-write: 0x" << (
unsigned long long)tsr.metadata_write <<
" ";
383 os <<
"instructions: 0x" << (
unsigned int)tsr.instructions <<
" ";
385 os <<
"config:" << (
unsigned int)tsr.config <<
" >" << std::endl;;
386 os <<
indent(2) <<
"<max_entries:" << (
unsigned int)tsr.max_entries <<
" ";
387 os <<
"active-count:" << (
unsigned int)tsr.active_count <<
" ";
388 os <<
"lookup-count:" << (
unsigned long long)tsr.lookup_count <<
" ";
389 os <<
"matched-count:" << (
unsigned long long)tsr.matched_count <<
" >" << std::endl;
391 case rofl::openflow13::OFP_VERSION: {
392 os <<
indent(0) <<
"<coftable_stats_reply ofp-version:" << (int)tsr.of_version <<
" >" << std::endl;
394 os <<
indent(2) <<
"<table-id: 0x" << (int)(tsr.table_id) <<
" >" << std::endl;
395 os <<
indent(2) <<
"<active-count: 0x" << (
unsigned int)tsr.active_count <<
" >" << std::endl;
396 os <<
indent(2) <<
"<lookup-count: 0x" << (
unsigned long long)tsr.lookup_count <<
" >" << std::endl;
397 os <<
indent(2) <<
"<matched-count: 0x" << (
unsigned long long)tsr.matched_count <<
" >" << std::endl;
401 os <<
indent(0) <<
"<coftable_stats_reply >";
Definition: coftablestats.h:19
Definition: coftablestats.h:18
Definition: coftablestats.h:20
Definition: coftablestats.h:22
Definition: croflexception.h:27