A Discrete-Event Network Simulator
API
ipv6-routing-table-entry.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_ROUTING_TABLE_ENTRY_H
21 #define IPV6_ROUTING_TABLE_ENTRY_H
22 
23 #include "ns3/ipv6-address.h"
24 
25 #include <list>
26 #include <ostream>
27 #include <vector>
28 
29 namespace ns3
30 {
31 
38 {
39  public:
44 
50 
56 
60  virtual ~Ipv6RoutingTableEntry();
61 
66  bool IsHost() const;
67 
72  Ipv6Address GetDest() const;
73 
79 
84  void SetPrefixToUse(Ipv6Address prefix);
85 
90  bool IsNetwork() const;
91 
97 
103 
108  bool IsDefault() const;
109 
114  bool IsGateway() const;
115 
120  Ipv6Address GetGateway() const;
121 
126  uint32_t GetInterface() const;
127 
137  Ipv6Address nextHop,
138  uint32_t interface,
139  Ipv6Address prefixToUse = Ipv6Address());
140 
147  static Ipv6RoutingTableEntry CreateHostRouteTo(Ipv6Address dest, uint32_t interface);
148 
158  Ipv6Prefix networkPrefix,
159  Ipv6Address nextHop,
160  uint32_t interface);
161 
172  Ipv6Prefix networkPrefix,
173  Ipv6Address nextHop,
174  uint32_t interface,
175  Ipv6Address prefixToUse);
176 
185  Ipv6Prefix networkPrefix,
186  uint32_t interface);
187 
194  static Ipv6RoutingTableEntry CreateDefaultRoute(Ipv6Address nextHop, uint32_t interface);
195 
196  private:
205  Ipv6Prefix prefix,
206  Ipv6Address gateway,
207  uint32_t interface);
208 
217  Ipv6Prefix prefix,
218  uint32_t interface,
219  Ipv6Address prefixToUse);
220 
230  Ipv6Prefix prefix,
231  Ipv6Address gateway,
232  uint32_t interface,
233  Ipv6Address prefixToUse);
234 
241  Ipv6RoutingTableEntry(Ipv6Address dest, Ipv6Prefix prefix, uint32_t interface);
242 
249  Ipv6RoutingTableEntry(Ipv6Address dest, Ipv6Address gateway, uint32_t interface);
250 
256  Ipv6RoutingTableEntry(Ipv6Address dest, uint32_t interface);
257 
262 
267 
272 
276  uint32_t m_interface;
277 
282 };
283 
291 std::ostream& operator<<(std::ostream& os, const Ipv6RoutingTableEntry& route);
292 
299 {
300  public:
305 
311 
317 
322  Ipv6Address GetOrigin() const;
323 
328  Ipv6Address GetGroup() const;
329 
334  uint32_t GetInputInterface() const;
335 
340  uint32_t GetNOutputInterfaces() const;
341 
347  uint32_t GetOutputInterface(uint32_t n) const;
348 
353  std::vector<uint32_t> GetOutputInterfaces() const;
354 
364  Ipv6Address origin,
365  Ipv6Address group,
366  uint32_t inputInterface,
367  std::vector<uint32_t> outputInterfaces);
368 
369  private:
378  Ipv6Address group,
379  uint32_t inputInterface,
380  std::vector<uint32_t> outputInterfaces);
381 
386 
391 
396 
400  std::vector<uint32_t> m_outputInterfaces;
401 };
402 
410 std::ostream& operator<<(std::ostream& os, const Ipv6MulticastRoutingTableEntry& route);
411 
412 } /* namespace ns3 */
413 
414 #endif /* IPV6_ROUTING_TABLE_ENTRY_H */
Describes an IPv6 address.
Definition: ipv6-address.h:49
A record of an IPv6 multicast route.
uint32_t GetInputInterface() const
Get the input interface address.
uint32_t GetOutputInterface(uint32_t n) const
Get a specified output interface.
Ipv6Address GetGroup() const
Get the group.
uint32_t m_inputInterface
The input interface.
Ipv6MulticastRoutingTableEntry()
Constructor.
std::vector< uint32_t > GetOutputInterfaces() const
Get all of the output interfaces of this route.
static Ipv6MulticastRoutingTableEntry CreateMulticastRoute(Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
Create a multicast route.
std::vector< uint32_t > m_outputInterfaces
The output interfaces.
uint32_t GetNOutputInterfaces() const
Get the number of output interfaces of this route.
Ipv6Address GetOrigin() const
Get the source of this route.
Ipv6Address m_group
The IPv6 address of the group.
Ipv6Address m_origin
The IPv6 address of the source.
Describes an IPv6 prefix.
Definition: ipv6-address.h:455
A record of an IPv6 route.
bool IsNetwork() const
Is the route entry correspond to a network ?
static Ipv6RoutingTableEntry CreateDefaultRoute(Ipv6Address nextHop, uint32_t interface)
Create a default route.
Ipv6Address m_gateway
IPv6 address of the gateway.
bool IsDefault() const
Is it the default route ?
Ipv6RoutingTableEntry()
Constructor.
Ipv6Address GetDest() const
Get the destination.
Ipv6Address GetDestNetwork() const
Get the destination network.
Ipv6Address GetPrefixToUse() const
Get the prefix to use (for multihomed link).
Ipv6Address m_dest
IPv6 address of the destination.
static Ipv6RoutingTableEntry CreateHostRouteTo(Ipv6Address dest, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address())
Create a route to a host.
bool IsHost() const
Is the route entry correspond to a host ?
void SetPrefixToUse(Ipv6Address prefix)
Set the prefix to use.
uint32_t GetInterface() const
Get the interface index.
Ipv6Address m_prefixToUse
Prefix to use.
Ipv6Prefix m_destNetworkPrefix
IPv6 prefix of the destination.
virtual ~Ipv6RoutingTableEntry()
Destructor.
uint32_t m_interface
The interface index.
Ipv6Prefix GetDestNetworkPrefix() const
Get the destination prefix.
static Ipv6RoutingTableEntry CreateNetworkRouteTo(Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface)
Create a route to a network.
Ipv6Address GetGateway() const
Get the gateway.
bool IsGateway() const
Is it the gateway ?
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:159