Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OptInteger.h
Go to the documentation of this file.
1 /*
2  * Dibbler - a portable DHCPv6
3  *
4  * authors: Tomasz Mrugalski <thomson@klub.com.pl>
5  * Marek Senderski <msend@o2.pl>
6  *
7  * released under GNU GPL v2 licence
8  *
9  */
10 
11 #ifndef OPTINTEGER4_H
12 #define OPTINTEGER4_H
13 #include <iostream>
14 #include <string>
15 
16 #include "Opt.h"
17 
18 class TOptInteger : public TOpt
19 {
20 public:
21  TOptInteger(uint16_t type, unsigned int len/* 1,2, or 4*/, unsigned int value, TMsg* parent);
22  TOptInteger(uint16_t type, unsigned int len/* 1,2, or 4*/, const char *buf, size_t size, TMsg* parent);
23  char * storeSelf( char* buf);
24  size_t getSize();
25  unsigned int getValue();
26  bool isValid() const;
27  std::string getPlain();
28  bool doDuties() { return true; }
29 protected:
30  unsigned int Value;
31  bool Valid;
32  int Len; /* length in bytes of the integer field: 0-4 */
33 };
34 
35 #endif
36