8 #ifndef COFMSG_FLOW_REMOVED_H_
9 #define COFMSG_FLOW_REMOVED_H_ 1
12 #include "rofl/common/openflow/cofmatch.h"
28 uint8_t* ofhu_flow_removed;
34 #define ofh_flow_removed ofhu.ofhu_flow_removed
35 #define ofh10_flow_removed ofhu.ofhu10_flow_removed
36 #define ofh12_flow_removed ofhu.ofhu12_flow_removed
37 #define ofh13_flow_removed ofhu.ofhu13_flow_removed
39 #define OFP10_FLOW_REMOVED_STATIC_HDR_LEN 88
40 #define OFP12_FLOW_REMOVED_STATIC_HDR_LEN 48 // length without struct openflow12::ofp_match
41 #define OFP13_FLOW_REMOVED_STATIC_HDR_LEN 48 // length without struct openflow13::ofp_match
50 uint8_t of_version = 0,
53 uint16_t priority = 0,
56 uint32_t duration_sec = 0,
57 uint32_t duration_nsec = 0,
58 uint16_t idle_timeout = 0,
59 uint16_t hard_timeout = 0,
60 uint64_t packet_count = 0,
61 uint64_t byte_count = 0,
118 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
125 unpack(uint8_t *buf,
size_t buflen);
147 set_cookie(uint64_t cookie);
153 get_priority()
const;
159 set_priority(uint64_t priority);
171 set_reason(uint8_t reason);
177 get_table_id()
const;
183 set_table_id(uint8_t table_id);
189 get_duration_sec()
const;
195 set_duration_sec(uint32_t duration_sec);
201 get_duration_nsec()
const;
207 set_duration_nsec(uint32_t duration_nsec);
213 get_idle_timeout()
const;
219 set_idle_timeout(uint16_t idle_timeout);
225 get_hard_timeout()
const;
231 set_hard_timeout(uint16_t hard_timeout);
237 get_packet_count()
const;
243 set_packet_count(uint64_t packet_count);
249 get_byte_count()
const;
255 set_byte_count(uint64_t byte_count);
268 switch (msg.get_version()) {
269 case rofl::openflow10::OFP_VERSION: {
270 os << indent(0) << dynamic_cast<cofmsg const&>( msg );
271 os <<
indent(2) <<
"<cofmsg_flow_removed >" << std::endl;
272 os <<
indent(4) <<
"<cookie:0x" << std::hex << (int)msg.get_cookie() << std::dec <<
" >" << std::endl;
273 os <<
indent(4) <<
"<priority:0x" << std::hex << (int)msg.get_priority() << std::dec <<
" >" << std::endl;
274 switch (msg.get_reason()) {
275 case rofl::openflow10::OFPRR_IDLE_TIMEOUT: {
276 os <<
indent(4) <<
"<reason: -IDLE-TIMEOUT- >" << std::endl;
278 case rofl::openflow10::OFPRR_HARD_TIMEOUT: {
279 os <<
indent(4) <<
"<reason: -HARD-TIMEOUT- >" << std::endl;
281 case rofl::openflow10::OFPRR_DELETE: {
282 os <<
indent(4) <<
"<reason: -DELETE- >" << std::endl;
285 os <<
indent(4) <<
"<reason: -UNKNOWN- >" << std::endl;
288 os <<
indent(4) <<
"<duration-sec:" << (int)msg.get_duration_sec() <<
" >" << std::endl;
289 os <<
indent(4) <<
"<duration-nsec:" << (int)msg.get_duration_nsec() <<
" >" << std::endl;
290 os <<
indent(4) <<
"<idle-timeout:" << (int)msg.get_idle_timeout() <<
" >" << std::endl;
291 os <<
indent(4) <<
"<packet-count:" << (int)msg.get_packet_count() <<
" >" << std::endl;
292 os <<
indent(4) <<
"<byte-count:" << (int)msg.get_byte_count() <<
" >" << std::endl;
293 os <<
indent(4) <<
"<matches: >" << std::endl;
298 case rofl::openflow12::OFP_VERSION:
299 case rofl::openflow13::OFP_VERSION: {
300 os << indent(0) << dynamic_cast<cofmsg const&>( msg );
301 os <<
indent(2) <<
"<cofmsg_flow_removed >" << std::endl;
302 os <<
indent(4) <<
"<cookie:0x" << std::hex << (int)msg.get_cookie() << std::dec <<
" >" << std::endl;
303 os <<
indent(4) <<
"<priority:0x" << std::hex << (int)msg.get_priority() << std::dec <<
" >" << std::endl;
304 switch (msg.get_reason()) {
305 case rofl::openflow12::OFPRR_IDLE_TIMEOUT: {
306 os <<
indent(4) <<
"<reason: -IDLE-TIMEOUT- >" << std::endl;
308 case rofl::openflow12::OFPRR_HARD_TIMEOUT: {
309 os <<
indent(4) <<
"<reason: -HARD-TIMEOUT- >" << std::endl;
311 case rofl::openflow12::OFPRR_DELETE: {
312 os <<
indent(4) <<
"<reason: -DELETE- >" << std::endl;
314 case rofl::openflow12::OFPRR_GROUP_DELETE: {
315 os <<
indent(4) <<
"<reason: -GROUP-DELETE- >" << std::endl;
318 os <<
indent(4) <<
"<reason: -UNKNOWN- >" << std::endl;
321 os <<
indent(4) <<
"<table-id:" << (int)msg.get_table_id() <<
" >" << std::endl;
322 os <<
indent(4) <<
"<duration-sec:" << (int)msg.get_duration_sec() <<
" >" << std::endl;
323 os <<
indent(4) <<
"<duration-nsec:" << (int)msg.get_duration_nsec() <<
" >" << std::endl;
324 os <<
indent(4) <<
"<idle-timeout:" << (int)msg.get_idle_timeout() <<
" >" << std::endl;
325 os <<
indent(4) <<
"<hard-timeout:" << (int)msg.get_hard_timeout() <<
" >" << std::endl;
326 os <<
indent(4) <<
"<packet-count:" << (int)msg.get_packet_count() <<
" >" << std::endl;
327 os <<
indent(4) <<
"<byte-count:" << (int)msg.get_byte_count() <<
" >" << std::endl;
328 os <<
indent(4) <<
"<matches: >" << std::endl;
352 uint32_t duration_sec;
353 uint32_t duration_nsec;
355 uint16_t idle_timeout;
357 uint64_t packet_count;
374 uint32_t duration_sec;
375 uint32_t duration_nsec;
377 uint16_t idle_timeout;
378 uint16_t hard_timeout;
379 uint64_t packet_count;
Definition: openflow_common.h:493
virtual void reset()
Definition: cofmsg_flow_removed.cc:126
virtual size_t length() const
Definition: cofmsg_flow_removed.cc:143
Definition: openflow12.h:1029
virtual void validate()
Definition: cofmsg_flow_removed.cc:210
Definition: cofmatch.h:35
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_flow_removed.cc:200
Definition: openflow10.h:624
cofmsg_flow_removed(uint8_t of_version=0, uint32_t xid=0, uint64_t cookie=0, uint16_t priority=0, uint8_t reason=0, uint8_t table_id=0, uint32_t duration_sec=0, uint32_t duration_nsec=0, uint16_t idle_timeout=0, uint16_t hard_timeout=0, uint64_t packet_count=0, uint64_t byte_count=0, cofmatch const &match=cofmatch())
Definition: cofmsg_flow_removed.cc:5
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: openflow13.h:1704
virtual ~cofmsg_flow_removed()
Definition: cofmsg_flow_removed.cc:118
Definition: cofmsg_flow_removed.h:20
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_flow_removed.cc:165