A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-autoconfigured-prefix.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008-2009 Telecom Bretagne
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
19  */
20 
21 #ifndef IPV6_AUTOCONFIGURED_PREFIX_H
22 #define IPV6_AUTOCONFIGURED_PREFIX_H
23 
24 #include <stdint.h>
25 
26 #include <list>
27 #include <vector>
28 #include <ostream>
29 
30 #include "ns3/timer.h"
31 #include "ns3/ipv6-address.h"
32 
33 namespace ns3
34 {
35 
41 {
42 public:
53  Ipv6AutoconfiguredPrefix (Ptr<Node> node, uint32_t interface, Ipv6Address prefix, Ipv6Prefix mask, uint32_t preferredLifeTime, uint32_t validLifeTime, Ipv6Address router = Ipv6Address ("::"));
54 
59 
65 
71 
76  uint32_t GetInterface () const;
77 
82  void SetInterface (uint32_t interface);
83 
88  uint32_t GetPreferredLifeTime () const;
89 
94  void SetPreferredLifeTime (uint32_t p);
95 
100  uint32_t GetValidLifeTime (void) const;
101 
106  void SetValidLifeTime (uint32_t v);
107 
112  bool IsPreferred () const;
113 
118  bool IsValid () const;
119 
123  void SetPreferred ();
124 
128  void SetValid ();
129 
133  void StartPreferredTimer ();
134 
138  void StartValidTimer ();
139 
143  void StopPreferredTimer ();
144 
148  void StopValidTimer ();
149 
153  void MarkPreferredTime ();
154 
158  void MarkValidTime ();
159 
163  void FunctionPreferredTimeout ();
164 
168  void FunctionValidTimeout ();
169 
173  void RemoveMe ();
174 
179  uint32_t GetId () const;
180 
185  Ipv6Address GetPrefix () const;
186 
191  void SetPrefix (Ipv6Address prefix);
192 
197  Ipv6Prefix GetMask () const;
198 
203  void SetMask (Ipv6Prefix mask);
204 
205 private:
209  static uint32_t m_prefixId;
210 
214  uint32_t m_id;
215 
220 
225 
230 
239 
244  uint32_t m_interface;
245 
249  uint32_t m_validLifeTime;
250 
255 
260 
264  bool m_valid;
265 
270 
275 };
276 
277 } /* namespace ns3 */
278 
279 #endif /* IPV6_AUTOCONFIGURED_PREFIX_H */
280