A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-route.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007-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 IPV6_ROUTE_H
22 #define IPV6_ROUTE_H
23 
24 #include <list>
25 #include <map>
26 #include <ostream>
27 
28 #include "ns3/simple-ref-count.h"
29 
30 #include "ns3/ipv6-address.h"
31 #include "ns3/deprecated.h"
32 
33 namespace ns3
34 {
35 
36 class NetDevice;
37 
43 class Ipv6Route : public SimpleRefCount<Ipv6Route>
44 {
45 public:
49  Ipv6Route ();
50 
54  virtual ~Ipv6Route ();
55 
60  void SetDestination (Ipv6Address dest);
61 
66  Ipv6Address GetDestination () const;
67 
72  void SetSource (Ipv6Address src);
73 
78  Ipv6Address GetSource () const;
79 
84  void SetGateway (Ipv6Address gw);
85 
90  Ipv6Address GetGateway () const;
91 
96  void SetOutputDevice (Ptr<NetDevice> outputDevice);
97 
103 
104 private:
109 
114 
119 
124 };
125 
126 std::ostream& operator<< (std::ostream& os, Ipv6Route const& route);
127 
133 class Ipv6MulticastRoute : public SimpleRefCount<Ipv6MulticastRoute>
134 {
135 public:
139  static const uint32_t MAX_INTERFACES = 16;
140 
144  static const uint32_t MAX_TTL = 255;
145 
150 
154  virtual ~Ipv6MulticastRoute ();
155 
160  void SetGroup (const Ipv6Address group);
161 
166  Ipv6Address GetGroup (void) const;
167 
172  void SetOrigin (const Ipv6Address origin);
173 
178  Ipv6Address GetOrigin (void) const;
179 
184  void SetParent (uint32_t iif);
185 
190  uint32_t GetParent (void) const;
191 
197  void SetOutputTtl (uint32_t oif, uint32_t ttl);
198 
204  uint32_t GetOutputTtl (uint32_t oif) NS_DEPRECATED;
205 
209  std::map<uint32_t, uint32_t> GetOutputTtlMap () const;
210 
211 private:
216 
221 
225  uint32_t m_parent;
226 
230  std::map<uint32_t, uint32_t> m_ttls;
231 };
232 
233 std::ostream& operator<< (std::ostream& os, Ipv6MulticastRoute const& route);
234 
235 } /* namespace ns3 */
236 
237 #endif /* IPV6_ROUTE_H */
238