Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_meter_mod.h
1 /*
2  * cofmsg_meter_mod.h
3  *
4  * Created on: 24.05.2014
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_METER_MOD_H
9 #define COFMSG_METER_MOD_H 1
10 
11 #include "rofl/common/openflow/messages/cofmsg.h"
12 #include "rofl/common/openflow/cofmeterbands.h"
13 
14 namespace rofl {
15 namespace openflow {
16 
21  public cofmsg
22 {
23 public:
24 
25 
30  uint8_t of_version = rofl::openflow::OFP_VERSION_UNKNOWN,
31  uint32_t xid = 0,
32  uint16_t command = 0,
33  uint16_t flags = 0,
34  uint32_t meter_id = 0,
36 
37 
42  const cofmsg_meter_mod& meter);
43 
44 
49  operator= (
50  const cofmsg_meter_mod& meter);
51 
52 
56  virtual
58 
59 
64  rofl::cmemory *memarea);
65 
66 
70  virtual void
71  reset();
72 
73 public:
74 
78  virtual size_t
79  length() const;
80 
81 
85  virtual void
86  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
87 
88 
92  virtual void
93  unpack(uint8_t *buf, size_t buflen);
94 
95 
98  virtual void
99  validate();
100 
101 
102 public:
103 
107  void
108  set_command(uint16_t command) { this->command = command; };
109 
113  uint16_t
114  get_command() const { return command; };
115 
119  void
120  set_flags(uint16_t flags) { this->flags = flags; };
121 
125  uint16_t
126  get_flags() const { return flags; };
127 
131  void
132  set_meter_id(uint32_t meter_id) { this->meter_id = meter_id; };
133 
137  uint32_t
138  get_meter_id() const { return meter_id; };
139 
144  set_meter_bands() { return meter_bands; };
145 
150  get_meter_bands() const { return meter_bands; };
151 
152 public:
153 
154  friend std::ostream&
155  operator<< (std::ostream& os, cofmsg_meter_mod const& msg) {
156  os << dynamic_cast<cofmsg const&>( msg );
157  os << indent(2) << "<cofmsg_meter >" << std::endl;
158  rofl::indent i(4);
159  os << msg.meter_bands;
160  return os;
161  };
162 
163 private:
164 
165  uint16_t command;
166  uint16_t flags;
167  uint32_t meter_id;
168  rofl::openflow::cofmeter_bands meter_bands;
169 };
170 
171 
172 } // end of namespace openflow
173 } // end of namespace rofl
174 
175 #endif /* COFMSG_METER_MOD_H_ */
cofmsg_meter_mod(uint8_t of_version=rofl::openflow::OFP_VERSION_UNKNOWN, uint32_t xid=0, uint16_t command=0, uint16_t flags=0, uint32_t meter_id=0, const rofl::openflow::cofmeter_bands &mbs=rofl::openflow::cofmeter_bands())
Definition: cofmsg_meter_mod.cc:5
virtual void validate()
Definition: cofmsg_meter_mod.cc:155
virtual size_t length() const
Definition: cofmsg_meter_mod.cc:95
Definition: cofmsg_meter_mod.h:20
virtual ~cofmsg_meter_mod()
Definition: cofmsg_meter_mod.cc:75
Definition: cofmeterbands.h:24
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_meter_mod.cc:145
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_meter_mod.cc:110
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: logging.h:76
virtual void reset()
Definition: cofmsg_meter_mod.cc:83
Definition: cofmsg.h:62