A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-routing-table-entry.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_ROUTING_TABLE_ENTRY_H
22 #define IPV6_ROUTING_TABLE_ENTRY_H
23 
24 #include <list>
25 #include <vector>
26 #include <ostream>
27 
28 #include "ns3/ipv6-address.h"
29 
30 namespace ns3
31 {
32 
38 {
39 public:
44 
50 
56 
61 
66  bool IsHost () const;
67 
72  Ipv6Address GetDest () const;
73 
78  Ipv6Address GetPrefixToUse () const;
79 
84  void SetPrefixToUse (Ipv6Address prefix);
85 
90  bool IsNetwork () const;
91 
96  Ipv6Address GetDestNetwork () const;
97 
103 
108  bool IsDefault () const;
109 
114  bool IsGateway () const;
115 
120  Ipv6Address GetGateway () const;
121 
126  uint32_t GetInterface () const;
127 
136  static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address ());
137 
144  static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, uint32_t interface);
145 
154  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface);
155 
165  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse);
166 
174  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, uint32_t interface);
175 
182  static Ipv6RoutingTableEntry CreateDefaultRoute (Ipv6Address nextHop, uint32_t interface);
183 
184 private:
192  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface);
193 
201  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, uint32_t interface, Ipv6Address prefixToUse);
202 
211  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface, Ipv6Address prefixToUse);
212 
219  Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Prefix prefix, uint32_t interface);
220 
227  Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Address gateway, uint32_t interface);
228 
234  Ipv6RoutingTableEntry (Ipv6Address dest, uint32_t interface);
235 
240 
245 
250 
254  uint32_t m_interface;
255 
260 
261 };
262 
263 std::ostream& operator<< (std::ostream& os, Ipv6RoutingTableEntry const& route);
264 
270 {
271 public:
276 
282 
288 
293  Ipv6Address GetOrigin () const;
294 
299  Ipv6Address GetGroup () const;
300 
305  uint32_t GetInputInterface () const;
306 
311  uint32_t GetNOutputInterfaces () const;
312 
318  uint32_t GetOutputInterface (uint32_t n) const;
319 
324  std::vector<uint32_t> GetOutputInterfaces () const;
325 
334  static Ipv6MulticastRoutingTableEntry CreateMulticastRoute (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
335 
336 private:
344  Ipv6MulticastRoutingTableEntry (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
345 
350 
355 
360 
364  std::vector<uint32_t> m_outputInterfaces;
365 };
366 
367 std::ostream& operator<< (std::ostream& os, Ipv6MulticastRoutingTableEntry const& route);
368 
369 } /* namespace ns3 */
370 
371 #endif /* IPV6_ROUTING_TABLE_ENTRY_H */
372