src/node/ipv4-route.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 04 Jul 2009 08:15:48 +0200
changeset 4654 2eaebe77d66b
parent 4526 4d3213e6eecd
permissions -rw-r--r--
Added tag ns-3.5 for changeset c975274c9707
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
     3
 * Copyright (c) 2009 University of Washington
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 */
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
#ifndef IPV4_ROUTE_H
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#define IPV4_ROUTE_H
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#include <list>
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
    23
#include <vector>
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <ostream>
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    26
#include "ns3/ref-count-base.h"
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
#include "ipv4-address.h"
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
namespace ns3 {
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    30
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    31
class NetDevice;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    32
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 236
diff changeset
    33
/**
4526
4d3213e6eecd fix doxygen collision
Tom Henderson <tomh@tomh.org>
parents: 4482
diff changeset
    34
 * \ingroup ipv4Routing
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    35
 *
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    36
 *\brief Ipv4 route cache entry (similar to Linux struct rtable)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    37
 *
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    38
 * This is a reference counted object.  In the future, we will add other 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    39
 * entries from struct dst_entry, struct rtable, and struct dst_ops as needed.
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 236
diff changeset
    40
 */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    41
class Ipv4Route : public RefCountBase {
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
public:
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
  Ipv4Route ();
1445
3fba36666488 Don't flood multicasts if no route found
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
    44
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    45
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    46
   * \param dest Destination Ipv4Address
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    47
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    48
  void SetDestination (Ipv4Address dest);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    49
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    50
   * \return Destination Ipv4Address of the route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    51
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    52
  Ipv4Address GetDestination (void) const;
1445
3fba36666488 Don't flood multicasts if no route found
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
    53
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    54
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    55
   * \param src Source Ipv4Address
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    56
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    57
  void SetSource (Ipv4Address src);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    58
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    59
   * \return Source Ipv4Address of the route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    60
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    61
  Ipv4Address GetSource (void) const;
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    63
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    64
   * \param gw Gateway (next hop) Ipv4Address
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    65
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    66
  void SetGateway (Ipv4Address gw);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    67
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    68
   * \return Ipv4Address of the gateway (next hop) 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    69
   */
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
  Ipv4Address GetGateway (void) const;
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    71
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    72
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    73
   * Equivalent in Linux to dst_entry.dev
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    74
   *
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    75
   * \param outputDevice pointer to NetDevice for outgoing packets
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    76
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    77
  void SetOutputDevice (Ptr<NetDevice> outputDevice);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    78
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    79
   * \return pointer to NetDevice for outgoing packets
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    80
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    81
  Ptr<NetDevice> GetOutputDevice (void) const;
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    83
#ifdef NOTYET
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    84
  // rtable.idev
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    85
  void SetInputIfIndex (uint32_t iif);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    86
  uint32_t GetInputIfIndex (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    87
#endif
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    88
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    89
private:
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    90
  Ipv4Address m_dest;
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    91
  Ipv4Address m_source;
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    92
  Ipv4Address m_gateway;
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    93
  Ptr<NetDevice> m_outputDevice;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    94
#ifdef NOTYET
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    95
  uint32_t m_inputIfIndex;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
    96
#endif
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    97
};
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    98
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    99
std::ostream& operator<< (std::ostream& os, Ipv4Route const& route);
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   100
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   101
/**
4526
4d3213e6eecd fix doxygen collision
Tom Henderson <tomh@tomh.org>
parents: 4482
diff changeset
   102
 * \ingroup ipv4Routing
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   103
 * 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   104
 * \brief Ipv4 multicast route cache entry (similar to Linux struct mfc_cache)
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   105
 */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   106
class Ipv4MulticastRoute : public RefCountBase {
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   107
public:
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   108
  Ipv4MulticastRoute ();
1445
3fba36666488 Don't flood multicasts if no route found
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   109
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   110
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   111
   * \param group Ipv4Address of the multicast group
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   112
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   113
  void SetGroup (const Ipv4Address group);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   114
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   115
   * \return Ipv4Address of the multicast group
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   116
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   117
  Ipv4Address GetGroup (void) const; 
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   118
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   119
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   120
   * \param origin Ipv4Address of the origin address
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   121
   */
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   122
  void SetOrigin (const Ipv4Address origin);
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   123
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   124
   * \return Ipv4Address of the origin address
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   125
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   126
  Ipv4Address GetOrigin (void) const; 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   127
  
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   128
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   129
   * \param iif Parent (input interface) for this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   130
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   131
  void SetParent (uint32_t iif);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   132
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   133
   * \return Parent (input interface) for this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   134
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   135
  uint32_t GetParent (void) const;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   136
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   137
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   138
   * \param oif Outgoing interface index
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   139
   * \param ttl time-to-live for this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   140
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   141
  void SetOutputTtl (uint32_t oif, uint32_t ttl);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   142
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   143
   * \param oif outgoing interface
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   144
   * \return TTL for this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   145
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   146
  uint32_t GetOutputTtl (uint32_t oif) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   147
  
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   148
  static const uint32_t MAX_INTERFACES = 16;  // Maximum number of multicast interfaces on a router
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   149
  static const uint32_t MAX_TTL = 255;  // Maximum time-to-live (TTL)
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   150
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   151
private:
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   152
  Ipv4Address m_group;      // Group 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   153
  Ipv4Address m_origin;     // Source of packet
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   154
  uint32_t m_parent;        // Source interface
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 3183
diff changeset
   155
  std::vector<uint32_t> m_ttls;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   156
};
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 633
diff changeset
   157
236
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   158
}//namespace ns3
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   159
5673656dc2e7 a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   160
#endif /* IPV4_ROUTE_H */