A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ipv6-route.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2009 Strasbourg University
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18 */
19
20#ifndef IPV6_ROUTE_H
21#define IPV6_ROUTE_H
22
23#include "ns3/ipv6-address.h"
24#include "ns3/simple-ref-count.h"
25
26#include <list>
27#include <map>
28#include <ostream>
29
30namespace ns3
31{
32
33class NetDevice;
34
40class Ipv6Route : public SimpleRefCount<Ipv6Route>
41{
42 public:
46 Ipv6Route();
47
51 virtual ~Ipv6Route();
52
57 void SetDestination(Ipv6Address dest);
58
64
69 void SetSource(Ipv6Address src);
70
75 Ipv6Address GetSource() const;
76
81 void SetGateway(Ipv6Address gw);
82
87 Ipv6Address GetGateway() const;
88
93 void SetOutputDevice(Ptr<NetDevice> outputDevice);
94
100
101 private:
106
111
116
121};
122
130std::ostream& operator<<(std::ostream& os, const Ipv6Route& route);
131
137class Ipv6MulticastRoute : public SimpleRefCount<Ipv6MulticastRoute>
138{
139 public:
143 static const uint32_t MAX_INTERFACES = 16;
144
148 static const uint32_t MAX_TTL = 255;
149
154
158 virtual ~Ipv6MulticastRoute();
159
164 void SetGroup(const Ipv6Address group);
165
170 Ipv6Address GetGroup() const;
171
176 void SetOrigin(const Ipv6Address origin);
177
182 Ipv6Address GetOrigin() const;
183
188 void SetParent(uint32_t iif);
189
194 uint32_t GetParent() const;
195
201 void SetOutputTtl(uint32_t oif, uint32_t ttl);
202
206 std::map<uint32_t, uint32_t> GetOutputTtlMap() const;
207
208 private:
213
218
223
227 std::map<uint32_t, uint32_t> m_ttls;
228};
229
237std::ostream& operator<<(std::ostream& os, const Ipv6MulticastRoute& route);
238
239} /* namespace ns3 */
240
241#endif /* IPV6_ROUTE_H */
Describes an IPv6 address.
Definition: ipv6-address.h:49
IPv6 multicast route entry.
Definition: ipv6-route.h:138
void SetOrigin(const Ipv6Address origin)
Set origin address.
Definition: ipv6-route.cc:115
std::map< uint32_t, uint32_t > GetOutputTtlMap() const
Definition: ipv6-route.cc:158
Ipv6Address m_origin
IPv6 origin (source).
Definition: ipv6-route.h:217
Ipv6Address GetOrigin() const
Get source address.
Definition: ipv6-route.cc:121
static const uint32_t MAX_TTL
Maximum Time-To-Live (TTL).
Definition: ipv6-route.h:148
Ipv6MulticastRoute()
Constructor.
Definition: ipv6-route.cc:93
static const uint32_t MAX_INTERFACES
Maximum number of multicast interfaces on a router.
Definition: ipv6-route.h:143
Ipv6Address m_group
IPv6 group.
Definition: ipv6-route.h:212
uint32_t GetParent() const
Get parent for this route.
Definition: ipv6-route.cc:133
void SetParent(uint32_t iif)
Set parent for this route.
Definition: ipv6-route.cc:127
uint32_t m_parent
Source interface.
Definition: ipv6-route.h:222
std::map< uint32_t, uint32_t > m_ttls
TTLs.
Definition: ipv6-route.h:227
void SetGroup(const Ipv6Address group)
Set IPv6 group.
Definition: ipv6-route.cc:103
Ipv6Address GetGroup() const
Get IPv6 group.
Definition: ipv6-route.cc:109
void SetOutputTtl(uint32_t oif, uint32_t ttl)
set output TTL for this route.
Definition: ipv6-route.cc:139
virtual ~Ipv6MulticastRoute()
Destructor.
Definition: ipv6-route.cc:98
IPv6 route cache entry.
Definition: ipv6-route.h:41
void SetGateway(Ipv6Address gw)
Set gateway address.
Definition: ipv6-route.cc:62
void SetSource(Ipv6Address src)
Set source address.
Definition: ipv6-route.cc:50
virtual ~Ipv6Route()
Destructor.
Definition: ipv6-route.cc:33
Ipv6Address GetDestination() const
Get destination address.
Definition: ipv6-route.cc:44
void SetDestination(Ipv6Address dest)
Set destination address.
Definition: ipv6-route.cc:38
Ptr< NetDevice > m_outputDevice
Output device.
Definition: ipv6-route.h:120
Ipv6Address GetSource() const
Get source address.
Definition: ipv6-route.cc:56
Ipv6Address m_source
source address.
Definition: ipv6-route.h:110
Ipv6Address m_dest
Destination address.
Definition: ipv6-route.h:105
Ptr< NetDevice > GetOutputDevice() const
Get output device.
Definition: ipv6-route.cc:80
Ipv6Address m_gateway
Gateway address.
Definition: ipv6-route.h:115
Ipv6Address GetGateway() const
Get gateway address.
Definition: ipv6-route.cc:68
Ipv6Route()
Constructor.
Definition: ipv6-route.cc:29
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Set output device for outgoing packets.
Definition: ipv6-route.cc:74
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
A template-based reference counting class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129