replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2007-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>
28 #include "ns3/simple-ref-count.h"
30 #include "ipv6-address.h"
38 * \ingroup ipv6Routing
40 * \brief IPv6 route cache entry.
42 class Ipv6Route : public SimpleRefCount<Ipv6Route>
53 virtual ~Ipv6Route ();
56 * \brief Set destination address.
57 * \param dest IPv6 destination address
59 void SetDestination (Ipv6Address dest);
62 * \brief Get destination address.
63 * \return destination address
65 Ipv6Address GetDestination () const;
68 * \brief Set source address.
69 * \param src IPv6 source address
71 void SetSource (Ipv6Address src);
74 * \brief Get source address.
75 * \return source address
77 Ipv6Address GetSource () const;
80 * \brief Set gateway address.
81 * \param gw IPv6 gateway address
83 void SetGateway (Ipv6Address gw);
86 * \brief Get gateway address.
87 * \return gateway address
89 Ipv6Address GetGateway () const;
92 * \brief Set output device for outgoing packets.
93 * \param outputDevice output device
95 void SetOutputDevice (Ptr<NetDevice> outputDevice);
98 * \brief Get output device.
99 * \return output device
101 Ptr<NetDevice> GetOutputDevice () const;
105 * \brief Destination address.
110 * \brief source address.
112 Ipv6Address m_source;
115 * \brief Gateway address.
117 Ipv6Address m_gateway;
120 * \brief Output device.
122 Ptr<NetDevice> m_outputDevice;
125 std::ostream& operator<< (std::ostream& os, Ipv6Route const& route);
128 * \ingroup ipv6Routing
129 * \class Ipv6MulticastRoute
130 * \brief IPv6 multicast route entry.
132 class Ipv6MulticastRoute : public SimpleRefCount<Ipv6MulticastRoute>
136 * \brief Maximum number of multicast interfaces on a router.
138 static const uint32_t MAX_INTERFACES = 16;
141 * \brief Maximum Time-To-Live (TTL).
143 static const uint32_t MAX_TTL = 255;
146 * \brief Constructor.
148 Ipv6MulticastRoute ();
153 virtual ~Ipv6MulticastRoute ();
156 * \brief Set IPv6 group.
157 * \param group Ipv6Address of the multicast group
159 void SetGroup (const Ipv6Address group);
162 * \brief Get IPv6 group.
163 * \return Ipv6Address of the multicast group
165 Ipv6Address GetGroup (void) const;
168 * \brief Set origin address.
169 * \param origin Ipv6Address of the origin address
171 void SetOrigin (const Ipv6Address origin);
174 * \brief Get source address.
175 * \return Ipv6Address of the origin address
177 Ipv6Address GetOrigin (void) const;
180 * \brief Set parent for this route.
181 * \param iif Parent (input interface) for this route
183 void SetParent (uint32_t iif);
186 * \brief Get parent for this route.
187 * \return Parent (input interface) for this route
189 uint32_t GetParent (void) const;
192 * \brief set output TTL for this route.
193 * \param oif Outgoing interface index
194 * \param ttl time-to-live for this route
196 void SetOutputTtl (uint32_t oif, uint32_t ttl);
199 * \brief Get output TTL for this route.
200 * \param oif outgoing interface
201 * \return TTL for this route
203 uint32_t GetOutputTtl (uint32_t oif) const;
212 * \brief IPv6 origin (source).
214 Ipv6Address m_origin;
217 * \brief Source interface.
224 std::vector<uint32_t> m_ttls;
227 std::ostream& operator<< (std::ostream& os, Ipv6MulticastRoute const& route);
229 } /* namespace ns3 */
231 #endif /* IPV6_ROUTE_H */