src/routing/static-routing/ipv4-routing-table-entry.h
author Tom Henderson <tomh@tomh.org>
Wed, 08 Jul 2009 10:05:39 -0700
changeset 4673 36b78cddce4d
parent 4573 01e876191f2e
child 5227 ecb08c1fc273
permissions -rw-r--r--
fix doxygen errors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
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
/**
4673
36b78cddce4d fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4573
diff changeset
    32
 * \ingroup routing
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
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    54
   * \return True if this route is a host route; false otherwise
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
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    58
   * \return The IPv4 address of the destination of this route
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    60
  bool IsNetwork (void) const;
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
   * \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
    63
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    64
  bool IsDefault (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    65
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    66
   * \return True if this route is a gateway route; false otherwise
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    67
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    68
  bool IsGateway (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    69
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    70
   * \return address of the gateway stored in this entry
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    71
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
  Ipv4Address GetGateway (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    73
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    74
   * \return The IPv4 address of the destination of this route
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
  Ipv4Address GetDest (void) const;
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
   * \return The IPv4 network number of the destination of this route
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
  Ipv4Address GetDestNetwork (void) const;
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
   * \return The IPv4 network mask of the destination of this route
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
  Ipv4Mask GetDestNetworkMask (void) const;
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
   * \return The Ipv4 interface number used for sending outgoing packets
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    87
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
  uint32_t GetInterface (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    89
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    90
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    91
   * \param dest Ipv4Address of the destination
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    92
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    93
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    94
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
  static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
				      Ipv4Address nextHop, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
				      uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    98
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
    99
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   100
   * \param dest Ipv4Address of the destination
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   101
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   102
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   103
  static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   104
				      uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   105
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   106
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   107
   * \param network Ipv4Address of the destination network
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   108
   * \param networkMask Ipv4Mask of the destination network mask
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   109
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   110
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   111
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   112
  static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
					 Ipv4Mask networkMask, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
					 Ipv4Address nextHop, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
					 uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   116
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   117
   * \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   118
   * \param network Ipv4Address of the destination network
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   119
   * \param networkMask Ipv4Mask of the destination network mask
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   120
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   121
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   122
  static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   123
					 Ipv4Mask networkMask, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
					 uint32_t interface);
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   125
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   126
   * \return An Ipv4RoutingTableEntry object corresponding to the input 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   127
   * parameters.  This route is distinguished; it will match any 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   128
   * destination for which a more specific route does not exist.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   129
   * \param nextHop Ipv4Address of the next hop
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   130
   * \param interface Outgoing interface 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   131
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   132
  static Ipv4RoutingTableEntry CreateDefaultRoute (Ipv4Address nextHop, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   133
				       uint32_t interface);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   134
  
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   135
private:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   136
  Ipv4RoutingTableEntry (Ipv4Address network,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   137
	     Ipv4Mask mask,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   138
	     Ipv4Address gateway,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   139
	     uint32_t interface);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   140
  Ipv4RoutingTableEntry (Ipv4Address dest,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   141
	     Ipv4Mask mask,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   142
	     uint32_t interface);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   143
  Ipv4RoutingTableEntry (Ipv4Address dest,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   144
	     Ipv4Address gateway,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   145
	     uint32_t interface);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   146
  Ipv4RoutingTableEntry (Ipv4Address dest,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   147
	     uint32_t interface);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   148
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   149
  Ipv4Address m_dest;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   150
  Ipv4Mask m_destNetworkMask;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   151
  Ipv4Address m_gateway;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   152
  uint32_t m_interface;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   153
};
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   154
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   155
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
   156
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   157
/**
4673
36b78cddce4d fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4573
diff changeset
   158
 * \ingroup routing
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   159
 *
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   160
 * \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
   161
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   162
class Ipv4MulticastRoutingTableEntry {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   163
public:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   164
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   165
   * \brief This constructor does nothing
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
  Ipv4MulticastRoutingTableEntry ();
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
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   170
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   171
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   172
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   173
  Ipv4MulticastRoutingTableEntry (Ipv4MulticastRoutingTableEntry const &route);
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
   * \brief Copy Constructor
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   176
   * \param route The route to copy
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   177
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   178
  Ipv4MulticastRoutingTableEntry (Ipv4MulticastRoutingTableEntry const *route);
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
   * \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
   181
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   182
  Ipv4Address GetOrigin (void) const;
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
   * \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
   185
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   186
  Ipv4Address GetGroup (void) const;
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
   * \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
   189
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   190
  uint32_t GetInputInterface (void) const;
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
   * \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
   193
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   194
  uint32_t GetNOutputInterfaces (void) const;
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
   * \return A specified output interface.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   197
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   198
  uint32_t GetOutputInterface (uint32_t n) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   199
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   200
   * \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
   201
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   202
  std::vector<uint32_t> GetOutputInterfaces (void) const;
4482
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   203
  /**
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   204
   * \return Ipv4MulticastRoutingTableEntry corresponding to the input parameters.
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   205
   * \param origin Source address for the multicast route 
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   206
   * \param group Group destination address for the multicast route
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   207
   * \param inputInterface Input interface that multicast datagram must be received on
0a92e073bf7b more doxygen cleanup
Tom Henderson <tomh@tomh.org>
parents: 4472
diff changeset
   208
   * \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
   209
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   210
  static Ipv4MulticastRoutingTableEntry CreateMulticastRoute (Ipv4Address origin, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   211
    Ipv4Address group, uint32_t inputInterface,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   212
    std::vector<uint32_t> outputInterfaces);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   213
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   214
private:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   215
  Ipv4MulticastRoutingTableEntry (Ipv4Address origin, Ipv4Address group, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   216
    uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   217
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   218
  Ipv4Address m_origin;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   219
  Ipv4Address m_group;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   220
  uint32_t m_inputInterface;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   221
  std::vector<uint32_t> m_outputInterfaces;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   222
};
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   223
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   224
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
   225
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   226
}//namespace ns3
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   227
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   228
#endif /* IPV4_ROUTING_TABLE_ENTRY_H */