Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofaction.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef COFACTION_H
6 #define COFACTION_H 1
7 
8 #include <vector>
9 #include <string>
10 #include <algorithm>
11 #include <endian.h>
12 #include <stdexcept>
13 #ifndef htobe16
14  #include "../endian_conversion.h"
15 #endif
16 
17 
18 #include "rofl/common/croflexception.h"
19 #include "rofl/common/cmemory.h"
20 #include "rofl/common/caddress.h"
21 #include "rofl/common/openflow/openflow_rofl_exceptions.h"
22 #include "rofl/common/openflow/coxmatch.h"
23 #include "rofl/common/openflow/coxmatch_output.h"
24 #include "rofl/common/logging.h"
25 #include "rofl/common/cindex.h"
26 
27 
28 namespace rofl {
29 namespace openflow {
30 
31 /* error classes */
32 class eActionBase : public RoflException {};
33 class eActionInval : public eActionBase {}; // invalid parameter
34 class eActionInvalType : public eActionBase {}; // invalid action type
35 class eActionNotFound : public eActionBase {};
36 
37 
38 class cofaction {
39 public:
40 
44  static std::ostream&
45  dump(
46  std::ostream& os, const cofaction& action);
47 
48 public:
49 
53  cofaction(
54  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
55  uint16_t type = 0) :
56  ofp_version(ofp_version),
57  type(type),
58  len(sizeof(struct rofl::openflow::ofp_action)) {};
59 
63  virtual
64  ~cofaction() {};
65 
69  cofaction(
70  const cofaction& action) { *this = action; };
71 
75  cofaction&
76  operator= (
77  const cofaction& action) {
78  if (this == &action)
79  return *this;
80  ofp_version = action.ofp_version;
81  type = action.type;
82  len = action.len;
83  return *this;
84  };
85 
89  virtual void
90  check_prerequisites() const {};
91 
92 public:
93 
97  uint8_t
98  get_version() const { return ofp_version; };
99 
103  void
104  set_version(uint8_t ofp_version) { this->ofp_version = ofp_version; };
105 
109  uint16_t
110  get_type() const { return type; };
111 
115  void
116  set_type(uint16_t type) { this->type = type; };
117 
121  uint16_t
122  get_length() const { return len; };
123 
127  void
128  set_length(uint16_t len) { this->len = len; };
129 
130 public:
131 
135  virtual size_t
136  length() const;
137 
141  virtual void
142  pack(
143  uint8_t* buf, size_t buflen);
144 
148  virtual void
149  unpack(
150  uint8_t* buf, size_t buflen);
151 
152 public:
153 
154  friend std::ostream&
155  operator<< (std::ostream& os, cofaction const& action) {
156  os << rofl::indent(0) << "<cofaction ";
157  os << "ofp-version:" << (int)action.get_version() << " ";
158  os << "type:0x" << std::hex << (int)action.get_type() << std::dec << " ";
159  os << "length:" << (int)action.get_length() << " ";
160  os << " >" << std::endl;
161  return os;
162  }
163 
165  uint16_t type;
166  public:
167  cofaction_find_by_type(uint16_t type) :
168  type(type) {};
169  bool operator() (const cofaction& action) {
170  return (action.get_type() == type);
171  };
172  bool operator() (const cofaction* action) {
173  return (action->get_type() == type);
174  };
175  bool operator() (const std::pair<cindex, cofaction*>& p) {
176  return (p.second->get_type() == type);
177  };
178  };
179 
180 private:
181 
182  uint8_t ofp_version;
183  uint16_t type;
184  uint16_t len;
185 };
186 
187 
188 
189 
190 class cofaction_output : public cofaction {
191 public:
192 
197  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
198  uint32_t port_no = 0,
199  uint16_t max_len = 128) :
200  cofaction(ofp_version, rofl::openflow::OFPAT_OUTPUT),
201  port_no(port_no),
202  max_len(max_len) {};
203 
207  virtual
208  ~cofaction_output() {};
209 
214  const cofaction_output& action) { *this = action; };
215 
220  operator= (
221  const cofaction_output& action) {
222  if (this == &action)
223  return *this;
224  cofaction::operator= (action);
225  port_no = action.port_no;
226  max_len = action.max_len;
227  return *this;
228  };
229 
233  virtual void
234  check_prerequisites() const;
235 
236 public:
237 
241  void
242  set_port_no(uint32_t port_no) { this->port_no = port_no; };
243 
247  uint32_t
248  get_port_no() const { return port_no; };
249 
253  void
254  set_max_len(uint16_t max_len) { this->max_len = max_len; };
255 
259  uint16_t
260  get_max_len() const { return max_len; };
261 
262 public:
263 
267  virtual size_t
268  length() const;
269 
273  virtual void
274  pack(
275  uint8_t* buf, size_t buflen);
276 
280  virtual void
281  unpack(
282  uint8_t* buf, size_t buflen);
283 
284 public:
285 
286  friend std::ostream&
287  operator<< (std::ostream& os, cofaction_output const& action) {
288  os << rofl::indent(0) << "<cofaction_output ";
289  os << std::hex;
290  os << "port-no: 0x" << (unsigned int)action.get_port_no() << " ";
291  os << "max-len: 0x" << (unsigned int)action.get_max_len() << " ";
292  os << std::dec;
293  os << ">" << std::endl;
294  rofl::indent i(2);
295  os << dynamic_cast<cofaction const&>( action );
296  return os;
297  };
298 
299 private:
300 
301  uint32_t port_no;
302  uint16_t max_len;
303 };
304 
305 
306 
307 /*
308  * old OF1.0 actions
309  */
310 
311 
312 
314 public:
315 
320  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
321  uint16_t vlan_vid = 0) :
322  cofaction(ofp_version, rofl::openflow::OFPAT_SET_VLAN_VID),
323  vlan_vid(vlan_vid) {};
324 
328  virtual
330 
335  const cofaction_set_vlan_vid& action) { *this = action; };
336 
341  operator= (
342  const cofaction_set_vlan_vid& action) {
343  if (this == &action)
344  return *this;
345  cofaction::operator= (action);
346  vlan_vid = action.vlan_vid;
347  return *this;
348  };
349 
350 
351 public:
352 
356  void
357  set_vlan_vid(uint16_t vlan_vid) { this->vlan_vid = vlan_vid; };
358 
362  uint16_t
363  get_vlan_vid() const { return vlan_vid; };
364 
365 public:
366 
370  virtual size_t
371  length() const;
372 
376  virtual void
377  pack(
378  uint8_t* buf, size_t buflen);
379 
383  virtual void
384  unpack(
385  uint8_t* buf, size_t buflen);
386 
387 public:
388 
389  friend std::ostream&
390  operator<< (std::ostream& os, cofaction_set_vlan_vid const& action) {
391  os << rofl::indent(0) << "<cofaction_set_vlan_vid ";
392  os << "vid:0x" << std::hex << (unsigned int)action.get_vlan_vid() << std::dec << " >" << std::endl;
393  rofl::indent i(2);
394  os << dynamic_cast<cofaction const&>( action );
395  return os;
396  };
397 
398 private:
399 
400  uint16_t vlan_vid;
401 };
402 
403 
404 
405 
406 
407 
409 public:
410 
415  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
416  uint8_t vlan_pcp = 0) :
417  cofaction(ofp_version, rofl::openflow::OFPAT_SET_VLAN_PCP),
418  vlan_pcp(vlan_pcp) {};
419 
423  virtual
425 
430  const cofaction_set_vlan_pcp& action) { *this = action; };
431 
436  operator= (
437  const cofaction_set_vlan_pcp& action) {
438  if (this == &action)
439  return *this;
440  cofaction::operator= (action);
441  vlan_pcp = action.vlan_pcp;
442  return *this;
443  };
444 
445 public:
446 
450  void
451  set_vlan_pcp(uint8_t vlan_pcp) { this->vlan_pcp = vlan_pcp; };
452 
456  uint8_t
457  get_vlan_pcp() const { return vlan_pcp; };
458 
459 public:
460 
464  virtual size_t
465  length() const;
466 
470  virtual void
471  pack(
472  uint8_t* buf, size_t buflen);
473 
477  virtual void
478  unpack(
479  uint8_t* buf, size_t buflen);
480 
481 public:
482 
483  friend std::ostream&
484  operator<< (std::ostream& os, cofaction_set_vlan_pcp const& action) {
485  os << rofl::indent(0) << "<cofaction_set_vlan_pcp ";
486  os << "pcp:ox" << std::hex << (unsigned int)action.get_vlan_pcp() << std::dec << " >" << std::endl;
487  rofl::indent i(2);
488  os << dynamic_cast<cofaction const&>( action );
489  return os;
490  };
491 
492 private:
493 
494  uint8_t vlan_pcp;
495 };
496 
497 
498 
499 
500 
501 
503 public:
504 
508  cofaction_strip_vlan(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
509  cofaction(ofp_version, rofl::openflow::OFPAT_STRIP_VLAN) {};
510 
514  virtual
515  ~cofaction_strip_vlan() {};
516 
521  const cofaction_strip_vlan& action) { *this = action; };
522 
527  operator= (
528  const cofaction_strip_vlan& action) {
529  if (this == &action)
530  return *this;
531  cofaction::operator= (action);
532  return *this;
533  };
534 
535 public:
536 
540  virtual size_t
541  length() const;
542 
546  virtual void
547  pack(
548  uint8_t* buf, size_t buflen);
549 
553  virtual void
554  unpack(
555  uint8_t* buf, size_t buflen);
556 
557 public:
558 
559  friend std::ostream&
560  operator<< (std::ostream& os, const cofaction_strip_vlan& action) {
561  os << rofl::indent(0) << "<cofaction_strip_vlan >" << std::endl;
562  rofl::indent i(2);
563  os << dynamic_cast<const cofaction&>( action );
564  return os;
565  };
566 };
567 
568 
569 
571 public:
572 
577  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
578  const rofl::cmacaddr& macaddr = rofl::cmacaddr("00:00:00:00:00:00")) :
579  cofaction(ofp_version, rofl::openflow::OFPAT_SET_DL_SRC),
580  macaddr(macaddr) {};
581 
585  virtual
586  ~cofaction_set_dl_src() {};
587 
592  const cofaction_set_dl_src& action) { *this = action; };
593 
598  operator= (
599  const cofaction_set_dl_src& action) {
600  if (this == &action)
601  return *this;
602  cofaction::operator= (action);
603  macaddr = action.macaddr;
604  return *this;
605  };
606 
607 public:
608 
612  const cmacaddr&
613  get_dl_src() const { return macaddr; };
614 
618  cmacaddr&
619  set_dl_src() { return macaddr; };
620 
624  void
625  set_dl_src(const cmacaddr& macaddr) { this->macaddr = macaddr; };
626 
627 public:
628 
632  virtual size_t
633  length() const;
634 
638  virtual void
639  pack(
640  uint8_t* buf, size_t buflen);
641 
645  virtual void
646  unpack(
647  uint8_t* buf, size_t buflen);
648 
649 public:
650 
651  friend std::ostream&
652  operator<< (std::ostream& os, const cofaction_set_dl_src& action) {
653  os << rofl::indent(0) << "<cofaction_set_dl_src macaddr:";
654  os << action.get_dl_src() << " >" << std::endl;
655  rofl::indent i(2);
656  os << dynamic_cast<cofaction const&>( action );
657  return os;
658  };
659 
660 private:
661 
662  rofl::cmacaddr macaddr;
663 };
664 
665 
666 
668 public:
669 
674  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
675  const rofl::cmacaddr& macaddr = rofl::cmacaddr("00:00:00:00:00:00")) :
676  cofaction(ofp_version, rofl::openflow::OFPAT_SET_DL_DST),
677  macaddr(macaddr) {};
678 
682  virtual
683  ~cofaction_set_dl_dst() {};
684 
689  const cofaction_set_dl_dst& action) { *this = action; };
690 
695  operator= (
696  const cofaction_set_dl_dst& action) {
697  if (this == &action)
698  return *this;
699  cofaction::operator= (action);
700  macaddr = action.macaddr;
701  return *this;
702  };
703 
704 public:
705 
709  const cmacaddr&
710  get_dl_dst() const { return macaddr; };
711 
715  cmacaddr&
716  set_dl_dst() { return macaddr; };
717 
721  void
722  set_dl_dst(const cmacaddr& macaddr) { this->macaddr = macaddr; };
723 
724 public:
725 
729  virtual size_t
730  length() const;
731 
735  virtual void
736  pack(
737  uint8_t* buf, size_t buflen);
738 
742  virtual void
743  unpack(
744  uint8_t* buf, size_t buflen);
745 
746 public:
747 
748  friend std::ostream&
749  operator<< (std::ostream& os, const cofaction_set_dl_dst& action) {
750  os << rofl::indent(0) << "<cofaction_set_dl_dst macaddr:";
751  os << action.get_dl_dst() << " >" << std::endl;
752  rofl::indent i(2);
753  os << dynamic_cast<cofaction const&>( action );
754  return os;
755  };
756 
757 private:
758 
759  rofl::cmacaddr macaddr;
760 };
761 
762 
763 
765 public:
766 
771  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
772  const rofl::caddress_in4& addr = rofl::caddress_in4("0.0.0.0")) :
773  cofaction(ofp_version, rofl::openflow::OFPAT_SET_NW_SRC),
774  addr(addr) {};
775 
779  virtual
780  ~cofaction_set_nw_src() {};
781 
786  const cofaction_set_nw_src& action) { *this = action; };
787 
792  operator= (
793  const cofaction_set_nw_src& action) {
794  if (this == &action)
795  return *this;
796  cofaction::operator= (action);
797  addr = action.addr;
798  return *this;
799  };
800 
801 
802 public:
803 
807  const caddress_in4&
808  get_nw_src() const { return addr; };
809 
813  caddress_in4&
814  set_nw_src() { return addr; };
815 
819  void
820  set_nw_src(const caddress_in4& addr) { this->addr = addr; };
821 
822 public:
823 
827  virtual size_t
828  length() const;
829 
833  virtual void
834  pack(
835  uint8_t* buf, size_t buflen);
836 
840  virtual void
841  unpack(
842  uint8_t* buf, size_t buflen);
843 
844 public:
845 
846  friend std::ostream&
847  operator<< (std::ostream& os, const cofaction_set_nw_src& action) {
848  os << rofl::indent(0) << "<cofaction_set_nw_src ";
849  os << "nw-src:" << action.get_nw_src() << " >" << std::endl;
850  rofl::indent i(2);
851  os << dynamic_cast<cofaction const&>( action );
852  return os;
853  };
854 
855 private:
856 
857  rofl::caddress_in4 addr;
858 };
859 
860 
861 
863 public:
864 
869  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
870  const rofl::caddress_in4& addr = rofl::caddress_in4("0.0.0.0")) :
871  cofaction(ofp_version, rofl::openflow::OFPAT_SET_NW_DST),
872  addr(addr) {};
873 
877  virtual
878  ~cofaction_set_nw_dst() {};
879 
884  const cofaction_set_nw_dst& action) { *this = action; };
885 
890  operator= (
891  const cofaction_set_nw_dst& action) {
892  if (this == &action)
893  return *this;
894  cofaction::operator= (action);
895  addr = action.addr;
896  return *this;
897  };
898 
899 
900 public:
901 
905  const caddress_in4&
906  get_nw_dst() const { return addr; };
907 
911  caddress_in4&
912  set_nw_dst() { return addr; };
913 
917  void
918  set_nw_dst(const caddress_in4& addr) { this->addr = addr; };
919 
920 public:
921 
925  virtual size_t
926  length() const;
927 
931  virtual void
932  pack(
933  uint8_t* buf, size_t buflen);
934 
938  virtual void
939  unpack(
940  uint8_t* buf, size_t buflen);
941 
942 public:
943 
944  friend std::ostream&
945  operator<< (std::ostream& os, const cofaction_set_nw_dst& action) {
946  os << rofl::indent(0) << "<cofaction_set_nw_dst ";
947  os << "nw-dst:" << action.get_nw_dst() << " >" << std::endl;
948  rofl::indent i(2);
949  os << dynamic_cast<cofaction const&>( action );
950  return os;
951  };
952 
953 private:
954 
955  rofl::caddress_in4 addr;
956 };
957 
958 
959 
960 
962 public:
963 
968  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
969  uint8_t nw_tos = 0) :
970  cofaction(ofp_version, rofl::openflow::OFPAT_SET_NW_TOS),
971  nw_tos(nw_tos) {};
972 
976  virtual
977  ~cofaction_set_nw_tos() {};
978 
983  const cofaction_set_nw_tos& action) { *this = action; };
984 
989  operator= (
990  const cofaction_set_nw_tos& action) {
991  if (this == &action)
992  return *this;
993  cofaction::operator= (action);
994  nw_tos = action.nw_tos;
995  return *this;
996  }
997 
998 public:
999 
1003  void
1004  set_nw_tos(uint8_t nw_tos) { this->nw_tos = nw_tos; };
1005 
1009  uint8_t
1010  get_nw_tos() const { return nw_tos; };
1011 
1012 public:
1013 
1017  virtual size_t
1018  length() const;
1019 
1023  virtual void
1024  pack(
1025  uint8_t* buf, size_t buflen);
1026 
1030  virtual void
1031  unpack(
1032  uint8_t* buf, size_t buflen);
1033 
1034 public:
1035 
1036  friend std::ostream&
1037  operator<< (std::ostream& os, cofaction_set_nw_tos const& action) {
1038  os << rofl::indent(0) << "<cofaction_set_nw_tos ";
1039  os << "nw-tos:0x" << std::hex << (unsigned int)action.get_nw_tos() << std::dec << " >" << std::endl;
1040  rofl::indent i(2);
1041  os << dynamic_cast<cofaction const&>( action );
1042  return os;
1043  };
1044 
1045 private:
1046 
1047  uint8_t nw_tos;
1048 };
1049 
1050 
1051 
1053 public:
1054 
1059  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1060  uint16_t tp_src = 0) :
1061  cofaction(ofp_version, rofl::openflow::OFPAT_SET_TP_SRC),
1062  tp_src(tp_src) {};
1063 
1067  virtual
1068  ~cofaction_set_tp_src() {};
1069 
1074  const cofaction_set_tp_src& action) { *this = action; };
1075 
1080  operator= (
1081  const cofaction_set_tp_src& action) {
1082  if (this == &action)
1083  return *this;
1084  cofaction::operator= (action);
1085  tp_src = action.tp_src;
1086  return *this;
1087  };
1088 
1089 public:
1090 
1094  void
1095  set_tp_src(uint16_t tp_src) { this->tp_src = tp_src; };
1096 
1100  uint16_t
1101  get_tp_src() const { return tp_src; };
1102 
1103 public:
1104 
1108  virtual size_t
1109  length() const;
1110 
1114  virtual void
1115  pack(
1116  uint8_t* buf, size_t buflen);
1117 
1121  virtual void
1122  unpack(
1123  uint8_t* buf, size_t buflen);
1124 
1125 public:
1126 
1127  friend std::ostream&
1128  operator<< (std::ostream& os, const cofaction_set_tp_src& action) {
1129  os << rofl::indent(0) << "<cofaction_set_tp_src ";
1130  os << "tp-src:" << (unsigned int)action.get_tp_src() << " >" << std::endl;
1131  rofl::indent i(2);
1132  os << dynamic_cast<cofaction const&>( action );
1133  return os;
1134  };
1135 
1136 private:
1137 
1138  uint16_t tp_src;
1139 };
1140 
1141 
1142 
1144 public:
1145 
1150  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1151  uint16_t tp_dst = 0) :
1152  cofaction(ofp_version, rofl::openflow::OFPAT_SET_TP_DST),
1153  tp_dst(tp_dst) {};
1154 
1158  virtual
1159  ~cofaction_set_tp_dst() {};
1160 
1165  const cofaction_set_tp_dst& action) { *this = action; };
1166 
1171  operator= (
1172  const cofaction_set_tp_dst& action) {
1173  if (this == &action)
1174  return *this;
1175  cofaction::operator= (action);
1176  tp_dst = action.tp_dst;
1177  return *this;
1178  };
1179 
1180 public:
1181 
1185  void
1186  set_tp_dst(uint16_t tp_dst) { this->tp_dst = tp_dst; };
1187 
1191  uint16_t
1192  get_tp_dst() const { return tp_dst; };
1193 
1194 public:
1195 
1199  virtual size_t
1200  length() const;
1201 
1205  virtual void
1206  pack(
1207  uint8_t* buf, size_t buflen);
1208 
1212  virtual void
1213  unpack(
1214  uint8_t* buf, size_t buflen);
1215 
1216 public:
1217 
1218  friend std::ostream&
1219  operator<< (std::ostream& os, const cofaction_set_tp_dst& action) {
1220  os << rofl::indent(0) << "<cofaction_set_tp_dst ";
1221  os << "tp-dst:" << (unsigned int)action.get_tp_dst() << " >" << std::endl;
1222  rofl::indent i(2);
1223  os << dynamic_cast<cofaction const&>( action );
1224  return os;
1225  };
1226 
1227 private:
1228 
1229  uint16_t tp_dst;
1230 };
1231 
1232 
1233 
1235 public:
1236 
1241  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1242  uint16_t port_no = 0,
1243  uint32_t queue_id = 0) :
1244  cofaction(ofp_version, rofl::openflow10::OFPAT_ENQUEUE),
1245  port_no(port_no),
1246  queue_id(queue_id) {};
1247 
1251  virtual
1252  ~cofaction_enqueue() {};
1253 
1258  const cofaction_enqueue& action) { *this = action; };
1259 
1264  operator= (
1265  const cofaction_enqueue& action) {
1266  if (this == &action)
1267  return *this;
1268  cofaction::operator= (action);
1269  port_no = action.port_no;
1270  queue_id = action.queue_id;
1271  return *this;
1272  };
1273 
1274 public:
1275 
1279  void
1280  set_port_no(uint16_t port_no) { this->port_no = port_no; };
1281 
1285  uint16_t
1286  get_port_no() const { return port_no; };
1287 
1291  void
1292  set_queue_id(uint32_t queue_id) { this->queue_id = queue_id; };
1293 
1297  uint32_t
1298  get_queue_id() const { return queue_id; };
1299 
1300 public:
1301 
1305  virtual size_t
1306  length() const;
1307 
1311  virtual void
1312  pack(
1313  uint8_t* buf, size_t buflen);
1314 
1318  virtual void
1319  unpack(
1320  uint8_t* buf, size_t buflen);
1321 
1322 public:
1323 
1324  friend std::ostream&
1325  operator<< (std::ostream& os, const cofaction_enqueue& action) {
1326  os << rofl::indent(0) << "<cofaction_enqueue ";
1327  os << std::hex;
1328  os << "port-no:0x" << (unsigned int)action.get_port_no() << " ";
1329  os << "queue-id:0x" << (unsigned int)action.get_queue_id() << " >" << std::endl;
1330  os << std::dec;
1331  rofl::indent i(2);
1332  os << dynamic_cast<cofaction const&>( action );
1333  return os;
1334  };
1335 
1336 private:
1337 
1338  uint16_t port_no;
1339  uint32_t queue_id;
1340 };
1341 
1342 
1343 
1344 class cofaction_vendor : public cofaction {
1345 public:
1346 
1351  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1352  uint32_t exp_id = 0,
1353  const rofl::cmemory& exp_body = rofl::cmemory((size_t)0)) :
1354  cofaction(ofp_version, rofl::openflow::OFPAT_EXPERIMENTER),
1355  exp_id(exp_id),
1356  exp_body(exp_body) {};
1357 
1361  virtual
1362  ~cofaction_vendor() {};
1363 
1368  const cofaction_vendor& action) { *this = action; };
1369 
1374  operator= (
1375  const cofaction_vendor& action) {
1376  if (this == &action)
1377  return *this;
1378  cofaction::operator= (action);
1379  exp_id = action.exp_id;
1380  exp_body = action.exp_body;
1381  return *this;
1382  };
1383 
1384 public:
1385 
1389  void
1390  set_exp_id(uint32_t exp_id) { this->exp_id = exp_id; };
1391 
1395  uint32_t
1396  get_exp_id() const { return exp_id; };
1397 
1401  const rofl::cmemory&
1402  get_exp_body() const { return exp_body; };
1403 
1407  rofl::cmemory&
1408  set_exp_body() { return exp_body; };
1409 
1410 public:
1411 
1415  virtual size_t
1416  length() const;
1417 
1421  virtual void
1422  pack(
1423  uint8_t* buf, size_t buflen);
1424 
1428  virtual void
1429  unpack(
1430  uint8_t* buf, size_t buflen);
1431 
1432 public:
1433 
1434  friend std::ostream&
1435  operator<< (std::ostream& os, const cofaction_vendor& action) {
1436  os << rofl::indent(0) << "<cofaction_vendor ";
1437  os << "exp-id:0x" << std::hex << (unsigned int)action.get_exp_id() << std::dec << " >" << std::endl;
1438  rofl::indent i(2);
1439  os << dynamic_cast<cofaction const&>( action );
1440  os << action.get_exp_body();
1441  return os;
1442  };
1443 
1444 private:
1445 
1446  uint32_t exp_id;
1447  rofl::cmemory exp_body;
1448 };
1449 
1450 
1451 
1453 public:
1454 
1458  cofaction_copy_ttl_out(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
1459  cofaction(ofp_version, rofl::openflow::OFPAT_COPY_TTL_OUT) {};
1460 
1464  virtual
1465  ~cofaction_copy_ttl_out() {};
1466 
1471  const cofaction_copy_ttl_out& action) { *this = action; };
1472 
1477  operator= (
1478  const cofaction_copy_ttl_out& action) {
1479  if (this == &action)
1480  return *this;
1481  cofaction::operator= (action);
1482  return *this;
1483  };
1484 
1485 public:
1486 
1490  virtual size_t
1491  length() const;
1492 
1496  virtual void
1497  pack(
1498  uint8_t* buf, size_t buflen);
1499 
1503  virtual void
1504  unpack(
1505  uint8_t* buf, size_t buflen);
1506 
1507 public:
1508 
1509  friend std::ostream&
1510  operator<< (std::ostream& os, cofaction_copy_ttl_out const& action) {
1511  os << rofl::indent(0) << "<cofaction_copy_ttl_out >" << std::endl;
1512  rofl::indent i(2);
1513  os << dynamic_cast<cofaction const&>( action );
1514  return os;
1515  };
1516 };
1517 
1518 
1519 
1521 public:
1522 
1526  cofaction_copy_ttl_in(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
1527  cofaction(ofp_version, rofl::openflow::OFPAT_COPY_TTL_IN) {};
1528 
1532  virtual
1533  ~cofaction_copy_ttl_in() {};
1534 
1539  const cofaction_copy_ttl_in& action) { *this = action; };
1540 
1545  operator= (
1546  const cofaction_copy_ttl_in& action) {
1547  if (this == &action)
1548  return *this;
1549  cofaction::operator= (action);
1550  return *this;
1551  };
1552 
1553 public:
1554 
1558  virtual size_t
1559  length() const;
1560 
1564  virtual void
1565  pack(
1566  uint8_t* buf, size_t buflen);
1567 
1571  virtual void
1572  unpack(
1573  uint8_t* buf, size_t buflen);
1574 
1575 public:
1576 
1577  friend std::ostream&
1578  operator<< (std::ostream& os, cofaction_copy_ttl_in const& action) {
1579  os << rofl::indent(0) << "<cofaction_copy_ttl_in >" << std::endl;
1580  rofl::indent i(2);
1581  os << dynamic_cast<cofaction const&>( action );
1582  return os;
1583  };
1584 };
1585 
1586 
1587 
1589 public:
1590 
1595  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1596  uint8_t mpls_ttl = 0) :
1597  cofaction(ofp_version, rofl::openflow::OFPAT_SET_MPLS_TTL),
1598  mpls_ttl(mpls_ttl) {};
1599 
1603  virtual
1604  ~cofaction_set_mpls_ttl() {};
1605 
1610  const cofaction_set_mpls_ttl& action) { *this = action; };
1611 
1616  operator= (
1617  const cofaction_set_mpls_ttl& action) {
1618  if (this == &action)
1619  return *this;
1620  cofaction::operator= (action);
1621  mpls_ttl = action.mpls_ttl;
1622  return *this;
1623  }
1624 
1625 public:
1626 
1630  void
1631  set_mpls_ttl(uint8_t mpls_ttl) { this->mpls_ttl = mpls_ttl; };
1632 
1636  uint8_t
1637  get_mpls_ttl() const { return mpls_ttl; };
1638 
1639 public:
1640 
1644  virtual size_t
1645  length() const;
1646 
1650  virtual void
1651  pack(
1652  uint8_t* buf, size_t buflen);
1653 
1657  virtual void
1658  unpack(
1659  uint8_t* buf, size_t buflen);
1660 
1661 public:
1662 
1663  friend std::ostream&
1664  operator<< (std::ostream& os, const cofaction_set_mpls_ttl& action) {
1665  os << rofl::indent(0) << "<cofaction_set_mpls_ttl ";
1666  os << "mpls-ttl:0x" << std::hex << (unsigned int)action.get_mpls_ttl() << std::dec << " >" << std::endl;
1667  rofl::indent i(2);
1668  os << dynamic_cast<cofaction const&>( action );
1669  return os;
1670  };
1671 
1672 private:
1673 
1674  uint8_t mpls_ttl;
1675 };
1676 
1677 
1678 
1680 public:
1681 
1686  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
1687  cofaction(ofp_version, rofl::openflow::OFPAT_DEC_MPLS_TTL) {};
1688 
1692  virtual
1693  ~cofaction_dec_mpls_ttl() {};
1694 
1699  const cofaction_dec_mpls_ttl& action) { *this = action; };
1700 
1705  operator= (
1706  const cofaction_dec_mpls_ttl& action) {
1707  if (this == &action)
1708  return *this;
1709  cofaction::operator= (action);
1710  return *this;
1711  };
1712 
1713 public:
1714 
1718  virtual size_t
1719  length() const;
1720 
1724  virtual void
1725  pack(
1726  uint8_t* buf, size_t buflen);
1727 
1731  virtual void
1732  unpack(
1733  uint8_t* buf, size_t buflen);
1734 
1735 public:
1736 
1737  friend std::ostream&
1738  operator<< (std::ostream& os, cofaction_dec_mpls_ttl const& action) {
1739  os << rofl::indent(0) << "<cofaction_dec_mpls_ttl >" << std::endl;
1740  rofl::indent i(2);
1741  os << dynamic_cast<cofaction const&>( action );
1742  return os;
1743  };
1744 };
1745 
1746 
1747 
1749 public:
1750 
1755  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1756  uint16_t eth_type = 0) :
1757  cofaction(ofp_version, rofl::openflow::OFPAT_PUSH_VLAN),
1758  eth_type(eth_type) {};
1759 
1763  virtual
1764  ~cofaction_push_vlan() {};
1765 
1770  const cofaction_push_vlan& action) { *this = action; };
1771 
1776  operator= (
1777  const cofaction_push_vlan& action) {
1778  if (this == &action)
1779  return *this;
1780  cofaction::operator= (action);
1781  eth_type = action.eth_type;
1782  return *this;
1783  };
1784 
1785 public:
1786 
1790  virtual size_t
1791  length() const;
1792 
1796  virtual void
1797  pack(
1798  uint8_t* buf, size_t buflen);
1799 
1803  virtual void
1804  unpack(
1805  uint8_t* buf, size_t buflen);
1806 
1807 public:
1808 
1812  void
1813  set_eth_type(uint16_t eth_type) { this->eth_type = eth_type; };
1814 
1818  uint16_t
1819  get_eth_type() const { return eth_type; };
1820 
1821 public:
1822 
1823  friend std::ostream&
1824  operator<< (std::ostream& os, const cofaction_push_vlan& action) {
1825  os << rofl::indent(0) << "<cofaction_push_vlan ";
1826  os << "eth-type:0x" << std::hex << (unsigned int)action.get_eth_type() << std::dec << " >" << std::endl;
1827  rofl::indent i(2);
1828  os << dynamic_cast<cofaction const&>( action );
1829  return os;
1830  };
1831 
1832 private:
1833 
1834  uint16_t eth_type;
1835 };
1836 
1837 
1838 
1840 public:
1841 
1845  cofaction_pop_vlan(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
1846  cofaction(ofp_version, rofl::openflow::OFPAT_POP_VLAN) {};
1847 
1851  virtual
1852  ~cofaction_pop_vlan() {};
1853 
1858  const cofaction_pop_vlan& action) { *this = action; };
1859 
1864  operator= (
1865  const cofaction_pop_vlan& action) {
1866  if (this == &action)
1867  return *this;
1868  cofaction::operator= (action);
1869  return *this;
1870  };
1871 
1872 public:
1873 
1877  virtual size_t
1878  length() const;
1879 
1883  virtual void
1884  pack(
1885  uint8_t* buf, size_t buflen);
1886 
1890  virtual void
1891  unpack(
1892  uint8_t* buf, size_t buflen);
1893 
1894 public:
1895 
1896  friend std::ostream&
1897  operator<< (std::ostream& os, const cofaction_pop_vlan& action) {
1898  os << rofl::indent(0) << "<cofaction_pop_vlan >" << std::endl;
1899  rofl::indent i(2);
1900  os << dynamic_cast<cofaction const&>( action );
1901  return os;
1902  };
1903 };
1904 
1905 
1906 
1908 public:
1909 
1914  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
1915  uint16_t eth_type = 0) :
1916  cofaction(ofp_version, rofl::openflow::OFPAT_PUSH_MPLS),
1917  eth_type(eth_type) {};
1918 
1922  virtual
1923  ~cofaction_push_mpls() {};
1924 
1929  const cofaction_push_mpls& action) { *this = action; };
1930 
1935  operator= (
1936  const cofaction_push_mpls& action) {
1937  if (this == &action)
1938  return *this;
1939  cofaction::operator= (action);
1940  eth_type = action.eth_type;
1941  return *this;
1942  };
1943 
1944 public:
1945 
1949  virtual size_t
1950  length() const;
1951 
1955  virtual void
1956  pack(
1957  uint8_t* buf, size_t buflen);
1958 
1962  virtual void
1963  unpack(
1964  uint8_t* buf, size_t buflen);
1965 
1966 public:
1967 
1971  void
1972  set_eth_type(uint16_t eth_type) { this->eth_type = eth_type; };
1973 
1977  uint16_t
1978  get_eth_type() const { return eth_type; };
1979 
1980 public:
1981 
1982  friend std::ostream&
1983  operator<< (std::ostream& os, const cofaction_push_mpls& action) {
1984  os << rofl::indent(0) << "<cofaction_push_mpls ";
1985  os << "eth-type:0x" << std::hex << (unsigned int)action.get_eth_type() << std::dec << " >" << std::endl;
1986  rofl::indent i(2);
1987  os << dynamic_cast<cofaction const&>( action );
1988  return os;
1989  };
1990 
1991 private:
1992 
1993  uint16_t eth_type;
1994 };
1995 
1996 
1997 
1999 public:
2000 
2005  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2006  uint16_t eth_type = 0) :
2007  cofaction(ofp_version, rofl::openflow::OFPAT_POP_MPLS),
2008  eth_type(eth_type) {};
2009 
2013  virtual
2014  ~cofaction_pop_mpls() {};
2015 
2020  const cofaction_pop_mpls& action) { *this = action; };
2021 
2026  operator= (
2027  const cofaction_pop_mpls& action) {
2028  if (this == &action)
2029  return *this;
2030  cofaction::operator= (action);
2031  eth_type = action.eth_type;
2032  return *this;
2033  };
2034 
2035 public:
2036 
2040  virtual size_t
2041  length() const;
2042 
2046  virtual void
2047  pack(
2048  uint8_t* buf, size_t buflen);
2049 
2053  virtual void
2054  unpack(
2055  uint8_t* buf, size_t buflen);
2056 
2057 public:
2058 
2062  void
2063  set_eth_type(uint16_t eth_type) { this->eth_type = eth_type; };
2064 
2068  uint16_t
2069  get_eth_type() const { return eth_type; };
2070 
2071 public:
2072 
2073  friend std::ostream&
2074  operator<< (std::ostream& os, const cofaction_pop_mpls& action) {
2075  os << rofl::indent(0) << "<cofaction_pop_mpls ";
2076  os << "eth-type:0x" << std::hex << (unsigned int)action.get_eth_type() << std::dec << " >" << std::endl;
2077  rofl::indent i(2);
2078  os << dynamic_cast<cofaction const&>( action );
2079  return os;
2080  };
2081 
2082 private:
2083 
2084  uint16_t eth_type;
2085 };
2086 
2087 
2088 
2089 class cofaction_group : public cofaction {
2090 public:
2091 
2096  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2097  uint32_t group_id = 0) :
2098  cofaction(ofp_version, rofl::openflow::OFPAT_GROUP),
2099  group_id(group_id) {};
2100 
2104  virtual
2105  ~cofaction_group() {};
2106 
2111  const cofaction_group& action) { *this = action; };
2112 
2117  operator= (
2118  const cofaction_group& action) {
2119  if (this == &action)
2120  return *this;
2121  cofaction::operator= (action);
2122  group_id = action.group_id;
2123  return *this;
2124  };
2125 
2126 public:
2130  void
2131  set_group_id(uint32_t group_id) { this->group_id = group_id; };
2132 
2136  uint32_t
2137  get_group_id() const { return group_id; };
2138 
2139 public:
2140 
2144  virtual size_t
2145  length() const;
2146 
2150  virtual void
2151  pack(
2152  uint8_t* buf, size_t buflen);
2153 
2157  virtual void
2158  unpack(
2159  uint8_t* buf, size_t buflen);
2160 
2161 public:
2162 
2163  friend std::ostream&
2164  operator<< (std::ostream& os, const cofaction_group& action) {
2165  os << rofl::indent(0) << "<cofaction_group ";
2166  os << "group-id:0x" << std::hex << (int)action.get_group_id() << std::dec << " >" << std::endl;
2167  rofl::indent i(2);
2168  os << dynamic_cast<cofaction const&>( action );
2169  return os;
2170  };
2171 
2172 private:
2173 
2174  uint32_t group_id;
2175 };
2176 
2177 
2178 
2180 public:
2181 
2186  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2187  uint8_t nw_ttl = 0) :
2188  cofaction(ofp_version, rofl::openflow::OFPAT_SET_NW_TTL),
2189  nw_ttl(nw_ttl) {};
2190 
2194  virtual
2195  ~cofaction_set_nw_ttl() {};
2196 
2201  const cofaction_set_nw_ttl& action) { *this = action; };
2202 
2207  operator= (
2208  const cofaction_set_nw_ttl& action) {
2209  if (this == &action)
2210  return *this;
2211  cofaction::operator= (action);
2212  nw_ttl = action.nw_ttl;
2213  return *this;
2214  };
2215 
2216 public:
2217 
2221  void
2222  set_nw_ttl(uint8_t nw_ttl) { this->nw_ttl = nw_ttl; };
2223 
2227  uint8_t
2228  get_nw_ttl() const { return nw_ttl; };
2229 
2230 public:
2231 
2235  virtual size_t
2236  length() const;
2237 
2241  virtual void
2242  pack(
2243  uint8_t* buf, size_t buflen);
2244 
2248  virtual void
2249  unpack(
2250  uint8_t* buf, size_t buflen);
2251 
2252 public:
2253 
2254  friend std::ostream&
2255  operator<< (std::ostream& os, const cofaction_set_nw_ttl& action) {
2256  os << rofl::indent(0) << "<cofaction_set_nw_ttl ";
2257  os << "nw-ttl:" << (unsigned int)action.get_nw_ttl() << " >" << std::endl;
2258  rofl::indent i(2);
2259  os << dynamic_cast<cofaction const&>( action );
2260  return os;
2261  };
2262 
2263 private:
2264 
2265  uint8_t nw_ttl;
2266 };
2267 
2268 
2269 
2271 public:
2272 
2276  cofaction_dec_nw_ttl(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
2277  cofaction(ofp_version, rofl::openflow::OFPAT_DEC_NW_TTL) {};
2278 
2282  virtual
2283  ~cofaction_dec_nw_ttl() {};
2284 
2289  const cofaction_dec_nw_ttl& action) { *this = action; };
2290 
2295  operator= (
2296  const cofaction_dec_nw_ttl& action) {
2297  if (this == &action)
2298  return *this;
2299  cofaction::operator= (action);
2300  return *this;
2301  };
2302 
2303 public:
2304 
2308  virtual size_t
2309  length() const;
2310 
2314  virtual void
2315  pack(
2316  uint8_t* buf, size_t buflen);
2317 
2321  virtual void
2322  unpack(
2323  uint8_t* buf, size_t buflen);
2324 
2325 public:
2326 
2327  friend std::ostream&
2328  operator<< (std::ostream& os, cofaction_dec_nw_ttl const& action) {
2329  os << rofl::indent(0) << "<cofaction_dec_nw_ttl >" << std::endl;
2330  rofl::indent i(2);
2331  os << dynamic_cast<cofaction const&>( action );
2332  return os;
2333  };
2334 };
2335 
2336 
2337 
2339 public:
2340 
2345  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2346  uint32_t queue_id = 0) :
2347  cofaction(ofp_version, rofl::openflow::OFPAT_SET_QUEUE),
2348  queue_id(queue_id) {};
2349 
2353  virtual
2354  ~cofaction_set_queue() {};
2355 
2360  const cofaction_set_queue& action) { *this = action; };
2361 
2366  operator= (
2367  const cofaction_set_queue& action) {
2368  if (this == &action)
2369  return *this;
2370  cofaction::operator= (action);
2371  queue_id = action.queue_id;
2372  return *this;
2373  };
2374 
2375 public:
2376 
2380  void
2381  set_queue_id(uint32_t queue_id) { this->queue_id = queue_id; };
2382 
2386  uint32_t
2387  get_queue_id() const { return queue_id; };
2388 
2389 public:
2390 
2394  virtual size_t
2395  length() const;
2396 
2400  virtual void
2401  pack(
2402  uint8_t* buf, size_t buflen);
2403 
2407  virtual void
2408  unpack(
2409  uint8_t* buf, size_t buflen);
2410 
2411 public:
2412 
2413  friend std::ostream&
2414  operator<< (std::ostream& os, const cofaction_set_queue& action) {
2415  os << rofl::indent(0) << "<cofaction_set_queue ";
2416  os << "queue-id:" << (unsigned int)action.get_queue_id() << " >" << std::endl;
2417  rofl::indent i(2);
2418  os << dynamic_cast<cofaction const&>( action );
2419  return os;
2420  };
2421 
2422 private:
2423 
2424  uint32_t queue_id;
2425 };
2426 
2427 
2428 
2430 public:
2431 
2436  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2438  cofaction(ofp_version, rofl::openflow::OFPAT_SET_FIELD),
2439  oxm(oxm) {};
2440 
2444  virtual
2445  ~cofaction_set_field() {};
2446 
2451  const cofaction_set_field& action) { *this = action; };
2452 
2457  operator= (
2458  const cofaction_set_field& action) {
2459  if (this == &action)
2460  return *this;
2461  cofaction::operator= (action);
2462  oxm = action.oxm;
2463  return *this;
2464  };
2465 
2466 public:
2467 
2472  set_oxm() { return oxm; };
2473 
2477  void
2478  set_oxm(const rofl::openflow::coxmatch& oxm) { this->oxm = oxm; };
2479 
2484  get_oxm() const { return oxm; };
2485 
2486 public:
2487 
2491  virtual size_t
2492  length() const;
2493 
2497  virtual void
2498  pack(
2499  uint8_t* buf, size_t buflen);
2500 
2504  virtual void
2505  unpack(
2506  uint8_t* buf, size_t buflen);
2507 
2508 public:
2509 
2510  friend std::ostream&
2511  operator<< (std::ostream& os, cofaction_set_field const& action) {
2512  os << rofl::indent(0) << "<cofaction_set_field >" << std::endl;
2513  rofl::indent i(2);
2514  os << dynamic_cast<cofaction const&>( action );
2515  rofl::indent j(2);
2516  os << coxmatch_output(action.get_oxm());
2517  return os;
2518  };
2519 
2520 private:
2521 
2523 };
2524 
2525 
2526 
2528 public:
2529 
2534  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2535  uint32_t exp_id = 0,
2536  const rofl::cmemory& exp_body = rofl::cmemory((size_t)0)) :
2537  cofaction(ofp_version, rofl::openflow::OFPAT_EXPERIMENTER),
2538  exp_id(exp_id),
2539  exp_body(exp_body) {};
2540 
2544  virtual
2545  ~cofaction_experimenter() {};
2546 
2551  const cofaction_experimenter& action) { *this = action; };
2552 
2557  operator= (
2558  const cofaction_experimenter& action) {
2559  if (this == &action)
2560  return *this;
2561  cofaction::operator= (action);
2562  exp_id = action.exp_id;
2563  exp_body = action.exp_body;
2564  return *this;
2565  };
2566 
2567 public:
2568 
2572  void
2573  set_exp_id(uint32_t exp_id) { this->exp_id = exp_id; };
2574 
2578  uint32_t
2579  get_exp_id() const { return exp_id; };
2580 
2584  rofl::cmemory&
2585  set_exp_body() { return exp_body; };
2586 
2590  void
2591  set_exp_body(const rofl::cmemory& exp_body) { this->exp_body = exp_body; };
2592 
2596  const rofl::cmemory&
2597  get_exp_body() const { return exp_body; };
2598 
2599 public:
2600 
2604  virtual size_t
2605  length() const;
2606 
2610  virtual void
2611  pack(
2612  uint8_t* buf, size_t buflen);
2613 
2617  virtual void
2618  unpack(
2619  uint8_t* buf, size_t buflen);
2620 
2621 public:
2622 
2623  friend std::ostream&
2624  operator<< (std::ostream& os, cofaction_experimenter const& action) {
2625  os << rofl::indent(0) << "<cofaction_experimenter ";
2626  os << std::hex;
2627  os << "exp-id:0x" << (unsigned int)action.get_exp_id() << " ";
2628  os << std::dec;
2629  os << ">" << std::endl;
2630  rofl::indent i(2);
2631  os << dynamic_cast<cofaction const&>( action );
2632  os << action.get_exp_body();
2633  return os;
2634  };
2635 
2636 private:
2637 
2638  uint32_t exp_id;
2639  rofl::cmemory exp_body;
2640 };
2641 
2642 
2643 
2645 public:
2646 
2651  uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN,
2652  uint16_t eth_type = 0) :
2653  cofaction(ofp_version, rofl::openflow::OFPAT_PUSH_PBB),
2654  eth_type(eth_type) {};
2655 
2659  virtual
2660  ~cofaction_push_pbb() {};
2661 
2666  const cofaction_push_pbb& action) { *this = action; };
2667 
2672  operator= (
2673  const cofaction_push_pbb& action) {
2674  if (this == &action)
2675  return *this;
2676  cofaction::operator= (action);
2677  eth_type = action.eth_type;
2678  return *this;
2679  };
2680 
2681 public:
2682 
2686  virtual size_t
2687  length() const;
2688 
2692  virtual void
2693  pack(
2694  uint8_t* buf, size_t buflen);
2695 
2699  virtual void
2700  unpack(
2701  uint8_t* buf, size_t buflen);
2702 
2703 public:
2704 
2708  void
2709  set_eth_type(uint16_t eth_type) { this->eth_type = eth_type; };
2710 
2714  uint16_t
2715  get_eth_type() const { return eth_type; };
2716 
2717 public:
2718 
2719  friend std::ostream&
2720  operator<< (std::ostream& os, const cofaction_push_pbb& action) {
2721  os << rofl::indent(0) << "<cofaction_push_pbb ";
2722  os << "eth-type:0x" << std::hex << (unsigned int)action.get_eth_type() << std::dec << " >" << std::endl;
2723  rofl::indent i(2);
2724  os << dynamic_cast<cofaction const&>( action );
2725  return os;
2726  };
2727 
2728 private:
2729 
2730  uint16_t eth_type;
2731 };
2732 
2733 
2734 
2736 public:
2737 
2741  cofaction_pop_pbb(uint8_t ofp_version = rofl::openflow::OFP_VERSION_UNKNOWN) :
2742  cofaction(ofp_version, rofl::openflow::OFPAT_POP_PBB) {};
2743 
2747  virtual
2748  ~cofaction_pop_pbb() {};
2749 
2754  const cofaction_pop_pbb& action) { *this = action; };
2755 
2760  operator= (
2761  const cofaction_pop_pbb& action) {
2762  if (this == &action)
2763  return *this;
2764  cofaction::operator= (action);
2765  return *this;
2766  };
2767 
2768 public:
2769 
2773  virtual size_t
2774  length() const;
2775 
2779  virtual void
2780  pack(
2781  uint8_t* buf, size_t buflen);
2782 
2786  virtual void
2787  unpack(
2788  uint8_t* buf, size_t buflen);
2789 
2790 public:
2791 
2792  friend std::ostream&
2793  operator<< (std::ostream& os, const cofaction_pop_pbb& action) {
2794  os << rofl::indent(0) << "<cofaction_pop_pbb >" << std::endl;
2795  rofl::indent i(2);
2796  os << dynamic_cast<cofaction const&>( action );
2797  return os;
2798  };
2799 };
2800 
2801 
2802 }; // end of namespace openflow
2803 }; // end of namespace rofl
2804 
2805 #endif // COFACTION_H
Definition: cofaction.h:1839
Definition: cofaction.h:2089
Definition: cofaction.h:570
Definition: cofaction.h:2644
Definition: caddress.h:152
Definition: cofaction.h:34
Definition: cofaction.h:190
Definition: cofaction.h:1679
Definition: cofaction.h:961
Definition: cofaction.h:1344
Definition: cofaction.h:2527
Definition: cofaction.h:408
Definition: cofaction.h:2179
Definition: cofaction.h:1520
Definition: cofaction.h:502
Definition: cofaction.h:2338
Definition: cofaction.h:764
Definition: cofaction.h:35
Definition: cofaction.h:1052
Definition: cofaction.h:667
Definition: cofaction.h:1452
Definition: cofaction.h:313
Definition: coxmatch.h:49
Definition: cofaction.h:1588
Definition: cofaction.h:862
Definition: cofaction.h:1143
Definition: cofaction.h:38
Definition: caddress.h:415
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: cofaction.h:2429
Definition: openflow_common.h:186
Definition: coxmatch_output.h:25
Definition: logging.h:76
Definition: cofaction.h:1998
Definition: cofaction.h:33
Definition: cofaction.h:1907
Definition: cofaction.h:2735
Definition: cofaction.h:32
Definition: cofaction.h:1748
Definition: cofaction.h:2270
Definition: croflexception.h:27
Definition: cofaction.h:1234