4 #include "fluid/ofcommon/msg.hh"
5 #include "of13/of13common.hh"
6 #include "of13/of13action.hh"
7 #include "of13/of13meter.hh"
17 uint64_t generation_id_;
20 RoleCommon(uint8_t version, uint8_t type, uint32_t xid, uint32_t role,
21 uint64_t generation_id);
24 bool operator==(
const RoleCommon &other)
const;
25 bool operator!=(
const RoleCommon &other)
const;
27 of_error unpack(uint8_t *buffer);
31 uint64_t generation_id() {
32 return this->generation_id_;
34 void role(uint32_t role) {
37 void generation_id(uint64_t generation_id) {
38 this->generation_id_ = generation_id;
47 std::vector<uint32_t> packet_in_mask_;
48 std::vector<uint32_t> port_status_mask_;
49 std::vector<uint32_t> flow_removed_mask_;
54 std::vector<uint32_t> packet_in_mask,
55 std::vector<uint32_t> port_status_mask,
56 std::vector<uint32_t> flow_removed_mask);
62 of_error unpack(uint8_t *buffer);
64 uint32_t master_equal_packet_in_mask() {
65 return this->packet_in_mask_[0];
67 uint32_t master_equal_port_status_mask() {
68 return this->port_status_mask_[0];
70 uint32_t master_equal_flow_removed_mask() {
71 return this->port_status_mask_[0];
73 uint32_t slave_packet_in_mask() {
74 return this->packet_in_mask_[1];
76 uint32_t slave_port_status_mask() {
77 return this->port_status_mask_[1];
79 uint32_t slave_flow_removed_mask() {
80 return this->port_status_mask_[1];
82 void master_equal_packet_in_mask(uint32_t mask) {
83 this->packet_in_mask_[0] = mask;
85 void master_equal_port_status_mask(uint32_t mask) {
86 this->port_status_mask_[0] = mask;
88 void master_equal_flow_removed_mask(uint32_t mask) {
89 this->port_status_mask_[0] = mask;
91 void slave_packet_in_mask(uint32_t mask) {
92 this->packet_in_mask_[1] = mask;
94 void slave_port_status_mask(uint32_t mask) {
95 this->port_status_mask_[1] = mask;
97 void slave_flow_removed_mask(uint32_t mask) {
98 this->port_status_mask_[1] = mask;
112 std::list<HelloElemVersionBitmap> elements_;
116 Hello(uint32_t xid, std::list<HelloElemVersionBitmap> elements);
119 bool operator==(
const Hello &other)
const;
120 bool operator!=(
const Hello &other)
const;
122 of_error unpack(uint8_t* buffer);
123 std::list<HelloElemVersionBitmap> elements() {
124 return this->elements_;
126 void elements(std::list<HelloElemVersionBitmap> elements);
128 uint32_t elements_len();
137 Error(uint32_t xid, uint16_t err_type, uint16_t code);
138 Error(uint32_t xid, uint16_t err_type, uint16_t code, uint8_t *data,
172 uint32_t experimenter_;
176 Experimenter(uint32_t xid, uint32_t experimenter, uint32_t exp_type);
182 of_error unpack(uint8_t *buffer);
183 uint32_t experimenter() {
184 return this->experimenter_;
186 uint32_t exp_type() {
187 return this->exp_type_;
201 of_error unpack(uint8_t* buffer);
208 uint8_t auxiliary_id_;
211 FeaturesReply(uint32_t xid, uint64_t datapath_id, uint32_t n_buffers,
212 uint8_t n_tables, uint8_t auxiliary_id, uint32_t capabilities);
218 of_error unpack(uint8_t *buffer);
219 uint8_t auxiliary_id() {
220 return this->auxiliary_id_;
222 void auxiliary_id(uint8_t auxiliary_id) {
223 this->auxiliary_id_ = auxiliary_id;
238 of_error unpack(uint8_t* buffer);
247 GetConfigReply(uint32_t xid, uint16_t flags, uint16_t miss_send_len);
259 SetConfig(uint32_t xid, uint16_t flags, uint16_t miss_send_len);
273 PacketOut(uint32_t xid, uint32_t buffer_id, uint32_t in_port);
274 bool operator==(
const PacketOut &other)
const;
275 bool operator!=(
const PacketOut &other)
const;
277 of_error unpack(uint8_t *buffer);
279 return this->in_port_;
281 void in_port(uint32_t in_port) {
282 this->in_port_ = in_port;
296 PacketIn(uint32_t xid, uint32_t buffer_id, uint16_t total_len,
297 uint8_t reason, uint8_t table_id, uint64_t cookie);
301 virtual uint16_t length();
302 bool operator==(
const PacketIn &other)
const;
303 bool operator!=(
const PacketIn &other)
const;
305 of_error unpack(uint8_t *buffer);
307 return this->table_id_;
310 return this->cookie_;
316 OXMTLV * get_oxm_field(uint8_t field);
317 void table_id(uint8_t table_id) {
318 this->table_id_ = table_id;
320 void cookie(uint64_t cookie) {
321 this->cookie_ = cookie;
323 void add_oxm_field(
OXMTLV &field);
324 void add_oxm_field(
OXMTLV *field);
333 uint64_t cookie_mask_;
341 FlowMod(uint32_t xid, uint64_t cookie, uint64_t cookie_mask,
342 uint8_t table_id, uint8_t command, uint16_t idle_timeout,
343 uint16_t hard_timeout, uint16_t priority, uint32_t buffer_id,
344 uint32_t out_port, uint32_t out_group, uint16_t flags);
347 bool operator==(
const FlowMod &other)
const;
348 bool operator!=(
const FlowMod &other)
const;
350 of_error unpack(uint8_t *buffer);
351 virtual uint16_t length();
353 return this->command_;
355 uint64_t cookie_mask() {
356 return this->cookie_mask_;
359 return this->table_id_;
361 uint32_t out_port() {
362 return this->out_port_;
364 uint32_t out_group() {
365 return this->out_group_;
370 OXMTLV * get_oxm_field(uint8_t field);
371 void command(uint8_t command){
372 this->command_ = command;
374 void cookie_mask(uint64_t cookie_mask) {
375 this->cookie_mask_ = cookie_mask;
377 void table_id(uint8_t table_id) {
378 this->table_id_ = table_id;
380 void out_port(uint32_t out_port) {
381 this->out_port_ = out_port;
383 void out_group(uint32_t out_group) {
384 this->out_group_ = out_group;
387 void add_oxm_field(
OXMTLV &field);
388 void add_oxm_field(
OXMTLV *field);
400 uint16_t hard_timeout_;
404 FlowRemoved(uint32_t xid, uint64_t cookie, uint16_t priority,
405 uint8_t reason, uint8_t table_id, uint32_t duration_sec,
406 uint32_t duration_nsec, uint16_t idle_timeout, uint16_t hard_timeout,
407 uint64_t packet_count, uint64_t byte_count);
408 FlowRemoved(uint32_t xid, uint64_t cookie, uint16_t priority,
409 uint8_t reason, uint8_t table_id, uint32_t duration_sec,
410 uint32_t duration_nsec, uint16_t idle_timeout, uint16_t hard_timeout,
411 uint64_t packet_count, uint64_t byte_count,
of13::Match);
414 virtual uint16_t length();
418 of_error unpack(uint8_t *buffer);
420 return this->table_id_;
422 uint16_t hard_timeout() {
423 return this->hard_timeout_;
425 void table_id(uint8_t table_id) {
426 this->table_id_ = table_id;
428 void hard_timeout(uint16_t hard_timeout) {
429 this->hard_timeout_ = hard_timeout;
435 this->match_ = match;
450 bool operator==(
const PortStatus &other)
const;
451 bool operator!=(
const PortStatus &other)
const;
453 of_error unpack(uint8_t *buffer);
471 uint32_t mask, uint32_t advertise);
474 bool operator==(
const PortMod &other)
const;
475 bool operator!=(
const PortMod &other)
const;
477 of_error unpack(uint8_t *buffer);
479 return this->port_no_;
481 void port_no(uint32_t port_no) {
482 this->port_no_ = port_no;
494 std::vector<Bucket> buckets_;
497 GroupMod(uint32_t xid, uint16_t command, uint8_t type, uint32_t group_id);
498 GroupMod(uint32_t xid, uint16_t command, uint8_t type, uint32_t group_id,
499 std::vector<Bucket> buckets);
502 bool operator==(
const GroupMod &other)
const;
503 bool operator!=(
const GroupMod &other)
const;
505 of_error unpack(uint8_t *buffer);
507 return this->command_;
512 uint32_t group_id() {
513 return this->group_id_;
515 std::vector<Bucket> buckets() {
516 return this->buckets_;
518 void commmand(uint16_t command) {
519 this->command_ = command;
521 void group_type(uint8_t type) {
522 this->group_type_ = type;
524 void group_id(uint32_t group_id) {
525 this->group_id_ = group_id;
527 void buckets(std::vector<Bucket> buckets);
528 void add_bucket(
Bucket bucket);
529 size_t buckets_len();
541 TableMod(uint32_t xid, uint8_t table_id, uint32_t config);
544 bool operator==(
const TableMod &other)
const;
545 bool operator!=(
const TableMod &other)
const;
547 of_error unpack(uint8_t *buffer);
549 return this->table_id_;
552 return this->config_;
554 void table_id(uint8_t table_id) {
555 this->table_id_ = table_id;
557 void config(uint32_t config) {
558 this->config_ = config;
568 uint16_t mpart_type_;
579 of_error unpack(uint8_t *buffer);
580 uint16_t mpart_type() {
581 return this->mpart_type_;
586 void type(uint16_t type) {
587 this->mpart_type_ = type;
589 void flags(uint16_t flags) {
590 this->flags_ = flags;
600 uint16_t mpart_type_;
611 of_error unpack(uint8_t *buffer);
612 uint16_t mpart_type() {
613 return this->mpart_type_;
618 void type(uint16_t type) {
619 this->mpart_type_ = type;
621 void flags(uint16_t flags) {
622 this->flags_ = flags;
636 of_error unpack(uint8_t *buffer);
649 std::string hw_desc, std::string sw_desc, std::string serial_num,
650 std::string dp_desc);
656 of_error unpack(uint8_t *buffer);
674 uint64_t cookie_mask_;
679 uint32_t out_port, uint32_t out_group, uint64_t cookie,
680 uint64_t cookie_mask);
682 uint32_t out_port, uint32_t out_group, uint64_t cookie,
689 of_error unpack(uint8_t *buffer);
694 return this->table_id_;
696 uint32_t out_port() {
697 return this->out_port_;
699 uint32_t out_group() {
700 return this->out_group_;
703 return this->cookie_;
705 uint64_t cookie_mask() {
706 return this->cookie_mask_;
709 void add_oxm_field(
OXMTLV &field);
710 void add_oxm_field(
OXMTLV* field);
711 void table_id(uint8_t table_id) {
712 this->table_id_ = table_id;
714 void out_port(uint16_t out_port) {
715 this->out_port_ = out_port;
717 void out_group(uint32_t out_group) {
718 this->out_group_ = out_group;
720 void cookie(uint64_t cookie) {
721 this->cookie_ = cookie;
723 void cookie_mask(uint64_t cookie_mask) {
724 this->cookie_mask_ = cookie_mask;
733 std::vector<of13::FlowStats> flow_stats_;
738 std::vector<of13::FlowStats> flow_stats);
744 of_error unpack(uint8_t *buffer);
745 std::vector<of13::FlowStats> flow_stats() {
746 return this->flow_stats_;
748 void flow_stats(std::vector<of13::FlowStats> flow_stats);
761 uint64_t cookie_mask_;
766 uint32_t out_port, uint32_t out_group, uint64_t cookie,
767 uint64_t cookie_mask);
769 uint32_t out_port, uint32_t out_group, uint64_t cookie,
773 virtual uint16_t length();
777 of_error unpack(uint8_t *buffer);
782 return this->table_id_;
784 uint32_t out_port() {
785 return this->out_port_;
787 uint32_t out_group() {
788 return this->out_group_;
791 return this->cookie_;
793 uint64_t cookie_mask() {
794 return this->cookie_mask_;
797 void add_oxm_field(
OXMTLV &field);
798 void add_oxm_field(
OXMTLV *field);
799 void table_id(uint8_t table_id) {
800 this->table_id_ = table_id;
802 void out_port(uint16_t out_port) {
803 this->out_port_ = out_port;
805 void out_group(uint32_t out_group) {
806 this->out_group_ = out_group;
808 void cookie(uint64_t cookie) {
809 this->cookie_ = cookie;
811 void cookie_mask(uint64_t cookie_mask) {
812 this->cookie_mask_ = cookie_mask;
821 uint64_t packet_count_;
822 uint64_t byte_count_;
823 uint32_t flow_count_;
827 uint64_t byte_count, uint32_t flow_count);
833 of_error unpack(uint8_t *buffer);
834 uint64_t packet_count() {
835 return this->packet_count_;
837 uint64_t byte_count() {
838 return this->byte_count_;
840 uint32_t flow_count() {
841 return this->flow_count_;
843 void packet_count(uint64_t packet_count) {
844 this->packet_count_ = packet_count;
846 void byte_count(uint64_t byte_count) {
847 this->byte_count_ = byte_count;
849 void flow_count(uint32_t flow_count) {
850 this->flow_count_ = flow_count;
865 of_error unpack(uint8_t *buffer);
873 std::vector<of13::TableStats> table_stats_;
878 std::vector<of13::TableStats> table_stats);
884 of_error unpack(uint8_t *buffer);
885 std::vector<of13::TableStats> table_stats() {
886 return this->table_stats_;
888 void table_stats(std::vector<of13::TableStats> table_stats);
906 of_error unpack(uint8_t *buffer);
908 return this->port_no_;
910 void port_no(uint32_t port_no) {
911 this->port_no_ = port_no;
920 std::vector<of13::PortStats> port_stats_;
925 std::vector<of13::PortStats> port_stats);
931 of_error unpack(uint8_t *buffer);
932 std::vector<of13::PortStats> port_stats() {
933 return this->port_stats_;
935 void port_stats(std::vector<of13::PortStats> port_stats);
955 of_error unpack(uint8_t *buffer);
957 return this->port_no_;
959 uint32_t queue_id() {
960 return this->queue_id_;
962 void port_no(uint32_t port_no) {
963 this->port_no_ = port_no;
965 void queue_id(uint32_t queue_id) {
966 this->queue_id_ = queue_id;
975 std::vector<of13::QueueStats> queue_stats_;
980 std::vector<of13::QueueStats> queue_stats);
986 of_error unpack(uint8_t *buffer);
987 std::vector<of13::QueueStats> queue_stats() {
988 return this->queue_stats_;
990 void queue_stats(std::vector<of13::QueueStats> queue_stats_);
1008 of_error unpack(uint8_t *buffer);
1009 uint32_t group_id() {
1010 return this->group_id_;
1012 void group_id(uint32_t group_id) {
1013 this->group_id_ = group_id;
1022 std::vector<of13::GroupStats> group_stats_;
1027 std::vector<of13::GroupStats> group_stats);
1033 of_error unpack(uint8_t *buffer);
1034 std::vector<of13::GroupStats> queue_stats() {
1035 return this->group_stats_;
1037 void group_stats(std::vector<of13::GroupStats> group_stats);
1039 size_t group_stats_len();
1052 of_error unpack(uint8_t *buffer);
1060 std::vector<of13::GroupDesc> group_desc_;
1065 std::vector<of13::GroupDesc> group_desc);
1071 of_error unpack(uint8_t *buffer);
1072 std::vector<of13::GroupDesc> queue_stats() {
1073 return this->group_desc_;
1075 void group_desc(std::vector<of13::GroupDesc> group_desc);
1090 of_error unpack(uint8_t *buffer);
1108 of_error unpack(uint8_t *buffer);
1110 return this->features_;
1113 this->features_ = features;
1131 of_error unpack(uint8_t *buffer);
1132 uint32_t meter_id() {
1133 return this->meter_id_;
1135 void meter_id(uint32_t meter_id) {
1136 this->meter_id_ = meter_id;
1145 std::vector<of13::MeterStats> meter_stats_;
1150 std::vector<of13::MeterStats> meter_stats);
1156 of_error unpack(uint8_t *buffer);
1157 std::vector<of13::MeterStats> meter_stats() {
1158 return this->meter_stats_;
1160 void meter_stats(std::vector<of13::MeterStats> meter_stats);
1162 size_t meter_stats_len();
1175 of_error unpack(uint8_t *buffer);
1182 std::vector<MeterConfig> meter_config_;
1187 std::vector<MeterConfig> meter_config);
1193 of_error unpack(uint8_t *buffer);
1194 std::vector<MeterConfig> meter_config() {
1195 return this->meter_config_;
1197 void meter_config(std::vector<MeterConfig> meter_config);
1199 size_t meter_config_len();
1212 of_error unpack(uint8_t *buffer);
1230 of_error unpack(uint8_t *buffer);
1232 return this->meter_features_;
1235 this->meter_features_ = meter_features;
1244 std::vector<TableFeatures> tables_features_;
1249 std::vector<TableFeatures> table_features);
1255 of_error unpack(uint8_t *buffer);
1256 std::vector<TableFeatures> tables_features() {
1257 return this->tables_features_;
1259 void tables_features(std::vector<TableFeatures> tables_features);
1268 std::vector<TableFeatures> tables_features_;
1273 std::vector<TableFeatures> table_features);
1279 of_error unpack(uint8_t *buffer);
1280 std::vector<TableFeatures> table_features() {
1281 return this->tables_features_;
1283 void tables_features(std::vector<TableFeatures> tables_features);
1297 of_error unpack(uint8_t *buffer);
1305 std::vector<of13::Port> ports_;
1310 std::vector<of13::Port> ports);
1316 of_error unpack(uint8_t *buffer);
1317 std::vector<of13::Port> ports() {
1318 return this->ports_;
1320 void ports(std::vector<of13::Port> ports);
1330 uint32_t experimenter_;
1335 uint32_t experimenter, uint32_t exp_type);
1341 of_error unpack(uint8_t *buffer);
1342 uint32_t experimenter() {
1343 return this->experimenter_;
1345 uint32_t exp_type() {
1346 return this->exp_type_;
1356 uint32_t experimenter_;
1361 uint32_t experimenter, uint32_t exp_type);
1367 of_error unpack(uint8_t *buffer);
1368 uint32_t experimenter() {
1369 return this->experimenter_;
1371 uint32_t exp_type() {
1372 return this->exp_type_;
1386 of_error unpack(uint8_t* buffer);
1398 of_error unpack(uint8_t* buffer);
1415 of_error unpack(uint8_t *buffer);
1419 void port(uint32_t port) {
1430 std::list<of13::PacketQueue> queues_;
1435 std::list<of13::PacketQueue> queues);
1441 of_error unpack(uint8_t *buffer);
1445 std::list<of13::PacketQueue> queues() {
1446 return this->queues_;
1448 void port(uint32_t port) {
1451 void queues(std::list<of13::PacketQueue> queues);
1453 size_t queues_len();
1462 RoleRequest(uint32_t xid, uint32_t role, uint64_t generation_id);
1473 RoleReply(uint32_t xid, uint32_t role, uint64_t generation_id);
1488 of_error unpack(uint8_t* buffer);
1498 GetAsyncReply(uint32_t xid, std::vector<uint32_t> packet_in_mask,
1499 std::vector<uint32_t> port_status_mask,
1500 std::vector<uint32_t> flow_removed_mask);
1512 SetAsync(uint32_t xid, std::vector<uint32_t> packet_in_mask,
1513 std::vector<uint32_t> port_status_mask,
1514 std::vector<uint32_t> flow_removed_mask);
1528 MeterMod(uint32_t xid, uint16_t command, uint16_t flags, uint32_t meter_id);
1529 MeterMod(uint32_t xid, uint16_t command, uint16_t flags, uint32_t meter_id,
1533 bool operator==(
const MeterMod &other)
const;
1534 bool operator!=(
const MeterMod &other)
const;
1536 of_error unpack(uint8_t *buffer);
1537 uint16_t command() {
1538 return this->command_;
1541 return this->flags_;
1543 uint32_t meter_id() {
1544 return this->meter_id_;
1547 return this->bands_;
1549 void command(uint16_t command) {
1550 this->command_ = command;
1552 void flags(uint16_t flags) {
1553 this->flags_ = flags;
1555 void meter_id(uint32_t meter_id) {
1556 this->meter_id_ = meter_id;