Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
coftablefeatureprop.h
1 /*
2  * coftablefeatureprop.h
3  *
4  * Created on: 02.02.2014
5  * Author: andreas
6  */
7 
8 #ifndef COFTABLEFEATUREPROP_H_
9 #define COFTABLEFEATUREPROP_H_
10 
11 #include <inttypes.h>
12 
13 #include <vector>
14 #include <algorithm>
15 
16 #include "rofl/common/cmemory.h"
17 #include "rofl/common/croflexception.h"
18 #include "rofl/common/openflow/openflow.h"
19 #include "rofl/common/openflow/cofaction.h"
20 #include "rofl/common/openflow/cofinstruction.h"
21 
22 namespace rofl {
23 namespace openflow {
24 
27 
29  public cmemory
30 {
31  uint8_t ofp_version;
32 
33  union {
34  uint8_t *ofhu_ofp_tfp;
35  struct openflow13::ofp_table_feature_prop_header *ofhu_ofp_tfphdr;
36  } ofh_ofhu;
37 
38 #define ofp_tfp ofh_ofhu.ofhu_ofp_tfp
39 #define ofp_tfphdr ofh_ofhu.ofhu_ofp_tfphdr
40 
41 public:
42 
47 
48 
53  uint8_t ofp_version,
54  uint16_t type,
55  size_t len = sizeof(struct openflow13::ofp_table_feature_prop_header));
56 
60  virtual
62 
67  coftable_feature_prop const& tfp);
68 
73  operator= (
74  coftable_feature_prop const& tfp);
75 
76 public:
77 
81  virtual size_t
82  length() const;
83 
87  virtual void
88  pack(
89  uint8_t* buf, size_t buflen);
90 
94  virtual void
95  unpack(
96  uint8_t* buf, size_t buflen);
97 
101  uint8_t
102  get_version() const;
103 
107  uint16_t
108  get_type() const;
109 
113  void
114  set_type(uint16_t type);
115 
119  uint16_t
120  get_length() const;
121 
125  void
126  set_length(uint16_t len);
127 
128 protected:
129 
133  uint8_t*
134  resize(size_t size);
135 
136 public:
137 
138  friend std::ostream&
139  operator<< (std::ostream& os, coftable_feature_prop const& tfp) {
140  os << indent(0) << "<coftable_feature_prop type:" << tfp.get_type() << " len:" << tfp.get_length() << " >" << std::endl;
141  indent i(2);
142  os << dynamic_cast<rofl::cmemory const&>( tfp );
143  return os;
144  };
145 };
146 
147 
148 
150  public coftable_feature_prop
151 {
152  std::vector<struct rofl::openflow::ofp_instruction> instructions_ids;
153 
154  union {
155  uint8_t *ofhu_ofp_tfpi;
156  struct openflow13::ofp_table_feature_prop_instructions *ofhu_ofp_tfpihdr;
157  } ofh_ofhu;
158 
159 #define ofh_tfpi ofh_ofhu.ofhu_ofp_tfpi
160 #define ofh_tfpihdr ofh_ofhu.ofhu_ofp_tfpihdr
161 
162 public:
163 
168  uint8_t ofp_version = OFP_VERSION_UNKNOWN,
169  uint16_t type = 0);
170 
174  virtual
176 
182 
187  operator= (
189 
190 public:
191 
195  void
196  clear();
197 
201  virtual size_t
202  length() const;
203 
207  virtual void
208  pack(
209  uint8_t* buf, size_t buflen);
210 
214  virtual void
215  unpack(
216  uint8_t* buf, size_t buflen);
217 
221  std::vector<struct rofl::openflow::ofp_instruction>&
222  set_instruction_ids() { return instructions_ids; };
223 
227  const std::vector<struct rofl::openflow::ofp_instruction>&
228  get_instruction_ids() const { return instructions_ids; };
229 
230 
234  void
235  add_instruction(
236  uint16_t type, uint16_t len = sizeof(struct rofl::openflow::ofp_instruction));
237 
238 
239 protected:
240 
244  uint8_t*
245  resize(size_t size);
246 
247 public:
248 
249  friend std::ostream&
250  operator<< (std::ostream& os, coftable_feature_prop_instructions const& tfp) {
251  os << dynamic_cast<coftable_feature_prop const&>( tfp );
252  os << indent(2) << "<coftable_feature_prop_instructions size:" << tfp.instructions_ids.size() << " ";
253  switch (tfp.get_type()) {
254  case rofl::openflow13::OFPTFPT_INSTRUCTIONS: {
255  os << "INSTRUCTIONS";
256  } break;
257  case rofl::openflow13::OFPTFPT_INSTRUCTIONS_MISS: {
258  os << "INSTRUCTIONS-MISS";
259  } break;
260  default: {
261  os << "type:" << (int)tfp.get_type();
262  };
263  }
264  os << " >" << std::endl;
265 
266  for (std::vector<struct rofl::openflow::ofp_instruction>::const_iterator
267  it = tfp.instructions_ids.begin(); it != tfp.instructions_ids.end(); ++it) {
268  switch ((*it).type) {
269  case rofl::openflow::OFPIT_GOTO_TABLE: {
270  os << indent(4) << "<instruction-id GOTO-TABLE >" << std::endl;
271  } break;
272  case rofl::openflow::OFPIT_WRITE_METADATA: {
273  os << indent(4) << "<instruction-id WRITE-METADATA >" << std::endl;
274  } break;
275  case rofl::openflow::OFPIT_WRITE_ACTIONS: {
276  os << indent(4) << "<instruction-id WRITE-ACTIONS >" << std::endl;
277  } break;
278  case rofl::openflow::OFPIT_APPLY_ACTIONS: {
279  os << indent(4) << "<instruction-id APPLY-ACTIONS >" << std::endl;
280  } break;
281  case rofl::openflow::OFPIT_CLEAR_ACTIONS: {
282  os << indent(4) << "<instruction-id CLEAR-ACTIONS >" << std::endl;
283  } break;
284  case rofl::openflow::OFPIT_METER: {
285  os << indent(4) << "<instruction-id METER >" << std::endl;
286  } break;
287  case rofl::openflow::OFPIT_EXPERIMENTER: {
288  os << indent(4) << "<instruction-id EXPERIMENTER >" << std::endl;
289  } break;
290  default: {
291  os << indent(4) << "<instruction-id type:" << (*it).type << " len:" << (*it).len << " >" << std::endl;
292  };
293  }
294  }
295  return os;
296  };
297 };
298 
299 
300 
302  public coftable_feature_prop,
303  public std::vector<uint8_t>
304 {
305  union {
306  uint8_t *ofhu_ofp_tfpnxt;
307  struct openflow13::ofp_table_feature_prop_next_tables *ofhu_ofp_tfpnxthdr;
308  } ofh_ofhu;
309 
310 #define ofh_tfpnxt ofh_ofhu.ofhu_ofp_tfpnxt
311 #define ofh_tfpnxthdr ofh_ofhu.ofhu_ofp_tfpnxthdr
312 
313 public:
314 
319  uint8_t ofp_version = OFP_VERSION_UNKNOWN,
320  uint16_t type = 0);
321 
325  virtual
327 
333 
338  operator= (
340 
341 public:
342 
346  virtual void
347  clear();
348 
352  virtual size_t
353  length() const;
354 
358  virtual void
359  pack(
360  uint8_t* buf, size_t buflen);
361 
365  virtual void
366  unpack(
367  uint8_t* buf, size_t buflen);
368 
372  std::vector<uint8_t>&
373  get_next_table_ids() { return *this; };
374 
378  void
379  add_table_id(
380  uint8_t table_id);
381 
382 protected:
383 
387  uint8_t*
388  resize(size_t size);
389 
390 public:
391 
392  friend std::ostream&
393  operator<< (std::ostream& os, coftable_feature_prop_next_tables const& tfp) {
394  os << dynamic_cast<coftable_feature_prop const&>( tfp );
395  os << indent(2) << "<coftable_feature_prop_next_tables size:" << tfp.size() << " ";
396  switch (tfp.get_type()) {
397  case rofl::openflow13::OFPTFPT_NEXT_TABLES: {
398  os << "NEXT-TABLES";
399  } break;
400  case rofl::openflow13::OFPTFPT_NEXT_TABLES_MISS: {
401  os << "NEXT-TABLES-MISS";
402  } break;
403  default: {
404  os << "type:" << (int)tfp.get_type();
405  };
406  }
407  os << " >" << std::endl;
408 
409  for (std::vector<uint8_t>::const_iterator it = tfp.begin(); it != tfp.end(); ++it) {
410  os << indent(4) << "<table-id:" << (int)(*it) << " >" << std::endl;
411  }
412  return os;
413  };
414 };
415 
416 
417 
419  public coftable_feature_prop
420 {
421  union {
422  uint8_t *ofhu_ofp_tfpa;
423  struct openflow13::ofp_table_feature_prop_actions *ofhu_ofp_tfpahdr;
424  } ofh_ofhu;
425 
426 #define ofh_tfpa ofh_ofhu.ofhu_ofp_tfpa
427 #define ofh_tfpahdr ofh_ofhu.ofhu_ofp_tfpahdr
428 
429  std::vector<struct rofl::openflow::ofp_action> actions;
430 
431 public:
432 
437  uint8_t ofp_version = OFP_VERSION_UNKNOWN,
438  uint16_t type = 0);
439 
443  virtual
445 
450  coftable_feature_prop_actions const& tfpa);
451 
456  operator= (
457  coftable_feature_prop_actions const& tfpa);
458 
459 public:
460 
464  virtual void
465  clear();
466 
470  virtual size_t
471  length() const;
472 
476  virtual void
477  pack(
478  uint8_t* buf, size_t buflen);
479 
483  virtual void
484  unpack(
485  uint8_t* buf, size_t buflen);
486 
487 
491  std::vector<struct rofl::openflow::ofp_action>&
492  set_action_ids() { return actions; };
493 
497  const std::vector<struct rofl::openflow::ofp_action>&
498  get_action_ids() const { return actions; };
499 
500 
504  void
505  add_action(
506  uint16_t type, uint16_t len = sizeof(struct rofl::openflow::ofp_action));
507 
508 
509 protected:
510 
514  uint8_t*
515  resize(size_t size);
516 
517 public:
518 
519  friend std::ostream&
520  operator<< (std::ostream& os, coftable_feature_prop_actions const& tfp) {
521  os << dynamic_cast<coftable_feature_prop const&>( tfp );
522  os << indent(2) << "<coftable_feature_prop_actions size:" << tfp.actions.size() << " ";
523  switch (tfp.get_type()) {
524  case rofl::openflow13::OFPTFPT_WRITE_ACTIONS: {
525  os << "WRITE-ACTIONS";
526  } break;
527  case rofl::openflow13::OFPTFPT_WRITE_ACTIONS_MISS: {
528  os << "WRITE-ACTIONS-MISS";
529  } break;
530  case rofl::openflow13::OFPTFPT_APPLY_ACTIONS: {
531  os << "APPLY-ACTIONS";
532  } break;
533  case rofl::openflow13::OFPTFPT_APPLY_ACTIONS_MISS: {
534  os << "APPLY-ACTIONS-MISS";
535  } break;
536  default: {
537  os << "type:" << (int)tfp.get_type();
538  };
539  }
540  os << " >" << std::endl;
541 
542  for (std::vector<struct rofl::openflow::ofp_action>::const_iterator
543  it = tfp.actions.begin(); it != tfp.actions.end(); ++it) {
544 
545  switch ((*it).type) {
546  case rofl::openflow::OFPAT_OUTPUT: {
547  os << indent(4) << "<action-id ACTION-OUTPUT len:" << (*it).len << " >" << std::endl;
548  } break;
549  case rofl::openflow::OFPAT_COPY_TTL_OUT: {
550  os << indent(4) << "<action-id ACTION-COPY-TTL-OUT len:" << (*it).len << " >" << std::endl;
551  } break;
552  case rofl::openflow::OFPAT_COPY_TTL_IN: {
553  os << indent(4) << "<action-id ACTION-COPY-TTL-IN len:" << (*it).len << " >" << std::endl;
554  } break;
555  case rofl::openflow::OFPAT_SET_MPLS_TTL: {
556  os << indent(4) << "<action-id ACTION-SET-MPLS-TTL len:" << (*it).len << " >" << std::endl;
557  } break;
558  case rofl::openflow::OFPAT_DEC_MPLS_TTL: {
559  os << indent(4) << "<action-id ACTION-DEC-MPLS-TTL len:" << (*it).len << " >" << std::endl;
560  } break;
561  case rofl::openflow::OFPAT_PUSH_VLAN: {
562  os << indent(4) << "<action-id ACTION-PUSH-VLAN len:" << (*it).len << " >" << std::endl;
563  } break;
564  case rofl::openflow::OFPAT_POP_VLAN: {
565  os << indent(4) << "<action-id ACTION-POP-VLAN len:" << (*it).len << " >" << std::endl;
566  } break;
567  case rofl::openflow::OFPAT_PUSH_MPLS: {
568  os << indent(4) << "<action-id ACTION-PUSH-MPLS len:" << (*it).len << " >" << std::endl;
569  } break;
570  case rofl::openflow::OFPAT_POP_MPLS: {
571  os << indent(4) << "<action-id ACTION-POP-MPLS len:" << (*it).len << " >" << std::endl;
572  } break;
573  case rofl::openflow::OFPAT_SET_QUEUE: {
574  os << indent(4) << "<action-id ACTION-SET-QUEUE len:" << (*it).len << " >" << std::endl;
575  } break;
576  case rofl::openflow::OFPAT_GROUP: {
577  os << indent(4) << "<action-id ACTION-GROUP len:" << (*it).len << " >" << std::endl;
578  } break;
579  case rofl::openflow::OFPAT_SET_NW_TTL: {
580  os << indent(4) << "<action-id ACTION-SET-NW-TTL len:" << (*it).len << " >" << std::endl;
581  } break;
582  case rofl::openflow::OFPAT_DEC_NW_TTL: {
583  os << indent(4) << "<action-id ACTION-DEC-NW-TTL len:" << (*it).len << " >" << std::endl;
584  } break;
585  case rofl::openflow::OFPAT_SET_FIELD: {
586  os << indent(4) << "<action-id ACTION-SET-FIELD len:" << (*it).len << " >" << std::endl;
587  } break;
588  case rofl::openflow::OFPAT_PUSH_PBB: {
589  os << indent(4) << "<action-id ACTION-PUSH-PBB len:" << (*it).len << " >" << std::endl;
590  } break;
591  case rofl::openflow::OFPAT_POP_PBB: {
592  os << indent(4) << "<action-id ACTION-POP-PBB len:" << (*it).len << " >" << std::endl;
593  } break;
594  case rofl::openflow::OFPAT_EXPERIMENTER: {
595  os << indent(4) << "<action-id ACTION-EXPERIMENTER len:" << (*it).len << " >" << std::endl;
596  } break;
597  default: {
598  os << indent(4) << "<action-id type:" << (*it).type << " len:" << (*it).len << " >" << std::endl;
599  };
600  }
601  }
602  return os;
603  };
604 };
605 
606 
607 
609  public coftable_feature_prop
610 {
611  std::vector<uint32_t> oxm_ids;
612  std::vector<uint64_t> oxm_ids_exp;
613 
614  union {
615  uint8_t *ofhu_ofp_tfpoxm;
616  struct openflow13::ofp_table_feature_prop_oxm *ofhu_ofp_tfpoxmhdr;
617  } ofh_ofhu;
618 
619 #define ofh_tfpoxm ofh_ofhu.ofhu_ofp_tfpoxm
620 #define ofh_tfpoxmhdr ofh_ofhu.ofhu_ofp_tfpoxmhdr
621 
622 public:
623 
628  uint8_t ofp_version = OFP_VERSION_UNKNOWN,
629  uint16_t type = 0);
630 
634  virtual
636 
641  coftable_feature_prop_oxm const& tfpoxm);
642 
647  operator= (
648  coftable_feature_prop_oxm const& tfpoxm);
649 
650 public:
651 
655  virtual void
656  clear();
657 
661  virtual size_t
662  length() const;
663 
667  virtual void
668  pack(
669  uint8_t* buf, size_t buflen);
670 
674  virtual void
675  unpack(
676  uint8_t* buf, size_t buflen);
677 
678 
682  std::vector<uint32_t>&
683  set_oxm_ids() { return oxm_ids; };
684 
688  const std::vector<uint32_t>&
689  get_oxm_ids() const { return oxm_ids; };
690 
694  std::vector<uint64_t>&
695  set_oxm_ids_exp() { return oxm_ids_exp; };
696 
700  const std::vector<uint64_t>&
701  get_oxm_ids_exp() const { return oxm_ids_exp; };
702 
703 
707  void
708  add_oxm(
709  uint32_t oxm_id);
710 
711 
715  void
716  add_oxm_exp(
717  uint64_t oxm_exp_id);
718 
719 
720 
721 protected:
722 
726  uint8_t*
727  resize(size_t size);
728 
729 public:
730 
731  friend std::ostream&
732  operator<< (std::ostream& os, coftable_feature_prop_oxm const& tfp) {
733  os << dynamic_cast<coftable_feature_prop const&>( tfp );
734  os << indent(2) << "<coftable_feature_prop_oxm "
735  << "#oxm-ids:" << tfp.oxm_ids.size() << " "
736  << "#oxm-ids-exp:" << tfp.oxm_ids_exp.size() << " ";
737  switch (tfp.get_type()) {
738  case rofl::openflow13::OFPTFPT_MATCH: {
739  os << "MATCH";
740  } break;
741  case rofl::openflow13::OFPTFPT_WILDCARDS: {
742  os << "WILDCARDS";
743  } break;
744  case rofl::openflow13::OFPTFPT_WRITE_SETFIELD: {
745  os << "WRITE-SETFIELD";
746  } break;
747  case rofl::openflow13::OFPTFPT_WRITE_SETFIELD_MISS: {
748  os << "WRITE-SETFIELD-MISS";
749  } break;
750  case rofl::openflow13::OFPTFPT_APPLY_SETFIELD: {
751  os << "APPLY-SETFIELD";
752  } break;
753  case rofl::openflow13::OFPTFPT_APPLY_SETFIELD_MISS: {
754  os << "APPLY-SETFIELD-MISS";
755  } break;
756  default: {
757  os << "type:" << (int)tfp.get_type();
758  };
759  }
760  os << " >" << std::endl;
761 
762  for (std::vector<uint32_t>::const_iterator it = tfp.oxm_ids.begin(); it != tfp.oxm_ids.end(); ++it) {
763 
764  switch ((int32_t)*it) {
765  case rofl::openflow::OXM_TLV_BASIC_IN_PORT: {
766  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IN-PORT >" << std::endl;
767  } break;
768  case rofl::openflow::OXM_TLV_BASIC_IN_PHY_PORT: {
769  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IN-PHY-PORT >" << std::endl;
770  } break;
771  case rofl::openflow::OXM_TLV_BASIC_METADATA: {
772  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-METADATA >" << std::endl;
773  } break;
774  case rofl::openflow::OXM_TLV_BASIC_METADATA_MASK: {
775  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-METADATA-MASK >" << std::endl;
776  } break;
777  case rofl::openflow::OXM_TLV_BASIC_ETH_DST: {
778  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ETH-DST >" << std::endl;
779  } break;
780  case rofl::openflow::OXM_TLV_BASIC_ETH_DST_MASK: {
781  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ETH-DST-MASK >" << std::endl;
782  } break;
783  case rofl::openflow::OXM_TLV_BASIC_ETH_SRC: {
784  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ETH-SRC >" << std::endl;
785  } break;
786  case rofl::openflow::OXM_TLV_BASIC_ETH_SRC_MASK: {
787  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ETH-SRC-MASK >" << std::endl;
788  } break;
789  case rofl::openflow::OXM_TLV_BASIC_ETH_TYPE: {
790  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ETH-TYPE >" << std::endl;
791  } break;
792  case rofl::openflow::OXM_TLV_BASIC_VLAN_VID: {
793  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-VLAN-VID >" << std::endl;
794  } break;
795  case rofl::openflow::OXM_TLV_BASIC_VLAN_VID_MASK: {
796  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-VLAN-VID-MASK >" << std::endl;
797  } break;
798  case rofl::openflow::OXM_TLV_BASIC_VLAN_PCP: {
799  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-VLAN-PCP >" << std::endl;
800  } break;
801  case rofl::openflow::OXM_TLV_BASIC_IP_DSCP: {
802  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IP-DSCP >" << std::endl;
803  } break;
804  case rofl::openflow::OXM_TLV_BASIC_IP_ECN: {
805  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IP-ECN >" << std::endl;
806  } break;
807  case rofl::openflow::OXM_TLV_BASIC_IP_PROTO: {
808  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IP-PROTO >" << std::endl;
809  } break;
810  case rofl::openflow::OXM_TLV_BASIC_IPV4_SRC: {
811  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV4-SRC >" << std::endl;
812  } break;
813  case rofl::openflow::OXM_TLV_BASIC_IPV4_SRC_MASK: {
814  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV4-SRC-MASK >" << std::endl;
815  } break;
816  case rofl::openflow::OXM_TLV_BASIC_IPV4_DST: {
817  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV4-DST >" << std::endl;
818  } break;
819  case rofl::openflow::OXM_TLV_BASIC_IPV4_DST_MASK: {
820  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV4-DST-MASK >" << std::endl;
821  } break;
822  case rofl::openflow::OXM_TLV_BASIC_TCP_SRC: {
823  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-TCP-SRC >" << std::endl;
824  } break;
825  case rofl::openflow::OXM_TLV_BASIC_TCP_DST: {
826  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-TCP-DST >" << std::endl;
827  } break;
828  case rofl::openflow::OXM_TLV_BASIC_UDP_SRC: {
829  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-UDP-SRC >" << std::endl;
830  } break;
831  case rofl::openflow::OXM_TLV_BASIC_UDP_DST: {
832  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-UDP-DST >" << std::endl;
833  } break;
834  case rofl::openflow::OXM_TLV_BASIC_SCTP_SRC: {
835  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-SCTP-SRC >" << std::endl;
836  } break;
837  case rofl::openflow::OXM_TLV_BASIC_SCTP_DST: {
838  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-SCTP-DST >" << std::endl;
839  } break;
840  case rofl::openflow::OXM_TLV_BASIC_ICMPV4_TYPE: {
841  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ICMPV4-TYPE >" << std::endl;
842  } break;
843  case rofl::openflow::OXM_TLV_BASIC_ICMPV4_CODE: {
844  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ICMPV4-CODE >" << std::endl;
845  } break;
846  case rofl::openflow::OXM_TLV_BASIC_ARP_OP: {
847  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-OP >" << std::endl;
848  } break;
849  case rofl::openflow::OXM_TLV_BASIC_ARP_SPA: {
850  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-SPA >" << std::endl;
851  } break;
852  case rofl::openflow::OXM_TLV_BASIC_ARP_SPA_MASK: {
853  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-SPA-MASK >" << std::endl;
854  } break;
855  case rofl::openflow::OXM_TLV_BASIC_ARP_TPA: {
856  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-TPA >" << std::endl;
857  } break;
858  case rofl::openflow::OXM_TLV_BASIC_ARP_TPA_MASK: {
859  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-TPA-MASK >" << std::endl;
860  } break;
861  case rofl::openflow::OXM_TLV_BASIC_ARP_SHA: {
862  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-SHA >" << std::endl;
863  } break;
864  case rofl::openflow::OXM_TLV_BASIC_ARP_SHA_MASK: {
865  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-SHA-MASK >" << std::endl;
866  } break;
867  case rofl::openflow::OXM_TLV_BASIC_ARP_THA: {
868  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-THA >" << std::endl;
869  } break;
870  case rofl::openflow::OXM_TLV_BASIC_ARP_THA_MASK: {
871  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ARP-THA-MASK >" << std::endl;
872  } break;
873  case rofl::openflow::OXM_TLV_BASIC_IPV6_SRC: {
874  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-SRC >" << std::endl;
875  } break;
876  case rofl::openflow::OXM_TLV_BASIC_IPV6_SRC_MASK: {
877  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-SRC-MASK >" << std::endl;
878  } break;
879  case rofl::openflow::OXM_TLV_BASIC_IPV6_DST: {
880  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-DST >" << std::endl;
881  } break;
882  case rofl::openflow::OXM_TLV_BASIC_IPV6_DST_MASK: {
883  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-DST-MASK >" << std::endl;
884  } break;
885  case rofl::openflow::OXM_TLV_BASIC_IPV6_FLABEL: {
886  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-FLABEL >" << std::endl;
887  } break;
888  case rofl::openflow::OXM_TLV_BASIC_ICMPV6_TYPE: {
889  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ICMPV6-TYPE >" << std::endl;
890  } break;
891  case rofl::openflow::OXM_TLV_BASIC_ICMPV6_CODE: {
892  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-ICMPV6-CODE >" << std::endl;
893  } break;
894  case rofl::openflow::OXM_TLV_BASIC_IPV6_ND_TARGET: {
895  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-ND-TARGET >" << std::endl;
896  } break;
897  case rofl::openflow::OXM_TLV_BASIC_IPV6_ND_SLL: {
898  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-ND-SLL >" << std::endl;
899  } break;
900  case rofl::openflow::OXM_TLV_BASIC_IPV6_ND_TLL: {
901  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-ND-TLL >" << std::endl;
902  } break;
903  case rofl::openflow::OXM_TLV_BASIC_MPLS_LABEL: {
904  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-MPLS-LABEL >" << std::endl;
905  } break;
906  case rofl::openflow::OXM_TLV_BASIC_MPLS_TC: {
907  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-MPLS-TC >" << std::endl;
908  } break;
909  case rofl::openflow::OXM_TLV_BASIC_MPLS_BOS: {
910  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-MPLS-BOS >" << std::endl;
911  } break;
912  case rofl::openflow::OXM_TLV_BASIC_PBB_ISID: {
913  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-PBB-ISID >" << std::endl;
914  } break;
915  case rofl::openflow::OXM_TLV_BASIC_PBB_ISID_MASK: {
916  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-PBB-ISID-MASK >" << std::endl;
917  } break;
918  case rofl::openflow::OXM_TLV_BASIC_TUNNEL_ID: {
919  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-TUNNEL-ID >" << std::endl;
920  } break;
921  case rofl::openflow::OXM_TLV_BASIC_TUNNEL_ID_MASK: {
922  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-TUNNEL-ID-MASK >" << std::endl;
923  } break;
924  case rofl::openflow::OXM_TLV_BASIC_IPV6_EXTHDR: {
925  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " BASIC-IPV6-EXTHDR >" << std::endl;
926  } break;
927  default: {
928  os << indent(4) << "<oxm-id 0x" << std::hex << (*it) << std::dec << " >" << std::endl;
929  };
930  }
931  }
932  for (std::vector<uint64_t>::const_iterator it = tfp.oxm_ids_exp.begin(); it != tfp.oxm_ids_exp.end(); ++it) {
933  os << indent(4) << "<oxm-id-exp 0x" << std::hex << (*it) << std::dec << " >" << std::endl;
934  }
935  return os;
936  };
937 };
938 
939 
940 /*
941  * TODO: coftable_feature_prop_experimenter
942  */
943 
944 };
945 };
946 
947 #endif /* COFTABLEFEATUREPROP_H_ */
Definition: coftablefeatureprop.h:25
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatureprop.cc:255
Definition: coftablefeatureprop.h:149
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatureprop.cc:87
uint8_t * resize(size_t size)
Resizes allocated memory area by calling C-function realloc().
Definition: coftablefeatureprop.cc:872
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatureprop.cc:808
virtual void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatureprop.cc:579
Definition: openflow_common.h:176
Definition: coftablefeatureprop.h:26
uint8_t * resize(size_t size)
Resizes allocated memory area by calling C-function realloc().
Definition: coftablefeatureprop.cc:307
uint8_t * resize(size_t size)
Resizes allocated memory area by calling C-function realloc().
Definition: coftablefeatureprop.cc:108
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatureprop.cc:439
Definition: coftablefeatureprop.h:608
virtual void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatureprop.cc:409
Definition: coftablefeatureprop.h:418
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
uint8_t * resize(size_t size)
Resizes allocated memory area by calling C-function realloc().
Definition: coftablefeatureprop.cc:480
Definition: coftablefeatureprop.h:28
Definition: openflow_common.h:186
virtual void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatureprop.cc:222
Definition: coftablefeatureprop.h:301
virtual void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatureprop.cc:70
Definition: logging.h:76
uint8_t * resize(size_t size)
Resizes allocated memory area by calling C-function realloc().
Definition: coftablefeatureprop.cc:666
virtual void pack(uint8_t *buf, size_t buflen)
Copies content of this cmemory instance to specified buffer.
Definition: coftablefeatureprop.cc:773
Definition: croflexception.h:27
virtual void unpack(uint8_t *buf, size_t buflen)
Copies content of specified buffer into this cmemory instance .
Definition: coftablefeatureprop.cc:613