A Discrete-Event Network Simulator
API
radvd-interface.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 Strasbourg University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19  */
20 
21 #ifndef RADVD_INTERFACE_H
22 #define RADVD_INTERFACE_H
23 
24 #include "radvd-prefix.h"
25 #include <list>
26 #include "ns3/simple-ref-count.h"
27 #include "ns3/nstime.h"
28 
29 namespace ns3
30 {
31 
36 class RadvdInterface : public SimpleRefCount<RadvdInterface>
37 {
38 public:
40  typedef std::list<Ptr<RadvdPrefix> > RadvdPrefixList;
42  typedef std::list<Ptr<RadvdPrefix> >::iterator RadvdPrefixListI;
44  typedef std::list<Ptr<RadvdPrefix> >::const_iterator RadvdPrefixListCI;
45 
50  RadvdInterface (uint32_t interface);
51 
58  RadvdInterface (uint32_t interface, uint32_t maxRtrAdvInterval, uint32_t minRtrAdvInterval);
59 
63  ~RadvdInterface ();
64 
69  uint32_t GetInterface () const;
70 
76 
81  void AddPrefix (Ptr<RadvdPrefix> routerPrefix);
82 
87  bool IsSendAdvert () const;
88 
93  void SetSendAdvert (bool sendAdvert);
94 
99  uint32_t GetMaxRtrAdvInterval () const;
100 
105  void SetMaxRtrAdvInterval (uint32_t maxRtrAdvInterval);
106 
111  uint32_t GetMinRtrAdvInterval () const;
112 
117  void SetMinRtrAdvInterval (uint32_t minRtrAdvInterval);
118 
123  uint32_t GetMinDelayBetweenRAs () const;
124 
129  void SetMinDelayBetweenRAs (uint32_t minDelayBetweenRAs);
130 
135  bool IsManagedFlag () const;
136 
141  void SetManagedFlag (bool managedFlag);
142 
147  bool IsOtherConfigFlag () const;
148 
153  void SetOtherConfigFlag (bool otherConfigFlag);
154 
159  uint32_t GetLinkMtu () const;
160 
165  void SetLinkMtu (uint32_t linkMtu);
166 
171  uint32_t GetReachableTime () const;
172 
177  void SetReachableTime (uint32_t reachableTime);
178 
183  uint32_t GetDefaultLifeTime () const;
184 
189  void SetDefaultLifeTime (uint32_t defaultLifeTime);
190 
195  uint32_t GetRetransTimer () const;
196 
201  void SetRetransTimer (uint32_t retransTimer);
202 
207  uint8_t GetCurHopLimit () const;
208 
213  void SetCurHopLimit (uint8_t curHopLimit);
214 
219  uint8_t GetDefaultPreference () const;
220 
225  void SetDefaultPreference (uint8_t defaultPreference);
226 
231  bool IsSourceLLAddress () const;
232 
237  void SetSourceLLAddress (bool sourceLLAddress);
238 
243  bool IsHomeAgentFlag () const;
244 
249  void SetHomeAgentFlag (bool homeAgentFlag);
250 
255  bool IsHomeAgentInfo () const;
256 
261  void SetHomeAgentInfo (bool homeAgentFlag);
262 
267  uint32_t GetHomeAgentLifeTime () const;
268 
273  void SetHomeAgentLifeTime (uint32_t homeAgentLifeTime);
274 
279  uint32_t GetHomeAgentPreference () const;
280 
285  void SetHomeAgentPreference (uint32_t homeAgentPreference);
286 
291  bool IsMobRtrSupportFlag () const;
292 
297  void SetMobRtrSupportFlag (bool mobRtrSupportFlag);
298 
303  bool IsIntervalOpt () const;
304 
309  void SetIntervalOpt (bool intervalOpt);
310 
316 
321  void SetLastRaTxTime (Time now);
322 
327  bool IsInitialRtrAdv ();
328 
329 private:
330 
334  uint32_t m_interface;
335 
340 
345 
350 
355 
360 
365 
370 
374  uint32_t m_linkMtu;
375 
379  uint32_t m_reachableTime;
380 
384  uint32_t m_retransTimer;
385 
389  uint32_t m_curHopLimit;
390 
395 
403 
408 
413 
419 
424 
429 
434 
439 
444 
449 
450 };
451 
452 } /* namespace ns3 */
453 
454 #endif /* RADVD_INTERFACE_H */
455 
Radvd interface configuration.
RadvdInterface(uint32_t interface)
Constructor.
bool IsMobRtrSupportFlag() const
Is "mobile router support" flag enabled ?
void SetMinDelayBetweenRAs(uint32_t minDelayBetweenRAs)
Set minimum delay between RAs.
uint8_t m_initialRtrAdvertisementsLeft
Number of fast announcement to do.
void SetSourceLLAddress(bool sourceLLAddress)
Set flag to add or not LLA to RA.
bool IsIntervalOpt() const
Is advertisement interval option should be included in RA ?
uint32_t m_reachableTime
Reachable time in milliseconds.
uint32_t GetMinDelayBetweenRAs() const
Get minimum delay between RAs.
std::list< Ptr< RadvdPrefix > > RadvdPrefixList
Container: Ptr to RadvdPrefix.
~RadvdInterface()
Destructor.
uint32_t m_defaultLifeTime
Default life time in seconds.
bool IsInitialRtrAdv()
Checks if the interface is subject to the initial Rtr Advertisements rule.
void SetSendAdvert(bool sendAdvert)
Set send advert flag.
std::list< Ptr< RadvdPrefix > >::iterator RadvdPrefixListI
Container Iterator: Ptr to RadvdPrefix.
void SetLinkMtu(uint32_t linkMtu)
Set link MTU.
void SetDefaultLifeTime(uint32_t defaultLifeTime)
Set default lifetime.
uint32_t m_maxRtrAdvInterval
Maximum RA interval in milliseconds.
void SetHomeAgentFlag(bool homeAgentFlag)
Set "home agent" flag.
bool m_sourceLLAddress
Flag to add link-layer address in RA.
uint32_t GetDefaultLifeTime() const
Get default lifetime.
bool m_sendAdvert
Flag whether or not router sends periodic RA and respond to RS.
void AddPrefix(Ptr< RadvdPrefix > routerPrefix)
Add a prefix to advertise on interface.
bool IsHomeAgentInfo() const
Is Home Agent Information option should be included in RA ?
uint8_t m_defaultPreference
Preference associated with default router.
void SetMobRtrSupportFlag(bool mobRtrSupportFlag)
Set "mobile router support" flag.
Time GetLastRaTxTime()
Get the last time a RA has been sent.
bool m_homeAgentInfo
Flag to add Home Agent Information option (Mobile IPv6).
void SetLastRaTxTime(Time now)
Set the last RA send time.
uint32_t m_homeAgentLifeTime
Home agent lifetime in seconds.
bool m_intervalOpt
Flag to add Advertisement Interval option in RA.
uint32_t GetMaxRtrAdvInterval() const
Get maximum RA interval.
uint32_t GetInterface() const
Get interface index for this configuration.
bool m_otherConfigFlag
Other configuration flag.
uint32_t GetMinRtrAdvInterval() const
Get minimum RA interval.
Time m_lastSendTime
Last RA send time.
uint32_t m_retransTimer
Retransmission timer in milliseconds.
RadvdPrefixList GetPrefixes() const
Get list of prefixes advertised for this interface.
void SetHomeAgentPreference(uint32_t homeAgentPreference)
Set home agent preference.
uint32_t GetRetransTimer() const
Get retransmission timer.
RadvdPrefixList m_prefixes
List of prefixes to advertise.
std::list< Ptr< RadvdPrefix > >::const_iterator RadvdPrefixListCI
Container Const Iterator: Ptr to RadvdPrefix.
bool IsHomeAgentFlag() const
Is "home agent" flag enabled ?
uint32_t GetReachableTime() const
Get reachable time.
bool m_managedFlag
Managed flag.
void SetIntervalOpt(bool intervalOpt)
Set flag to add or not advertisement interval to RA.
void SetRetransTimer(uint32_t retransTimer)
Set retransmission timer.
void SetCurHopLimit(uint8_t curHopLimit)
Set current hop limit.
void SetDefaultPreference(uint8_t defaultPreference)
Set default preference.
void SetMaxRtrAdvInterval(uint32_t maxRtrAdvInterval)
Get maximum RA interval.
uint32_t m_interface
Interface to advertise RA.
bool m_homeAgentFlag
Flag to add HA (home agent) flag in RA.
void SetOtherConfigFlag(bool otherConfigFlag)
Set "other config" flag.
bool IsSendAdvert() const
Is send advert enabled (periodic RA and reply to RS) ?
uint8_t GetDefaultPreference() const
Get default preference.
void SetMinRtrAdvInterval(uint32_t minRtrAdvInterval)
Get minimum RA interval.
bool IsOtherConfigFlag() const
Is "other config" flag enabled ?
uint32_t GetHomeAgentLifeTime() const
Get home agent lifetime.
bool m_mobRtrSupportFlag
Flag for HA to signals it supports Mobile Router registrations (NEMO Basic).
uint32_t m_minDelayBetweenRAs
Minimum delay between RA in milliseconds.
uint8_t GetCurHopLimit() const
Get current hop limit.
uint32_t m_curHopLimit
Current hop limit (TTL).
uint32_t GetLinkMtu() const
Get link MTU.
uint32_t m_minRtrAdvInterval
Minimum RA interval in milliseconds.
uint32_t m_homeAgentPreference
Home agent preference.
uint32_t GetHomeAgentPreference() const
Get home agent preference.
void SetManagedFlag(bool managedFlag)
Set managed flag.
void SetHomeAgentInfo(bool homeAgentFlag)
Set flag to add or not HA information option to RA.
bool IsSourceLLAddress() const
Is source LLA option should be included in RA ?
uint32_t m_linkMtu
Link MTU to use.
bool IsManagedFlag() const
Is managed flag enabled ?
void SetHomeAgentLifeTime(uint32_t homeAgentLifeTime)
Set home agent lifetime.
void SetReachableTime(uint32_t reachableTime)
Set reachable time.
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Every class exported by the ns3 library is enclosed in the ns3 namespace.