Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofmsg_hello.h
1 /*
2  * cofmsg_hello.h
3  *
4  * Created on: 18.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFMSG_HELLO_H_
9 #define COFMSG_HELLO_H_ 1
10 
11 #include "rofl/common/openflow/messages/cofmsg.h"
12 
13 namespace rofl {
14 namespace openflow {
15 
19 class cofmsg_hello :
20  public cofmsg
21 {
22 private:
23 
24  cmemory body;
25 
26 public:
27 
28 
33  uint8_t of_version = 0,
34  uint32_t xid = 0,
35  uint8_t* data = 0,
36  size_t datalen = 0);
37 
38 
43  cofmsg_hello const& hello);
44 
45 
50  operator= (
51  cofmsg_hello const& hello);
52 
53 
57  virtual
58  ~cofmsg_hello();
59 
60 
64  cofmsg_hello(cmemory *memarea);
65 
66 
70  virtual void
71  reset();
72 
73 
77  virtual size_t
78  length() const;
79 
80 
84  virtual void
85  pack(uint8_t *buf = (uint8_t*)0, size_t buflen = 0);
86 
87 
91  virtual void
92  unpack(uint8_t *buf, size_t buflen);
93 
94 
97  virtual void
98  validate();
99 
100 public:
101 
105  cmemory&
106  get_body();
107 
108 public:
109 
110  friend std::ostream&
111  operator<< (std::ostream& os, cofmsg_hello const& msg) {
112  os << indent(0) << dynamic_cast<cofmsg const&>( msg );
113  os << indent(2) << "<cofmsg_hello >" << std::endl;
114  os << indent(2) << msg.body;
115  return os;
116  };
117 
118  std::string
119  str() const {
120  std::stringstream ss;
121  ss << "-Hello- " << cofmsg::str();
122  return ss.str();
123  };
124 };
125 
126 } // end of namespace openflow
127 } // end of namespace rofl
128 
129 #endif /* COFMSG_HELLO_H_ */
Definition: cofmsg_hello.h:19
virtual void reset()
Definition: cofmsg_hello.cc:78
virtual size_t length() const
Definition: cofmsg_hello.cc:87
virtual void validate()
Definition: cofmsg_hello.cc:123
virtual void pack(uint8_t *buf=(uint8_t *) 0, size_t buflen=0)
Definition: cofmsg_hello.cc:95
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: logging.h:76
virtual void unpack(uint8_t *buf, size_t buflen)
Definition: cofmsg_hello.cc:113
cofmsg_hello(uint8_t of_version=0, uint32_t xid=0, uint8_t *data=0, size_t datalen=0)
Definition: cofmsg_hello.cc:5
virtual ~cofmsg_hello()
Definition: cofmsg_hello.cc:70
Definition: cofmsg.h:62