author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Tue, 26 Oct 2010 18:02:17 +0100 | |
changeset 6648 | d1785ce489c5 |
parent 5362 | src/helper/ipv6-static-routing-helper.h@d31f56c9b7cb |
permissions | -rw-r--r-- |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
2 |
/* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2009 University of Washington |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
4 |
* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
8 |
* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
13 |
* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
17 |
*/ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
18 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
19 |
#ifndef IPV6_STATIC_ROUTING_HELPER_H |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
20 |
#define IPV6_STATIC_ROUTING_HELPER_H |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
21 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
22 |
#include "ns3/ipv6.h" |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
23 |
#include "ns3/ipv6-static-routing.h" |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
24 |
#include "ns3/ptr.h" |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
25 |
#include "ns3/ipv6-address.h" |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
26 |
#include "ns3/node.h" |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
27 |
#include "ns3/net-device.h" |
5217
8a9dbc333e76
Export more IPv6 includes.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
4731
diff
changeset
|
28 |
|
6648
d1785ce489c5
Module layout rework for static-routing, list-routing, global-routing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5362
diff
changeset
|
29 |
#include "ns3/node-container.h" |
d1785ce489c5
Module layout rework for static-routing, list-routing, global-routing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5362
diff
changeset
|
30 |
#include "ns3/net-device-container.h" |
d1785ce489c5
Module layout rework for static-routing, list-routing, global-routing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5362
diff
changeset
|
31 |
#include "ns3/ipv6-routing-helper.h" |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
32 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
33 |
namespace ns3 { |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
34 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
35 |
/** |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
36 |
* \brief Helper class that adds ns3::Ipv6StaticRouting objects |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
37 |
* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
38 |
* This class is expected to be used in conjunction with |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
39 |
* ns3::InternetStackHelper::SetRoutingHelper |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
40 |
*/ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
41 |
class Ipv6StaticRoutingHelper : public Ipv6RoutingHelper |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
42 |
{ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
43 |
public: |
5225
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
44 |
/** |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
45 |
* \brief Constructor. |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
46 |
*/ |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
47 |
Ipv6StaticRoutingHelper (); |
5362 | 48 |
|
49 |
/** |
|
50 |
* \brief Construct an Ipv6ListRoutingHelper from another previously |
|
51 |
* initialized instance (Copy Constructor). |
|
52 |
*/ |
|
5353
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
53 |
Ipv6StaticRoutingHelper (const Ipv6StaticRoutingHelper &); |
5362 | 54 |
|
5353
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
55 |
/** |
5362 | 56 |
* \internal |
5353
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
57 |
* \returns pointer to clone of this Ipv6StaticRoutingHelper |
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
58 |
* |
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
59 |
* This method is mainly for internal use by the other helpers; |
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
60 |
* clients are expected to free the dynamic memory allocated by this method |
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
61 |
*/ |
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
62 |
Ipv6StaticRoutingHelper* Copy (void) const; |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
63 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
64 |
/** |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
65 |
* \param node the node on which the routing protocol will run |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
66 |
* \returns a newly-created routing protocol |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
67 |
* |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
68 |
* This method will be called by ns3::InternetStackHelper::Install |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
69 |
*/ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
70 |
virtual Ptr<Ipv6RoutingProtocol> Create (Ptr<Node> node) const; |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
71 |
|
5225
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
72 |
/** |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
73 |
* \brief Get Ipv6StaticRouting pointer from IPv6 stack. |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
74 |
* \param ipv6 Ipv6 pointer |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
75 |
* \return Ipv6StaticRouting pointer or 0 if not exist |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5217
diff
changeset
|
76 |
*/ |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
77 |
Ptr<Ipv6StaticRouting> GetStaticRouting (Ptr<Ipv6> ipv6) const; |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
78 |
|
5362 | 79 |
/** |
80 |
* \brief Add a multicast route to a node and net device using explicit |
|
81 |
* Ptr<Node> and Ptr<NetDevice> |
|
82 |
*/ |
|
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
83 |
void AddMulticastRoute (Ptr<Node> n, Ipv6Address source, Ipv6Address group, |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
84 |
Ptr<NetDevice> input, NetDeviceContainer output); |
5362 | 85 |
|
86 |
/** |
|
87 |
* \brief Add a multicast route to a node and device using a name string |
|
88 |
* previously associated to the node using the Object Name Service and a |
|
89 |
* Ptr<NetDevice> |
|
90 |
*/ |
|
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
91 |
void AddMulticastRoute (std::string n, Ipv6Address source, Ipv6Address group, |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
92 |
Ptr<NetDevice> input, NetDeviceContainer output); |
5362 | 93 |
|
94 |
/** |
|
95 |
* \brief Add a multicast route to a node and device using a Ptr<Node> and a |
|
96 |
* name string previously associated to the device using the Object Name Service. |
|
97 |
*/ |
|
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
98 |
void AddMulticastRoute (Ptr<Node> n, Ipv6Address source, Ipv6Address group, |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
99 |
std::string inputName, NetDeviceContainer output); |
5362 | 100 |
|
101 |
/** |
|
102 |
* \brief Add a multicast route to a node and device using name strings |
|
103 |
* previously associated to both the node and device using the Object Name |
|
104 |
* Service. |
|
105 |
*/ |
|
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
106 |
void AddMulticastRoute (std::string nName, Ipv6Address source, Ipv6Address group, |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
107 |
std::string inputName, NetDeviceContainer output); |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
108 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
109 |
#if 0 |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
110 |
/** |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
111 |
* \brief Add a default route to the static routing protocol to forward |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
112 |
* packets out a particular interface |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
113 |
*/ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
114 |
void SetDefaultMulticastRoute (Ptr<Node> n, Ptr<NetDevice> nd); |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
115 |
void SetDefaultMulticastRoute (Ptr<Node> n, std::string ndName); |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
116 |
void SetDefaultMulticastRoute (std::string nName, Ptr<NetDevice> nd); |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
117 |
void SetDefaultMulticastRoute (std::string nName, std::string ndName); |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
118 |
#endif |
5353
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
119 |
private: |
5362 | 120 |
/** |
121 |
* \internal |
|
122 |
* \brief Assignment operator declared private and not implemented to disallow |
|
123 |
* assignment and prevent the compiler from happily inserting its own. |
|
124 |
*/ |
|
5353
a63513286aa0
Fix memory management of routing helpers (bug 678)
Tom Henderson <tomh@tomh.org>
parents:
5225
diff
changeset
|
125 |
Ipv6StaticRoutingHelper &operator = (const Ipv6StaticRoutingHelper &o); |
4731
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
126 |
}; |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
127 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
128 |
} // namespace ns3 |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
129 |
|
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
130 |
#endif /* IPV6_STATIC_ROUTING_HELPER_H */ |
510db8599bfb
second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
131 |