This file is indexed.

/usr/include/ns3.17/ns3/ipv6-routing-table-entry.h is in libns3-dev 3.17+dfsg-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2007-2009 Strasbourg University
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
 */

#ifndef IPV6_ROUTING_TABLE_ENTRY_H
#define IPV6_ROUTING_TABLE_ENTRY_H

#include <list>
#include <vector>
#include <ostream>

#include "ns3/ipv6-address.h"

namespace ns3
{

/**
 * \class Ipv6RoutingTableEntry
 * \brief A record of an IPv6 route.
 */
class Ipv6RoutingTableEntry 
{
public:
  /**
   * \brief Constructor.
   */
  Ipv6RoutingTableEntry ();

  /**
   * \brief Copy constructor.
   * \param route the route to copy
   */
  Ipv6RoutingTableEntry (Ipv6RoutingTableEntry const & route);

  /**
   * \brief Copy constructor.
   * \param route the route to copy
   */
  Ipv6RoutingTableEntry (Ipv6RoutingTableEntry const* route);

  /**
   * \brief Destructor
   */
  ~Ipv6RoutingTableEntry ();

  /**
   * \brief Is the route entry correspond to a host ?
   * \return true if the route is a host, false otherwise
   */
  bool IsHost () const;

  /**
   * \brief Get the destination.
   * \return the IPv6 address of the destination of this route
   */
  Ipv6Address GetDest () const;

  /**
   * \brief Get the prefix to use (for multihomed link).
   * \return prefix address to use
   */
  Ipv6Address GetPrefixToUse () const;

  /**
   * \brief Set the prefix to use.
   * \param prefix prefix to use
   */
  void SetPrefixToUse (Ipv6Address prefix);

  /**
   * \brief Is the route entry correspond to a network ? 
   * \return true if the route is a network, false otherwise
   */
  bool IsNetwork () const;

  /**
   * \brief Get the destination network.
   * \return the destination network
   */
  Ipv6Address GetDestNetwork () const;

  /**
   * \brief Get the destination prefix.
   * \return the destination prefix
   */
  Ipv6Prefix GetDestNetworkPrefix () const;

  /**
   * \brief Is it the default route ?
   * \return true if this route is a default route, false otherwise
   */
  bool IsDefault () const;

  /**
   * \brief Is it the gateway ? 
   * \return true if this route is a gateway, false otherwise
   */
  bool IsGateway () const;

  /**
   * \brief Get the gateway.
   * \return the IPv6 address of the gateway
   */
  Ipv6Address GetGateway () const;

  /**
   * \brief Get the interface index.
   * \return the index of the interface
   */
  uint32_t GetInterface () const;

  /**
   * \brief Create a route to a host.
   * \param dest destination address
   * \param nextHop next hop address to route the packet
   * \param interface interface index
   * \param prefixToUse prefix that should be used for source address for this destination
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address ());

  /**
   * \brief Create a route to a host.
   * \param dest destination address
   * \param interface interface index
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, uint32_t interface);

  /**
   * \brief Create a route to a network.
   * \param network network address
   * \param networkPrefix network prefix
   * \param nextHop next hop address to route the packet
   * \param interface interface index
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface);

  /**
   * \brief Create a route to a network.
   * \param network network address
   * \param networkPrefix network prefix
   * \param nextHop next hop address to route the packet
   * \param interface interface index
   * \param prefixToUse prefix that should be used for source address for this destination
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse);

  /**
   * \brief Create a route to a network.
   * \param network network address
   * \param networkPrefix network prefix
   * \param interface interface index
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, uint32_t interface);

  /**
   * \brief Create a default route.
   * \param nextHop next hop address to route the packet
   * \param interface interface index
   * \return IPv6Route object
   */
  static Ipv6RoutingTableEntry CreateDefaultRoute (Ipv6Address nextHop, uint32_t interface);

private:
  /**
   * \brief Constructor.
   * \param network network address
   * \param prefix network prefix
   * \param gateway the gateway
   * \param interface the interface index
   */
  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface);

