1 #ifndef OF10OPENFLOW_COMMON_H
2 #define OF10OPENFLOW_COMMON_H 1
6 #include "fluid/util/util.h"
7 #include "fluid/ofcommon/common.hh"
8 #include "openflow-10.h"
9 #include "of10action.hh"
10 #include "of10match.hh"
24 uint32_t config, uint32_t state, uint32_t curr, uint32_t advertised,
25 uint32_t supported, uint32_t peer);
28 bool operator==(
const Port &other)
const;
29 bool operator!=(
const Port &other)
const;
30 size_t pack(uint8_t* buffer);
31 of_error unpack(uint8_t* buffer);
32 void port_no(uint16_t port_no) {
33 this->port_no_ = port_no;
36 return this->port_no_;
52 size_t pack(uint8_t* buffer);
53 of_error unpack(uint8_t* buffer);
65 size_t pack(uint8_t* buffer);
66 of_error unpack(uint8_t* buffer);
76 FlowStats(uint8_t table_id, uint32_t duration_sec, uint32_t duration_nsec,
77 uint16_t priority, uint16_t idle_timeout, uint16_t hard_timeout,
78 uint64_t cookie, uint64_t packet_count, uint64_t byte_count);
79 FlowStats(uint8_t table_id, uint32_t duration_sec, uint32_t duration_nsec,
80 uint16_t priority, uint16_t idle_timeout, uint16_t hard_timeout,
81 uint64_t cookie, uint64_t packet_count, uint64_t byte_count,
86 bool operator==(
const FlowStats &other)
const;
87 bool operator!=(
const FlowStats &other)
const;
88 size_t pack(uint8_t* buffer);
89 of_error unpack(uint8_t* buffer);
94 return this->actions_;
101 void add_action(
Action &action);
102 void add_action(
Action* action);
109 uint32_t max_entries_;
114 TableStats(uint8_t table_id, std::string name, uint32_t wildcards,
115 uint32_t max_entries, uint32_t active_count, uint64_t lookup_count,
116 uint64_t matched_count);
120 bool operator==(
const TableStats &other)
const;
121 bool operator!=(
const TableStats &other)
const;
122 size_t pack(uint8_t* buffer);
123 of_error unpack(uint8_t* buffer);
127 uint32_t wildcards() {
128 return this->wildcards_;
130 uint32_t max_entries() {
131 return this->max_entries_;
133 void name(std::string name) {
136 void wildcards(uint32_t wildcards) {
137 this->wildcards_ = wildcards;
139 void max_entries(uint32_t max_entries) {
140 this->max_entries_ = max_entries;
156 bool operator==(
const PortStats &other)
const;
157 bool operator!=(
const PortStats &other)
const;
158 size_t pack(uint8_t* buffer);
159 of_error unpack(uint8_t* buffer);
161 return this->port_no_;
163 void port_no(uint16_t port_no) {
164 this->port_no_ = port_no;
175 QueueStats(uint16_t port_no, uint32_t queue_id, uint64_t tx_bytes,
176 uint64_t tx_packets, uint64_t tx_errors);
180 bool operator==(
const QueueStats &other)
const;
181 bool operator!=(
const QueueStats &other)
const;
182 size_t pack(uint8_t* buffer);
183 of_error unpack(uint8_t* buffer);
185 return this->port_no_;
187 void port_no(uint16_t port_no) {
188 this->port_no_ = port_no;