replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2009 Strasbourg University
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;
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.
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
18 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
21 #ifndef RADVD_INTERFACE_H
22 #define RADVD_INTERFACE_H
25 #include "ns3/simple-ref-count.h"
26 #include "radvd-prefix.h"
33 * \class RadvdInterface
34 * \brief Radvd interface configuration.
36 class RadvdInterface : public SimpleRefCount<RadvdInterface>
41 * \param interface interface index
43 RadvdInterface (uint32_t interface);
47 * \param interface interface index
48 * \param maxRtrAdvInterval maximum RA interval (ms)
49 * \param minRtrAdvInterval minimum RA interval (ms)
51 RadvdInterface (uint32_t interface, uint32_t maxRtrAdvInterval, uint32_t minRtrAdvInterval);
59 * \brief Get interface index for this configuration.
60 * \return interface index
62 uint32_t GetInterface () const;
65 * \brief Get list of prefixes advertised for this interface.
66 * \return list of IPv6 prefixes
68 std::list <Ptr<RadvdPrefix> > GetPrefixes () const;
71 * \brief Add a prefix to advertise on interface.
72 * \param routerPrefix prefix to advertise
74 void AddPrefix (Ptr<RadvdPrefix> routerPrefix);
77 * \brief Is send advert enabled (periodic RA and reply to RS) ?
78 * \return send advert flag
80 bool IsSendAdvert () const;
83 * \brief Set send advert flag.
84 * \param sendAdvert value
86 void SetSendAdvert (bool sendAdvert);
89 * \brief Get maximum RA interval.
90 * \return RA interval (ms)
92 uint32_t GetMaxRtrAdvInterval () const;
95 * \brief Get maximum RA interval.
96 * \param maxRtrAdvInterval RA interval (ms)
98 void SetMaxRtrAdvInterval (uint32_t maxRtrAdvInterval);
101 * \brief Get minimum RA interval
102 * \return RA interval (ms)
104 uint32_t GetMinRtrAdvInterval () const;
107 * \brief Get minimum RA interval
108 * \param minRtrAdvInterval RA interval (ms).
110 void SetMinRtrAdvInterval (uint32_t minRtrAdvInterval);
113 * \brief Get minimum delay between RAs.
114 * \return minimum delay (ms)
116 uint32_t GetMinDelayBetweenRAs () const;
119 * \brief Set minimum delay between RAs.
120 * \param minDelayBetweenRAs minimum delay (ms)
122 void SetMinDelayBetweenRAs (uint32_t minDelayBetweenRAs);
125 * \brief Is managed flag enabled ?
126 * \return managed flag
128 bool IsManagedFlag () const;
131 * \brief Set managed flag
132 * \param managedFlag value
134 void SetManagedFlag (bool managedFlag);
137 * \brief Is "other config" flag enabled ?
138 * \return other config flag
140 bool IsOtherConfigFlag () const;
143 * \brief Set "other config" flag
144 * \param otherConfigFlag value
146 void SetOtherConfigFlag (bool otherConfigFlag);
149 * \brief Get link MTU.
152 uint32_t GetLinkMtu () const;
155 * \brief Set link MTU.
156 * \param linkMtu link MTU
158 void SetLinkMtu (uint32_t linkMtu);
161 * \brief Get reachable time.
162 * \return reachable time
164 uint32_t GetReachableTime () const;
167 * \brief Set reachable time.
168 * \param reachableTime reachable time
170 void SetReachableTime (uint32_t reachableTime);
173 * \brief Get default lifetime.
174 * \return default lifetime
176 uint32_t GetDefaultLifeTime () const;
179 * \brief Set default lifetime.
180 * \param defaultLifeTime default lifetime
182 void SetDefaultLifeTime (uint32_t defaultLifeTime);
185 * \brief Get retransmission timer.
186 * \return retransmission timer
188 uint32_t GetRetransTimer () const;
191 * \brief Set retransmission timer.
192 * \param retransTimer retransmission timer
194 void SetRetransTimer (uint32_t retransTimer);
197 * \brief Get current hop limit.
198 * \return current hop limit for the link
200 uint8_t GetCurHopLimit () const;
203 * \brief Set current hop limit.
204 * \param curHopLimit current hop limit for the link
206 void SetCurHopLimit (uint8_t curHopLimit);
209 * \brief Get default preference.
210 * \return default preference
212 uint8_t GetDefaultPreference () const;
215 * \brief Set default preference.
216 * \param defaultPreference default preference
218 void SetDefaultPreference (uint8_t defaultPreference);
221 * \brief Is source LLA option should be included in RA ?
222 * \return true if source address is added in RA, false otherwise
224 bool IsSourceLLAddress () const;
227 * \brief Set flag to add or not LLA to RA.
228 * \param sourceLLAddress value
230 void SetSourceLLAddress (bool sourceLLAddress);
233 * \brief Is "home agent" flag enabled ?
234 * \return "home agent" flag
236 bool IsHomeAgentFlag () const;
239 * \brief Set "home agent" flag.
240 * \param homeAgentFlag value
242 void SetHomeAgentFlag (bool homeAgentFlag);
245 * \brief Is Home Agent Information option should be included in RA ?
246 * \return true if HA information option is added in RA, false otherwise
248 bool IsHomeAgentInfo () const;
251 * \brief Set flag to add or not HA information option to RA.
252 * \param homeAgentFlag value
254 void SetHomeAgentInfo (bool homeAgentFlag);
257 * \brief Get home agent lifetime.
258 * \return home agent lifetime
260 uint32_t GetHomeAgentLifeTime () const;
263 * \brief Set home agent lifetime.
264 * \param homeAgentLifeTime home agent lifetime
266 void SetHomeAgentLifeTime (uint32_t homeAgentLifeTime);
269 * \brief Get home agent preference.
270 * \return home agent preference
272 uint32_t GetHomeAgentPreference () const;
275 * \brief Set home agent preference.
276 * \param homeAgentPreference home agent preference
278 void SetHomeAgentPreference (uint32_t homeAgentPreference);
281 * \brief Is "mobile router support" flag enabled ?
282 * \return "mobile router support" flag
284 bool IsMobRtrSupportFlag () const;
287 * \brief Set "mobile router support" flag.
288 * \param mobRtrSupportFlag value
290 void SetMobRtrSupportFlag (bool mobRtrSupportFlag);
293 * \brief Is advertisement interval option should be included in RA ?
294 * \return true if advertisement interval option is added in RA, false otherwise
296 bool IsIntervalOpt () const;
299 * \brief Set flag to add or not advertisement interval to RA.
300 * \param intervalOpt value
302 void SetIntervalOpt (bool intervalOpt);
305 typedef std::list<Ptr<RadvdPrefix> > RadvdPrefixList;
306 typedef std::list<Ptr<RadvdPrefix> >::iterator RadvdPrefixListI;
309 * \brief Interface to advertise RA.
311 uint32_t m_interface;
314 * \brief List of prefixes to advertise.
316 RadvdPrefixList m_prefixes;
319 * \brief Flag whether or not router sends periodic RA and respond to RS.
324 * \brief Maximum RA interval in milliseconds.
326 uint32_t m_maxRtrAdvInterval;
329 * \brief Minimum RA interval in milliseconds.
331 uint32_t m_minRtrAdvInterval;
334 * \brief Minimum delay between RA in milliseconds.
336 uint32_t m_minDelayBetweenRAs;
339 * \brief Managed flag. If true host use the stateful protocol for address autoconfiguration.
344 * \brief Other configuration flag. If true host use stateful protocol for other (non-address) information.
346 bool m_otherConfigFlag;
349 * \brief Link MTU to use.
354 * \brief Reachable time in milliseconds.
356 uint32_t m_reachableTime;
359 * \brief Retransmission timer in milliseconds.
361 uint32_t m_retransTimer;
364 * \brief Current hop limit (TTL).
366 uint32_t m_curHopLimit;
369 * \brief Default life time in seconds.
371 uint32_t m_defaultLifeTime;
374 * \brief Preference associated with default router.
379 uint8_t m_defaultPreference;
382 * \brief Flag to add link-layer address in RA.
384 bool m_sourceLLAddress;
387 * \brief Flag to add HA (home agent) flag in RA.
389 bool m_homeAgentFlag;
392 * \brief Flag to add Home Agent Information option (Mobile IPv6).
393 * Currently not implemented.
395 bool m_homeAgentInfo;
398 * \brief Home agent lifetime in seconds. Ignored if home agent info is not set.
400 uint32_t m_homeAgentLifeTime;
403 * \brief Home agent preference. Ignored if home agent info is not set.
405 uint32_t m_homeAgentPreference;
408 * \brief Flag for HA to signals it supports Mobile Router registrations (NEMO Basic).
410 bool m_mobRtrSupportFlag;
413 * \brief Flag to add Advertisement Interval option in RA.
418 } /* namespace ns3 */
420 #endif /* RADVD_INTERFACE_H */