This file is indexed.

/usr/include/ns3.17/ns3/ipv4-route.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
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2009 University of Washington
 *
 * 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
 *
 */
#ifndef IPV4_ROUTE_H
#define IPV4_ROUTE_H

#include <list>
#include <map>
#include <ostream>

#include "ns3/simple-ref-count.h"
#include "ns3/ipv4-address.h"
#include "ns3/deprecated.h"

namespace ns3 {

class NetDevice;

/**
 * \ingroup ipv4Routing
 *
 *\brief Ipv4 route cache entry (similar to Linux struct rtable)
 *
 * This is a reference counted object.  In the future, we will add other 
 * entries from struct dst_entry, struct rtable, and struct dst_ops as needed.
 */
class Ipv4Route : public SimpleRefCount<Ipv4Route> 
{
public:
  Ipv4Route ();

  /**
   * \param dest Destination Ipv4Address
   */
  void SetDestination (Ipv4Address dest);
  /**
   * \return Destination Ipv4Address of the route
   */
  Ipv4Address GetDestination (void) const;

  /**
   * \param src Source Ipv4Address
   */
  void SetSource (Ipv4Address src);
  /**
   * \return Source Ipv4Address of the route
   */
  Ipv4Address GetSource (void) const;

  /**
   * \param gw Gateway (next hop) Ipv4Address
   */
  void SetGateway (Ipv4Address gw);
  /**
   * \return Ipv4Address of the gateway (next hop) 
   */
  Ipv4Address GetGateway (void) const;

  /**
   * Equivalent in Linux to dst_entry.dev
   *
   * \param outputDevice pointer to NetDevice for outgoing packets
   */
  void SetOutputDevice (Ptr<NetDevice> outputDevice);
  /**
   * \return pointer to NetDevice for outgoing packets
   */
  Ptr<NetDevice> GetOutputDevice (void) const;

#ifdef NOTYET
  // rtable.idev
  void SetInputIfIndex (uint32_t iif);
  uint32_t GetInputIfIndex (void) const;
#endif

private:
  Ipv4Address m_dest;
  Ipv4Address m_source;
  Ipv4Address m_gateway;
  Ptr<NetDevice> m_outputDevice;
#ifdef NOTYET
  uint32_t m_inputIfIndex;
#endif
};

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

/**
 * \ingroup ipv4Routing
 * 
 * \brief Ipv4 multicast route cache entry (similar to Linux struct mfc_cache)
 */
class Ipv4MulticastRoute : public SimpleRefCount<Ipv4MulticastRoute> 
{
public:
  Ipv4MulticastRoute ();

  /**
   * \param group Ipv4Address of the multicast group
   */
  void SetGroup (const Ipv4Address group);
  /**
   * \return Ipv4Address of the multicast group
   */
  Ipv4Address GetGroup (void) const; 

  /**
   * \param origin Ipv4Address of the origin address
   */
  void SetOrigin (const Ipv4Address origin);
  /**
   * \return Ipv4Address of the origin address
   */
  Ipv4Address GetOrigin (void) const; 

  /**
   * \param iif Parent (input interface) for this route
   */
  void SetParent (uint32_t iif);
  /**
   * \return Parent (input interface) for this route
   */
  uint32_t GetParent (void) const;

  /**
   * \param oif Outgoing interface index
   * \param ttl time-to-live for this route
   */
  void SetOutputTtl (uint32_t oif, uint32_t ttl);
  /**
   * \param oif outgoing interface
   * \return TTL for this route
   */
  uint32_t GetOutputTtl (uint32_t oif) NS_DEPRECATED;

  /**
   * \return map of output interface Ids and TTLs for this route
   */
  std::map<uint32_t, uint32_t> GetOutputTtlMap () const;

  static const uint32_t MAX_INTERFACES = 16;  // Maximum number of multicast interfaces on a router
  static const uint32_t MAX_TTL = 255;  // Maximum time-to-live (TTL)

private:
  Ipv4Address m_group;      // Group 
  Ipv4Address m_origin;     // Source of packet
  uint32_t m_parent;        // Source interface
  std::map<uint32_t, uint32_t> m_ttls;
};

} // namespace ns3

#endif /* IPV4_ROUTE_H */