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_PREFIX_H
22 #define RADVD_PREFIX_H
26 #include "ns3/ipv6-address.h"
27 #include "ns3/simple-ref-count.h"
35 * \brief Router prefix for radvd application.
37 class RadvdPrefix : public SimpleRefCount<RadvdPrefix>
42 * \param network network prefix advertised
43 * \param prefixLength prefix length ( 0 < x <= 128)
44 * \param preferredLifeTime preferred life time in seconds (default 7 days)
45 * \param validLifeTime valid life time in seconds (default 30 days)
46 * \param onLinkFlag on link flag
47 * \param autonomousFlag autonomous link flag
48 * \param routerAddrFlag router address flag (for Mobile IPv6)
50 RadvdPrefix (Ipv6Address network, uint8_t prefixLength, uint32_t preferredLifeTime = 604800, uint32_t validLifeTime = 2592000, bool onLinkFlag = true, bool autonomousFlag = true, bool routerAddrFlag = false);
58 * \brief Get network prefix.
59 * \return network prefix
61 Ipv6Address GetNetwork () const;
64 * \brief Set network prefix.
65 * \param network network prefix
67 void SetNetwork (Ipv6Address network);
70 * \brief Get prefix length.
71 * \return prefix length
73 uint8_t GetPrefixLength () const;
76 * \brief Set prefix length.
77 * \param prefixLength prefix length
79 void SetPrefixLength (uint8_t prefixLength);
82 * \brief Get preferred lifetime.
85 uint32_t GetPreferredLifeTime () const;
88 * \brief Set preferred lifetime.
89 * \param preferredLifeTime lifetime
91 void SetPreferredLifeTime (uint32_t preferredLifeTime);
94 * \brief Get valid lifetime.
97 uint32_t GetValidLifeTime () const;
100 * \brief Set valid lifetime.
101 * \param validLifeTime lifetime
103 void SetValidLifeTime (uint32_t validLifeTime);
106 * \brief Is on-link flag ?
107 * \return true if on-link is activated, false otherwise
109 bool IsOnLinkFlag () const;
112 * \brief Set on-link flag.
113 * \param onLinkFlag value
115 void SetOnLinkFlag (bool onLinkFlag);
118 * \brief Is autonomous flag ?
119 * \return true if autonomous is activated, false otherwise
121 bool IsAutonomousFlag () const;
124 * \brief Set autonomous flag.
125 * \param autonomousFlag value
127 void SetAutonomousFlag (bool autonomousFlag);
130 * \brief Is router address flag ?
131 * \return true if router address is activated, false otherwise
133 bool IsRouterAddrFlag () const;
136 * \brief Set router address flag.
137 * \param routerAddrFlag value
139 void SetRouterAddrFlag (bool routerAddrFlag);
143 * \brief Network prefix.
145 Ipv6Address m_network;
148 * \brief Prefix length.
150 uint8_t m_prefixLength;
153 * \brief Preferred time.
155 uint32_t m_preferredLifeTime;
160 uint32_t m_validLifeTime;
163 * \brief On link flag, indicates that this prefix can be used for on-link determination.
168 * \brief Autonomous flag, it is used for autonomous address configuration (RFC 2462).
170 bool m_autonomousFlag;
173 * \brief Router address flag, indicates that router address is sent instead
174 * of network prefix as is required by Mobile IPv6.
176 bool m_routerAddrFlag;
179 } /* namespace ns3 */
181 #endif /* RADVD_PREFIX_H */