Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SrvCfgOptions.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  * changes: Krzysztof Wnuk
7  *
8  * released under GNU GPL v2 only licence
9  *
10  */
11 
12 #ifndef SRVCFGOPTIONS_H
13 #define SRVCFGOPTIONS_H
14 
15 #include <iostream>
16 #include <string>
17 #include <list>
18 
19 #include "SmartPtr.h"
20 #include "Container.h"
21 #include "IPv6Addr.h"
22 #include "SrvParsGlobalOpt.h"
23 
24 #include "OptVendorSpecInfo.h"
25 #include "OptVendorData.h"
26 #include "OptGeneric.h"
27 
28 class TSrvCfgIface;
29 
31 {
32  friend std::ostream& operator<<(std::ostream& out,TSrvCfgIface& iface);
33  friend std::ostream& operator<<(std::ostream& out,TSrvCfgOptions& opt);
34 
35 public:
41 
42  // address reservation
43  void setAddr(SPtr<TIPv6Addr> addr);
44  SPtr<TIPv6Addr> getAddr() const;
45 
46  void setPrefix(SPtr<TIPv6Addr> prefix, uint8_t length) { Prefix = prefix, PrefixLen = length; }
48  uint8_t getPrefixLen() { return PrefixLen; }
49 
50  SPtr<TDUID> getDuid() const;
53 
54  // option: DNS Servers is now handled with extra options mechanism
55  // option: Domain is now handled with extra options mechanism
56  // option: NTP servers is now handled with extra options mechanism
57  // option: Timezone is now handled with extra options mechanism
58  // option: SIP servers is now handled with extra options mechanism
59  // option: SIP domains is now handled with extra options mechanism
60  // option: NIS servers is now handled with extra options mechanism
61  // option: NIS+ servers is now handled with extra options mechanism
62  // option: NIS domain is now handled with extra options mechanism
63  // option: NIS+ domain is now handled with extra options mechanism
64  // option: LIFETIME is now handled with extra options mechanism
65 
66  // option: VENDOR-SPEC
67  TContainer< SPtr<TOptVendorSpecInfo> > getVendorSpecLst(unsigned int vendor=0);
68 
69  void addExtraOption(SPtr<TOpt> extra, bool always);
70  const TOptList& getExtraOptions();
72  const TOptList& getForcedOptions();
73  void addExtraOptions(const TOptList& extra);
74  void addForcedOptions(const TOptList& extra);
75 
76 private:
77  // options
79 
80  // address reservation
83  uint8_t PrefixLen;
84 
85  // options reservation
86  TOptList ExtraOpts_; // extra options ALWAYS sent to client (may also include ForcedOpts)
87  TOptList ForcedOpts_; // list of options that are forced to client
88 
89  void SetDefaults();
90 
91  //client specification
95 };
96 
97 #endif
98