5 #ifndef COFINSTRUCTIONS_H
6 #define COFINSTRUCTIONS_H 1
11 #include "rofl/common/croflexception.h"
12 #include "rofl/common/openflow/cofinstruction.h"
32 uint8_t ofp_version = openflow::OFP_VERSION_UNKNOWN);
67 set_version(uint8_t ofp_version) {
68 this->ofp_version = ofp_version;
69 for (std::map<uint16_t, cofinstruction*>::iterator
70 it = instmap.begin(); it != instmap.end(); ++it) {
71 it->second->set_version(ofp_version);
79 get_version()
const {
return ofp_version; };
84 std::map<uint16_t, cofinstruction*>&
85 set_instructions() {
return instmap; };
90 const std::map<uint16_t, cofinstruction*>&
91 get_instructions()
const {
return instmap; };
106 uint8_t* buf,
size_t buflen);
113 uint8_t *buf,
size_t buflen);
119 check_prerequisites()
const;
127 add_inst(uint16_t type);
130 set_inst(uint16_t type);
133 get_inst(uint16_t type)
const;
136 drop_inst(uint16_t type);
139 has_inst(uint16_t type)
const;
146 add_inst_goto_table();
149 set_inst_goto_table();
152 get_inst_goto_table()
const;
155 drop_inst_goto_table();
158 has_inst_goto_table()
const;
165 add_inst_write_metadata();
168 set_inst_write_metadata();
171 get_inst_write_metadata()
const;
174 drop_inst_write_metadata();
177 has_inst_write_metadata()
const;
184 add_inst_write_actions();
187 set_inst_write_actions();
190 get_inst_write_actions()
const;
193 drop_inst_write_actions();
196 has_inst_write_actions()
const;
203 add_inst_apply_actions();
206 set_inst_apply_actions();
209 get_inst_apply_actions()
const;
212 drop_inst_apply_actions();
215 has_inst_apply_actions()
const;
222 add_inst_clear_actions();
225 set_inst_clear_actions();
228 get_inst_clear_actions()
const;
231 drop_inst_clear_actions();
234 has_inst_clear_actions()
const;
247 get_inst_meter()
const;
253 has_inst_meter()
const;
260 add_inst_experimenter();
263 set_inst_experimenter();
266 get_inst_experimenter()
const;
269 drop_inst_experimenter();
272 has_inst_experimenter()
const;
287 os <<
indent(0) <<
"<cofintructions ofp-version:" << (int)inlist.ofp_version <<
" >" << std::endl;
288 for (std::map<uint16_t, cofinstruction*>::const_iterator
289 it = inlist.instmap.begin(); it != inlist.instmap.end(); ++it) {
291 switch (it->second->get_type()) {
292 case openflow::OFPIT_GOTO_TABLE:
293 os << inlist.get_inst_goto_table();
break;
294 case openflow::OFPIT_WRITE_METADATA:
295 os << inlist.get_inst_write_metadata();
break;
296 case openflow::OFPIT_WRITE_ACTIONS:
297 os << inlist.get_inst_write_actions();
break;
298 case openflow::OFPIT_APPLY_ACTIONS:
299 os << inlist.get_inst_apply_actions();
break;
300 case openflow::OFPIT_CLEAR_ACTIONS:
301 os << inlist.get_inst_clear_actions();
break;
302 case openflow::OFPIT_METER:
303 os << inlist.get_inst_meter();
break;
304 case openflow::OFPIT_EXPERIMENTER:
305 os << inlist.get_inst_experimenter();
break;
307 os << *(it->second);
break;
316 std::map<uint16_t, cofinstruction*> instmap;
Definition: cofinstructions.h:20
Definition: cofinstruction.h:788
Definition: cofinstruction.h:449
Definition: cofinstructions.h:17
Definition: cofinstruction.h:302
Definition: cofinstructions.h:24
Definition: cofinstructions.h:19
Definition: cofinstructions.h:18
Definition: cofinstruction.h:38
Definition: cofinstruction.h:663
Definition: cofinstruction.h:400
Definition: cofinstruction.h:351
Definition: croflexception.h:27