Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClntCfgIface.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 <keczi@poczta.onet.pl>
7  * Michal Kowalczuk <michal@kowalczuk.eu>
8  * Mateusz Ozga <matozga@gmail.com>
9  *
10  * released under GNU GPL v2 only licence
11  */
12 
13 #ifndef CLNTCFGIFACE_H
14 #define CLNTCFGIFACE_H
15 #include <list>
16 
17 #include "Container.h"
18 #include "HostID.h"
19 #include "SmartPtr.h"
20 #include "DHCPConst.h"
21 #include "IPv6Addr.h"
22 #include "ClntCfgTA.h"
23 #include "ClntParsGlobalOpt.h"
24 #include "SmartPtr.h"
25 #include "DUID.h"
26 #include "ClntCfgIA.h"
27 #include "ClntCfgPD.h"
28 #include "OptVendorSpecInfo.h"
29 #include "Opt.h"
30 
32 {
33  friend std::ostream& operator<<(std::ostream&,TClntCfgIface&);
34 public:
35 
37  {
38  public:
40  unsigned short OptionType;
44  bool Always; // should this option be sent always? (even when already configured?)
45  };
46  typedef std::list< SPtr<TOptionStatus> > TOptionStatusLst;
47 
48  TClntCfgIface(const std::string& ifaceName);
49  TClntCfgIface(int ifaceNr);
50 
51  void setRouting(bool enabled);
52  bool isRoutingEnabled();
54  void setRoutingEnabledState(EState state);
55 
57 
58  // IA
59  void firstIA();
60  int countIA();
62  SPtr<TClntCfgIA> getIA(int iaid);
64 
65  // PD
66  void firstPD();
67  int countPD();
69  SPtr<TClntCfgPD> getPD(int iaid);
71 
72  // TA
73  void firstTA();
74  void addTA(SPtr<TClntCfgTA> ta);
76  int countTA();
77 
78  std::string getName(void);
79  std::string getFullName(void);
81  int getID(void);
82  void setNoConfig();
83  void setIfaceID(int ifaceID);
84  void setIfaceName(const std::string& ifaceName);
85  bool noConfig();
86 
87  bool stateless();
88  bool getUnicast();
89 
90  bool getRapidCommit();
91  void setRapidCommit(bool rapCom);
92 
93  // --- option: DNS servers ---
94  bool isReqDNSServer();
96  void setDNSServerState(EState state);
97  unsigned long getDNSServerTimeout();
98  TContainer< SPtr<TIPv6Addr> > * getProposedDNSServerLst();
99 
100  // --- option: Domain ---
101  bool isReqDomain();
103  unsigned long getDomainTimeout();
104  void setDomainState(EState state);
105  List(std::string) * getProposedDomainLst();
106 
107  // --- option: NTP servers ---
108  bool isReqNTPServer();
110  unsigned long getNTPServerTimeout();
111  void setNTPServerState(EState state);
112  TContainer< SPtr<TIPv6Addr> > * getProposedNTPServerLst();
113 
114  // --- option: Timezone ---
116  bool isReqTimezone();
118  unsigned long getTimezoneTimeout();
119  void setTimezoneState(EState state);
120  std::string getProposedTimezone();
121 
122  // --- option: SIP servers ---
123  bool isReqSIPServer();
125  unsigned long getSIPServerTimeout();
126  void setSIPServerState(EState state);
127  TContainer< SPtr<TIPv6Addr> > * getProposedSIPServerLst();
128 
129  // --- option: SIP domains ---
130  bool isReqSIPDomain();
132  unsigned long getSIPDomainTimeout();
133  void setSIPDomainState(EState state);
134  List(std::string) * getProposedSIPDomainLst();
135 
136  // --- option: FQDN ---
137  bool isReqFQDN();
139  unsigned long getFQDNTimeout();
140  void setFQDNState(EState state);
141  std::string getProposedFQDN();
142 
143  // --- option: NIS servers ---
144  bool isReqNISServer();
146  unsigned long getNISServerTimeout();
147  void setNISServerState(EState state);
148  TContainer< SPtr<TIPv6Addr> > * getProposedNISServerLst();
149 
150  // --- option: NIS+ servers ---
151  bool isReqNISPServer();
153  unsigned long getNISPServerTimeout();
154  void setNISPServerState(EState state);
155  TContainer< SPtr<TIPv6Addr> > * getProposedNISPServerLst();
156 
157  // --- option: NIS domains ---
158  bool isReqNISDomain();
160  unsigned long getNISDomainTimeout();
161  void setNISDomainState(EState state);
162  std::string getProposedNISDomain();
163 
164  // --- option: NIS+ domains ---
165  bool isReqNISPDomain();
167  unsigned long getNISPDomainTimeout();
168  void setNISPDomainState(EState state);
169  std::string getProposedNISPDomain();
170 
171  // --- option: Lifetime ---
172  bool isReqLifetime();
174  void setLifetimeState(EState state);
175 
176  // --- see strict-rfc-no-routing ---
177  void setOnLinkPrefixLength(int len);
178  int getOnLinkPrefixLength();
179 
180  // --- option: VendorSpec ---
181  bool isReqVendorSpec();
182  void vendorSpecSupported(bool support);
184  void setVendorSpecState(EState state);
185  void firstVendorSpec();
187  int getVendorSpecCount();
188  void setVendorSpec(TContainer< SPtr<TOptVendorSpecInfo> > vendorSpecList);
189 
190  // --- custom/extra options ---
191  void addExtraOption(SPtr<TOpt> extra, TOpt::EOptionLayout layout, bool sendAlways);
192  void addExtraOption(int optType, TOpt::EOptionLayout layout, bool sendAlways);
195 
196  // --- option: KeyGeneration ---
198  void setKeyGenerationState(EState state);
199 
200  void setMbit(bool m_bit);
201  void setObit(bool o_bit);
202 
205  void setBindToAddr(SPtr<TIPv6Addr> link_local);
206 
210 
211 private:
212  void setDefaults();
213  std::string IfaceName;
214  int ID;
215  bool NoConfig;
216  bool Stateful_;
217  bool Unicast;
219  int PrefixLength; // default prefix length of the configured addresses
220 
221  TContainer< SPtr<TClntCfgIA> > IALst;
222  TContainer< SPtr<TClntCfgPD> > PDLst;
223  TContainer< SPtr<THostID> > PrefSrvLst;
224  TContainer< SPtr<THostID> > RejectedSrvLst;
225 
226  TContainer< SPtr<TClntCfgTA> > ClntCfgTALst;
227 
228  TContainer< SPtr<TIPv6Addr> > DNSServerLst;
229  List(std::string) DomainLst;
231  std::string Timezone;
233  List(std::string) SIPDomainLst;
234  std::string FQDN;
237  std::string NISDomain;
238  std::string NISPDomain;
240 
257 
260  bool ReqDomain;
265  bool ReqFQDN;
274 
277 
280 };
281 
282 #endif
283