  /**
   * \brief Constructor.
   * \param network network address
   * \param prefix network prefix
   * \param interface the interface index
   * \param prefixToUse prefix to use
   */
  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, uint32_t interface, Ipv6Address prefixToUse);

  /**
   * \brief Constructor.
   * \param network network address
   * \param prefix network prefix
   * \param gateway the gateway
   * \param interface the interface index
   * \param prefixToUse prefix to use
   */
  Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface, Ipv6Address prefixToUse);

  /**
   * \brief Constructor.
   * \param dest destination address
   * \param prefix destination prefix
   * \param interface interface index
   */
  Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Prefix prefix, uint32_t interface);

  /**
   * \brief Constructor.
   * \param dest destination address
   * \param gateway the gateway
   * \param interface interface index
   */
  Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Address gateway, uint32_t interface);

  /**
   * \brief Constructor.
   * \param dest destination address
   * \param interface interface index
   */
  Ipv6RoutingTableEntry (Ipv6Address dest, uint32_t interface);

  /**
   * \brief IPv6 address of the destination.
   */
  Ipv6Address m_dest;

  /**
   * \brief IPv6 prefix of the destination
   */
  Ipv6Prefix m_destNetworkPrefix;

  /**
   * \brief IPv6 address of the gateway.
   */
  Ipv6Address m_gateway;

  /**
   * \brief The interface index.
   */
  uint32_t m_interface;

  /**
   * \brief Prefix to use.
   */
  Ipv6Address m_prefixToUse;

};

std::ostream& operator<< (std::ostream& os, Ipv6RoutingTableEntry const& route);

/**
 * \class Ipv6MulticastRoutingTableEntry
 * \brief A record of an IPv6 multicast route.
 */
class Ipv6MulticastRoutingTableEntry
{
public:
  /**
   * \brief Constructor.
   */
  Ipv6MulticastRoutingTableEntry ();

  /**
   * \brief Copy constructor.
   * \param route the route to copy
   */
  Ipv6MulticastRoutingTableEntry (Ipv6MulticastRoutingTableEntry const & route);

  /**
   * \brief Copy constructor.
   * \param route the route to copy
   */
  Ipv6MulticastRoutingTableEntry (Ipv6MulticastRoutingTableEntry const* route);

  /**
   * \brief Get the source of this route
   * \return IPv6 address of the source of this route
   */
  Ipv6Address GetOrigin () const;

  /**
   * \brief Get the group.
   * \return IPv6 address of the multicast group of this route
   */
  Ipv6Address GetGroup () const;

  /**
   * \brief Get the input interface address.
   * \return input interface index
   */
  uint32_t GetInputInterface () const;

  /**
   * \brief Get the number of output interfaces of this route.
   * \return number of output interfaces of this route.
   */
  uint32_t GetNOutputInterfaces () const;

  /**
   * \brief Get a specified output interface.
   * \param n index
   * \return a specified output interface
   */
  uint32_t GetOutputInterface (uint32_t n) const;

  /**
   * \brief Get all of the output interfaces of this route.
   * \return a vector of all output interfaces of this route
   */
  std::vector<uint32_t> GetOutputInterfaces () const;

  /**
   * \brief Create a multicast route.
   * \param origin IPv6 address of the origin source
   * \param group Ipv6Address of the group
   * \param inputInterface interface number
   * \param outputInterfaces list of output interface number
   * \return a multicast route
   */
  static Ipv6MulticastRoutingTableEntry CreateMulticastRoute (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);

private:
  /**
   * \brief Constructor.
   * \param origin IPv6 address of the source
   * \param group IPv6 address of the group
   * \param inputInterface interface number
   * \param outputInterfaces list of output interface number
   */
  Ipv6MulticastRoutingTableEntry (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);

  /**
   * \brief The IPv6 address of the source.
   */
  Ipv6Address m_origin;

  /**
   * \brief The IPv6 address of the group.
   */
  Ipv6Address m_group;

  /**
   * \brief The input interface.
   */
  uint32_t m_inputInterface;

  /**
   * \brief The output interfaces.
   */
  std::vector<uint32_t> m_outputInterfaces;
};

std::ostream& operator<< (std::ostream& os, Ipv6MulticastRoutingTableEntry const& route);

} /* namespace ns3 */

#endif /* IPV6_ROUTING_TABLE_ENTRY_H */