4 #include "fluid/ofcommon/msg.hh"
5 #include "of10/of10common.hh"
6 #include "of10/of10action.hh"
28 of_error unpack(uint8_t *buffer);
37 Error(uint32_t xid, uint16_t err_type, uint16_t code);
38 Error(uint32_t xid, uint16_t err_type, uint16_t code, uint8_t *data,
50 :
EchoCommon(of10::OFP_VERSION, of10::OFPT_ECHO_REQUEST) {
63 :
EchoCommon(of10::OFP_VERSION, of10::OFPT_ECHO_REPLY) {
79 Vendor(uint32_t xid, uint32_t vendor);
83 of_error unpack(uint8_t *buffer);
87 void vendor(uint32_t vendor) {
88 this->vendor_ = vendor;
102 of_error unpack(uint8_t *buffer);
111 std::vector<of10::Port> ports_;
114 FeaturesReply(uint32_t xid, uint64_t datapath_id, uint32_t n_buffers,
115 uint8_t n_tables, uint32_t capabilities, uint32_t actions);
116 FeaturesReply(uint32_t xid, uint64_t datapath_id, uint32_t n_buffers,
117 uint8_t n_tables, uint32_t capabilities, uint32_t actions,
118 std::vector<of10::Port> ports);
124 of_error unpack(uint8_t *buffer);
126 return this->actions_;
128 std::vector<of10::Port> ports() {
131 void actions(uint32_t actions) {
132 this->actions_ = actions;
134 void ports(std::vector<of10::Port> ports);
135 size_t ports_length();
149 of_error unpack(uint8_t *buffer);
158 GetConfigReply(uint32_t xid, uint16_t flags, uint16_t miss_send_len);
169 SetConfig(uint32_t xid, uint16_t flags, uint16_t miss_send_len);
185 FlowMod(uint32_t xid, uint64_t cookie, uint16_t command,
186 uint16_t idle_timeout, uint16_t hard_timeout, uint16_t priority,
187 uint32_t buffer_id, uint16_t out_port, uint16_t flags);
188 FlowMod(uint32_t xid, uint64_t cookie, uint16_t command,
189 uint16_t idle_timeout, uint16_t hard_timeout, uint16_t priority,
190 uint32_t buffer_id, uint16_t out_port, uint16_t flags,
192 FlowMod(uint32_t xid, uint64_t cookie, uint16_t command,
193 uint16_t idle_timeout, uint16_t hard_timeout, uint16_t priority,
194 uint32_t buffer_id, uint16_t out_port, uint16_t flags,
198 bool operator==(
const FlowMod &other)
const;
199 bool operator!=(
const FlowMod &other)
const;
201 of_error unpack(uint8_t *buffer);
203 return this->command_;
209 return this->actions_;
211 uint16_t out_port() {
212 return this->out_port_;
214 void command(uint16_t command){
215 this->command_ = command;
217 void out_port(uint16_t out_port) {
218 this->out_port_ = out_port;
221 this->match_ = match;
224 void add_action(
Action &action);
225 void add_action(
Action* action);
236 PacketOut(uint32_t xid, uint32_t buffer_id, uint16_t in_port);
239 bool operator==(
const PacketOut &other)
const;
240 bool operator!=(
const PacketOut &other)
const;
242 of_error unpack(uint8_t *buffer);
244 return this->in_port_;
246 void in_port(uint16_t in_port) {
247 this->in_port_ = in_port;
259 PacketIn(uint32_t xid, uint32_t buffer_id, uint16_t in_port,
260 uint16_t total_len, uint8_t reason);
263 bool operator==(
const PacketIn &other)
const;
264 bool operator!=(
const PacketIn &other)
const;
266 of_error unpack(uint8_t *buffer);
268 return this->in_port_;
270 void in_port(uint16_t in_port) {
271 this->in_port_ = in_port;
283 FlowRemoved(uint32_t xid, uint64_t cookie, uint16_t priority,
284 uint8_t reason, uint32_t duration_sec, uint32_t duration_nsec,
285 uint16_t idle_timeout, uint64_t packet_count, uint64_t byte_count);
286 FlowRemoved(uint32_t xid, uint64_t cookie, uint16_t priority,
287 uint8_t reason, uint32_t duration_sec, uint32_t duration_nsec,
288 uint16_t idle_timeout, uint64_t packet_count, uint64_t byte_count,
295 of_error unpack(uint8_t *buffer);
300 this->match_ = match;
315 bool operator==(
const PortStatus &other)
const;
316 bool operator!=(
const PortStatus &other)
const;
318 of_error unpack(uint8_t *buffer);
336 uint32_t mask, uint32_t advertise);
339 bool operator==(
const PortMod &other)
const;
340 bool operator!=(
const PortMod &other)
const;
342 of_error unpack(uint8_t *buffer);
344 return this->port_no_;
346 void port_no(uint16_t port_no) {
347 this->port_no_ = port_no;
357 uint16_t stats_type_;
362 StatsRequest(uint32_t xid, uint16_t type, uint16_t flags);
368 of_error unpack(uint8_t *buffer);
369 uint16_t stats_type() {
370 return this->stats_type_;
375 void stats_type(uint16_t type) {
376 this->stats_type_ = type;
378 void flags(uint16_t flags) {
379 this->flags_ = flags;
389 uint16_t stats_type_;
394 StatsReply(uint32_t xid, uint16_t type, uint16_t flags);
397 bool operator==(
const StatsReply &other)
const;
398 bool operator!=(
const StatsReply &other)
const;
400 of_error unpack(uint8_t *buffer);
401 uint16_t stats_type() {
402 return this->stats_type_;
407 void stats_type(uint16_t type) {
408 this->stats_type_ = type;
410 void flags(uint16_t flags) {
411 this->flags_ = flags;
425 of_error unpack(uint8_t *buffer);
437 StatsReplyDesc(uint32_t xid, uint16_t flags, std::string mfr_desc,
438 std::string hw_desc, std::string sw_desc, std::string serial_num,
439 std::string dp_desc);
445 of_error unpack(uint8_t *buffer);
465 uint8_t table_id, uint16_t out_port);
471 of_error unpack(uint8_t *buffer);
476 return this->table_id_;
478 uint16_t out_port() {
479 return this->out_port_;
482 this->match_ = match;
484 void table_id(uint8_t table_id) {
485 this->table_id_ = table_id;
487 void out_port(uint16_t out_port) {
488 this->out_port_ = out_port;
497 std::vector<of10::FlowStats> flow_stats_;
502 std::vector<of10::FlowStats> flow_stats);
508 of_error unpack(uint8_t *buffer);
509 std::vector<of10::FlowStats> flow_stats() {
510 return this->flow_stats_;
512 void flow_stats(std::vector<of10::FlowStats> flow_stats);
529 uint8_t table_id, uint16_t out_port);
535 of_error unpack(uint8_t *buffer);
540 return this->table_id_;
542 uint16_t out_port() {
543 return this->out_port_;
546 this->match_ = match;
548 void table_id(uint8_t table_id) {
549 this->table_id_ = table_id;
551 void out_port(uint16_t out_port) {
552 this->out_port_ = out_port;
561 uint64_t packet_count_;
562 uint64_t byte_count_;
563 uint32_t flow_count_;
567 uint64_t byte_count, uint32_t flow_count);
573 of_error unpack(uint8_t *buffer);
574 uint64_t packet_count() {
575 return this->packet_count_;
577 uint64_t byte_count() {
578 return this->byte_count_;
580 uint32_t flow_count() {
581 return this->flow_count_;
583 void packet_count(uint64_t packet_count) {
584 this->packet_count_ = packet_count;
586 void byte_count(uint64_t byte_count) {
587 this->byte_count_ = byte_count;
589 void flow_count(uint32_t flow_count) {
590 this->flow_count_ = flow_count;
604 of_error unpack(uint8_t *buffer);
612 std::vector<of10::TableStats> table_stats_;
617 std::vector<of10::TableStats> table_stats);
623 of_error unpack(uint8_t *buffer);
624 std::vector<of10::TableStats> table_stats() {
625 return this->table_stats_;
627 void table_stats(std::vector<of10::TableStats> table_stats);
645 of_error unpack(uint8_t *buffer);
647 return this->port_no_;
649 void port_no(uint16_t port_no) {
650 this->port_no_ = port_no;
659 std::vector<PortStats> port_stats_;
664 std::vector<of10::PortStats> port_stats);
670 of_error unpack(uint8_t *buffer);
671 std::vector<of10::PortStats> port_stats() {
672 return this->port_stats_;
674 void port_stats(std::vector<of10::PortStats> port_stats);
694 of_error unpack(uint8_t *buffer);
696 return this->port_no_;
698 uint32_t queue_id() {
699 return this->queue_id_;
701 void port_no(uint16_t port_no) {
702 this->port_no_ = port_no;
704 void queue_id(uint32_t queue_id) {
705 this->queue_id_ = queue_id;
714 std::vector<of10::QueueStats> queue_stats_;
719 std::vector<of10::QueueStats> queue_stats);
725 of_error unpack(uint8_t *buffer);
726 std::vector<of10::QueueStats> queue_stats() {
727 return this->queue_stats_;
729 void queue_stats(std::vector<of10::QueueStats> queue_stats_);
748 of_error unpack(uint8_t *buffer);
750 return this->vendor_;
752 void vendor(uint32_t vendor) {
753 this->vendor_ = vendor;
772 of_error unpack(uint8_t *buffer);
774 return this->vendor_;
776 void vendor(uint32_t vendor) {
777 this->vendor_ = vendor;
795 of_error unpack(uint8_t *buffer);
799 void port(uint16_t port) {
810 std::list<of10::PacketQueue> queues_;
815 std::list<of10::PacketQueue> queues);
821 of_error unpack(uint8_t *buffer);
825 std::list<of10::PacketQueue> queues() {
826 return this->queues_;
828 void port(uint32_t port) {
831 void queues(std::list<PacketQueue> queues);
846 of_error unpack(uint8_t* buffer);
858 of_error unpack(uint8_t* buffer);