src/internet/model/ipv4-routing-table-entry.h
author Adrian S Tam <adrian.sw.tam@gmail.com>
Wed, 07 Dec 2011 11:22:10 -0500
changeset 7619 b4dee6307aa7
parent 7386 2310ed220a61
child 10440 1e48ff9185f1
permissions -rw-r--r--
Nagle's algorithm in TCP (closes bug 1039)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7233
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
/*
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
 * Copyright (c) 2005 INRIA
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
#ifndef IPV4_ROUTING_TABLE_ENTRY_H
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    21
#define IPV4_ROUTING_TABLE_ENTRY_H
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    22
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
#include <list>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
#include <vector>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
#include <ostream>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    26
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
#include "ns3/ipv4-address.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
namespace ns3 {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    30
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    31
/**
7233
be0d7443b4ff Updated the modules doxygen page
Mitch Watrous <watrous@u.washington.edu>
parents: 7176
diff changeset
    32
 * \ingroup internet
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    33
 *
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    34
 * A record of an IPv4 routing table entry for Ipv4GlobalRouting and 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    35
 * Ipv4StaticRouting.  This is not a reference counted object.
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
class Ipv4RoutingTableEntry {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
public:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    40
   * \brief This constructor does nothing
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    41
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    42
  Ipv4RoutingTableEntry ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    43
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    44
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    45
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    46
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    47
  Ipv4RoutingTableEntry (Ipv4RoutingTableEntry const &route);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    48
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    49
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    50
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    51
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    52
  Ipv4RoutingTableEntry (Ipv4RoutingTableEntry const *route);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    53
  /**
6298
0618636501ad Fix minor doxygen error
Tom Henderson <tomh@tomh.org>
parents: 5227
diff changeset
    54
   * \return True if this route is a host route (mask of all ones); false otherwise
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    55
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    56
  bool IsHost (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    57
  /**
6298
0618636501ad Fix minor doxygen error
Tom Henderson <tomh@tomh.org>
parents: 5227
diff changeset
    58
   * \return True if this route is not a host route (mask is not all ones); false otherwise
0618636501ad Fix minor doxygen error
Tom Henderson <tomh@tomh.org>
parents: 5227
diff changeset
    59
   *
0618636501ad Fix minor doxygen error
Tom Henderson <tomh@tomh.org>
parents: 5227
diff changeset
    60
   * This method is implemented as !IsHost ().
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    61
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    62
  bool IsNetwork (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    63
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    64
   * \return True if this route is a default route; false otherwise
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    65
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    66
  bool IsDefault (void) const;
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 True if this route is a gateway route; false otherwise
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    69
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    70
  bool IsGateway (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    71
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    72
   * \return address of the gateway stored in this entry
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    73
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    74
  Ipv4Address GetGateway (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    75
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    76
   * \return The IPv4 address of the destination of this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    77
   */
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    78
  Ipv4Address GetDest (void) const;
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    79
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    80
   * \return The IPv4 network number of the destination of this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    81
   */
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    82
  Ipv4Address GetDestNetwork (void) const;
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    83
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    84
   * \return The IPv4 network mask of the destination of this route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    85
   */
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    86
  Ipv4Mask GetDestNetworkMask (void) const;
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    87
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    88
   * \return The Ipv4 interface number used for sending outgoing packets
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    89
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
  uint32_t GetInterface (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    91
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    92
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    93
   * \param dest Ipv4Address of the destination
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    94
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    95
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    96
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
  static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    98
                                                  Ipv4Address nextHop,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    99
                                                  uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   100
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   101
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   102
   * \param dest Ipv4Address of the destination
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   103
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   104
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   105
  static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   106
                                                  uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   107
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   108
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   109
   * \param network Ipv4Address of the destination network
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   110
   * \param networkMask Ipv4Mask of the destination network mask
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   111
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   112
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   113
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
  static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   115
                                                     Ipv4Mask networkMask,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   116
                                                     Ipv4Address nextHop,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   117
                                                     uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   118
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   119
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   120
   * \param network Ipv4Address of the destination network
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   121
   * \param networkMask Ipv4Mask of the destination network mask
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   122
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   123
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
  static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   125
                                                     Ipv4Mask networkMask,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   126
                                                     uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   127
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   128
   * \return An Ipv4RoutingTableEntry object corresponding to the input 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   129
   * parameters.  This route is distinguished; it will match any 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   130
   * destination for which a more specific route does not exist.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   131
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   132
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   133
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   134
  static Ipv4RoutingTableEntry CreateDefaultRoute (Ipv4Address nextHop, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   135
                                                   uint32_t interface);
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   136
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   137
private:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   138
  Ipv4RoutingTableEntry (Ipv4Address network,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   139
                         Ipv4Mask mask,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   140
                         Ipv4Address gateway,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   141
                         uint32_t interface);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   142
  Ipv4RoutingTableEntry (Ipv4Address dest,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   143
                         Ipv4Mask mask,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   144
                         uint32_t interface);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   145
  Ipv4RoutingTableEntry (Ipv4Address dest,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   146
                         Ipv4Address gateway,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   147
                         uint32_t interface);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   148
  Ipv4RoutingTableEntry (Ipv4Address dest,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   149
                         uint32_t interface);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   150
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   151
  Ipv4Address m_dest;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   152
  Ipv4Mask m_destNetworkMask;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   153
  Ipv4Address m_gateway;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   154
  uint32_t m_interface;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   155
};
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   156
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   157
std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   158
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   159
/**
7233
be0d7443b4ff Updated the modules doxygen page
Mitch Watrous <watrous@u.washington.edu>
parents: 7176
diff changeset
   160
 * \ingroup internet
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   161
 *
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   162
 * \brief A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   163
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   164
class Ipv4MulticastRoutingTableEntry {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   165
public:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   166
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   167
   * \brief This constructor does nothing
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   168
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   169
  Ipv4MulticastRoutingTableEntry ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   170
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   171
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   172
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   173
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   174
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   175
  Ipv4MulticastRoutingTableEntry (Ipv4MulticastRoutingTableEntry const &route);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   176
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   177
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   178
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   179
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   180
  Ipv4MulticastRoutingTableEntry (Ipv4MulticastRoutingTableEntry const *route);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   181
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   182
   * \return The IPv4 address of the source of this route
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   183
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   184
  Ipv4Address GetOrigin (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   185
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   186
   * \return The IPv4 address of the multicast group of this route
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   187
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   188
  Ipv4Address GetGroup (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   189
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   190
   * \return The IPv4 address of the input interface of this route
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   191
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   192
  uint32_t GetInputInterface (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   193
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   194
   * \return The number of output interfaces of this route
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   195
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   196
  uint32_t GetNOutputInterfaces (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   197
  /**
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4673
diff changeset
   198
   * \param n interface index
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   199
   * \return A specified output interface.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   200
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   201
  uint32_t GetOutputInterface (uint32_t n) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   202
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   203
   * \return A vector of all of the output interfaces of this route.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   204
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   205
  std::vector<uint32_t> GetOutputInterfaces (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   206
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   207
   * \return Ipv4MulticastRoutingTableEntry corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   208
   * \param origin Source address for the multicast route 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   209
   * \param group Group destination address for the multicast route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   210
   * \param inputInterface Input interface that multicast datagram must be received on
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   211
   * \param outputInterfaces vector of output interfaces to copy and forward the datagram to
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   212
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   213
  static Ipv4MulticastRoutingTableEntry CreateMulticastRoute (Ipv4Address origin, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   214
                                                              Ipv4Address group, uint32_t inputInterface,
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   215
                                                              std::vector<uint32_t> outputInterfaces);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   216
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   217
private:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   218
  Ipv4MulticastRoutingTableEntry (Ipv4Address origin, Ipv4Address group, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   219
                                  uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   220
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   221
  Ipv4Address m_origin;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   222
  Ipv4Address m_group;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   223
  uint32_t m_inputInterface;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   224
  std::vector<uint32_t> m_outputInterfaces;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   225
};
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   226
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   227
std::ostream& operator<< (std::ostream& os, Ipv4MulticastRoutingTableEntry const& route);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   228
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   229
} // namespace ns3
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   230
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   231
#endif /* IPV4_ROUTING_TABLE_ENTRY_H */