src/internet-stack/ipv4-static-routing.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 09 Jun 2008 15:40:22 -0700
changeset 3260 8c0ab08144e6
parent 3216 src/internet-node/ipv4-static-routing.h@b36bb98d766e
child 4372 d99061f1167c
permissions -rw-r--r--
bug 186: internet-node directory must be renamed to internet-stack
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     1
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     2
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     3
// Copyright (c) 2006 Georgia Tech Research Corporation
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     4
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     5
// This program is free software; you can redistribute it and/or modify
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     6
// it under the terms of the GNU General Public License version 2 as
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     7
// published by the Free Software Foundation;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     8
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     9
// This program is distributed in the hope that it will be useful,
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    12
// GNU General Public License for more details.
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    13
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    14
// You should have received a copy of the GNU General Public License
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    15
// along with this program; if not, write to the Free Software
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    17
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    18
// Author: George F. Riley<riley@ece.gatech.edu>
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    19
//         Gustavo Carneiro <gjc@inescporto.pt>
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    20
//
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    21
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    22
#ifndef IPV4_STATIC_ROUTING_H
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    23
#define IPV4_STATIC_ROUTING_H
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    24
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    25
#include <list>
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    26
#include <stdint.h>
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    27
#include "ns3/ipv4-address.h"
3216
b36bb98d766e bug 207: ipv4-header.h needed in src/node module.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2834
diff changeset
    28
#include "ns3/ipv4-header.h"
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    29
#include "ns3/ptr.h"
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    30
#include "ns3/ipv4.h"
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    31
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    32
namespace ns3 {
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    33
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    34
class Packet;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    35
class NetDevice;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    36
class Ipv4Interface;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    37
class Ipv4Address;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    38
class Ipv4Header;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    39
class Ipv4Route;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    40
class Node;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    41
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    42
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    43
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    44
 * @brief Static routing protocol for IP version 4 stacks.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    45
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    46
 * In ns-3 we have the concept of a pluggable routing protocol.  Routing
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    47
 * protocols are added to a list maintained by the Ipv4L3Protocol.  Every 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    48
 * stack gets one routing protocol for free -- the Ipv4StaticRouting routing
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    49
 * protocol is added in the constructor of the Ipv4L3Protocol (this is the 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    50
 * piece of code that implements the functionality of the IP layer).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    51
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    52
 * The Ipv4StaticRouting class inherits from the abstract base class 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    53
 * Ipv4RoutingProtocol that defines the interface methods that a routing 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    54
 * protocol must support.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    55
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    56
 * When a packet arrives in the Ipv4L3Protocol for transmission, it comes
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    57
 * either from a local source via Ipv4L3Protocol::Send or from a remote 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    58
 * source via Ipv4L3Protocol::Forwarding.  In both cases, a function is called
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    59
 * (Ipv4L3Protocol::Lookup) to look up the routing information for the packet.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    60
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    61
 * The lookup function iterates through the list of routing protocols asking
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    62
 * each to see if it can find a route and send the packet.  A callback is 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    63
 * provided during each of these calls that should be considered a pre-
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    64
 * packaged send call.  This is done to allow asynchronous calls into 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    65
 * routing subsystems in order to support on-demand routing, for example.  The
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    66
 * method for requesting this operation is Ipv4StaticRouting::RequestRoute for
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    67
 * the static routing protocol.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    68
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    69
 * Each routing protocol is also free to implement its own methods for managing
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    70
 * routes which you will find below.  This class manages a set of "static" or
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    71
 * manually configured routes for host, network and multicast routes.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    72
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    73
 * @see Ipv4RoutingProtocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    74
 * @see Ipv4L3Protocol::AddRoutingProtocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    75
 * @see Ipv4L3Protocol::Ipv4L3Protocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    76
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    77
class Ipv4StaticRouting : public Ipv4RoutingProtocol
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    78
{
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    79
public:
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    80
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    81
 * @brief Construct an empty Ipv4StaticRouting routing protocol,
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    82
 * @internal
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    83
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    84
 * The Ipv4StaticRouting class supports host, network and multicast routes.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    85
 * This method initializes the lists containing these routes to empty.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    86
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    87
 * @see Ipv4StaticRouting
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    88
 */
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
    89
  Ipv4StaticRouting ();
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    90
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    91
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    92
 * @brief Request that a check for a route bw performed and if a route is found
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    93
 * that the packet be sent on its way using the pre-packaged send callback.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    94
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    95
 * The source and destination IP addresses for the packet in question are found
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    96
 * in the provided Ipv4Header.  There are two major processing forks depending
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    97
 * on the type of destination address.  
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    98
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
    99
 * If the destination address is unicast then the routing table is consulted 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   100
 * for a route to the destination and if it is found, the routeReply callback
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   101
 * is executed to send the packet (with the found route).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   102
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   103
 * If the destination address is a multicast, then the exact processing steps
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   104
 * depend on whether or not the packet has been sourced locally.  This is 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   105
 * determined by the parameter ifIndex.  This is the interface index over which
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   106
 * this packet was received.  If the packet has not been received over a
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   107
 * network interface, this index will be set to 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   108
 * Ipv4RoutingProtocol::IF_INDEX_ANY (a very large number).  In that case, 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   109
 * we want to avoid the requirement that an explicit route out of each node 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   110
 * must be set, so we don't do anything here.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   111
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   112
 * If the packet is a multicast destination and has been received over a 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   113
 * network interface, a call to this method implies that the packet is being
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   114
 * forwarded.  In that case, there must be an explicit route out of the node.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   115
 * A multicast route references the source address, the destination address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   116
 * (the multicast group) and the input interface in order to find a route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   117
 * We consult the multicast routing table and, if a route is found, send the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   118
 * packet out of as many interfaces as required using the provided callback
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   119
 * (think of it as a pre-packaged send call).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   120
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   121
 * @param ifIndex The network interface index over which the packed was 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   122
 * received.  If the packet is from a local source, ifIndex will be set to
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   123
 * Ipv4RoutingProtocol::IF_INDEX_ANY.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   124
 * @param ipHeader the Ipv4Header containing the source and destination IP
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   125
 * addresses for the packet.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   126
 * @param packet The packet to be sent if a route is found.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   127
 * @param routeReply A callback that packaged up the call to actually send the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   128
 * packet.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   129
 * @return Returns true if a route is found and the packet has been sent,
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   130
 * otherwise returns false indicating that the next routing protocol should
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   131
 * be consulted.  In practice, the static routing protocol is the last chance
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   132
 * protocol.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   133
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   134
 * @see Ipv4StaticRouting
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   135
 * @see Ipv4RoutingProtocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   136
 */
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   137
  virtual bool RequestRoute (uint32_t ifIndex,
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   138
                             Ipv4Header const &ipHeader,
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   139
                             Ptr<Packet> packet,
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   140
                             RouteReplyCallback routeReply);
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   141
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   142
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   143
 * @brief Check to see if we can determine the interface index that will be
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   144
 * used if a packet is sent to this destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   145
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   146
 * This method addresses a problem in the IP stack where a destination address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   147
 * must be present and checksummed into the IP header before the actual 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   148
 * interface over which the packet is sent can be determined.  The answer is
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   149
 * to implement a known and intentional cross-layer violation.  This is the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   150
 * endpoint of a call chain that started up quite high in the stack (sockets)
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   151
 * and has found its way down to the Ipv4L3Protocol which is consulting the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   152
 * routing protocols for what they would do if presented with a packet of the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   153
 * given destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   154
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   155
 * Note that the a single interface index is returned.  This means that if
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   156
 * the destination address is a multicast, and an explicit route is present
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   157
 * that includeds multiple output interfaces, that route cannot be used.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   158
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   159
 * If there are multiple paths out of the node, the resolution is performed
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   160
 * by Ipv4L3Protocol::GetIfIndexforDestination which has access to more 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   161
 * contextual information that is useful for making a determination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   162
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   163
 * @param destination The Ipv4Address if the destination of a hypothetical 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   164
 * packet.  This may be a multicast group address.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   165
 * @param ifIndex A reference to the interface index over which a packet
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   166
 * sent to this destination would be sent.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   167
 * @return Returns true if a route is found to the destination that involves
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   168
 * a single output interface index, otherwise returns false indicating that
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   169
 * the next routing protocol should be consulted.  In practice, the static 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   170
 * routing protocol is the last chance protocol.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   171
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   172
 * @see Ipv4StaticRouting
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   173
 * @see Ipv4RoutingProtocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   174
 * @see Ipv4L3Protocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   175
 */
1434
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   176
  virtual bool RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex);
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   177
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   178
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   179
 * @brief Add a host route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   180
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   181
 * @param dest The Ipv4Address destination for this route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   182
 * @param nextHop The Ipv4Address of the next hop in the route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   183
 * @param interface The network interface index used to send packets to the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   184
 * destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   185
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   186
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   187
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   188
  void AddHostRouteTo (Ipv4Address dest, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   189
                       Ipv4Address nextHop, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   190
                       uint32_t interface);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   191
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   192
 * @brief Add a host route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   193
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   194
 * @param dest The Ipv4Address destination for this route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   195
 * @param interface The network interface index used to send packets to the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   196
 * destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   197
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   198
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   199
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   200
  void AddHostRouteTo (Ipv4Address dest, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   201
                       uint32_t interface);
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   202
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   203
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   204
 * @brief Add a network route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   205
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   206
 * @param network The Ipv4Address network for this route.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   207
 * @param networkMask The Ipv4Mask to extract the network.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   208
 * @param nextHop The next hop in the route to the destination network.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   209
 * @param interface The network interface index used to send packets to the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   210
 * destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   211
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   212
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   213
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   214
  void AddNetworkRouteTo (Ipv4Address network, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   215
                          Ipv4Mask networkMask, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   216
                          Ipv4Address nextHop, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   217
                          uint32_t interface);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   218
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   219
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   220
 * @brief Add a network route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   221
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   222
 * @param network The Ipv4Address network for this route.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   223
 * @param networkMask The Ipv4Mask to extract the network.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   224
 * @param interface The network interface index used to send packets to the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   225
 * destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   226
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   227
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   228
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   229
  void AddNetworkRouteTo (Ipv4Address network, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   230
                          Ipv4Mask networkMask, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   231
                          uint32_t interface);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   232
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   233
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   234
 * @brief Add a default route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   235
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   236
 * This method tells the routing system what to do in the case where a specific
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   237
 * route to a destination is not found.  The system forwards packets to the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   238
 * specified node in the hope that it knows better how to route the packet.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   239
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   240
 * If the default route is set, it is returned as the selected route from 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   241
 * LookupStatic irrespective of destination address if no specific route is
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   242
 * found.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   243
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   244
 * @param nextHop The Ipv4Address to send packets to in the hope that they
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   245
 * will be forwarded correctly.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   246
 * @param interface The network interface index used to send packets.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   247
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   248
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   249
 * @see Ipv4StaticRouting::Lookup
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   250
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   251
  void SetDefaultRoute (Ipv4Address nextHop, 
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   252
                        uint32_t interface);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   253
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   254
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   255
 * @brief Get the number of individual unicast routes that have been added
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   256
 * to the routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   257
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   258
 * @warning The default route counts as one of the routes.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   259
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   260
  uint32_t GetNRoutes (void);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   261
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   262
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   263
 * @brief Get the default route from the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   264
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   265
 * @return If the default route is set, a pointer to that Ipv4Route is
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   266
 * returned, otherwise a zero pointer is returned.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   267
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   268
 * @see Ipv4Route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   269
 */
1440
c77745b2731c add ipv4 methods, remove source multicast route requirement, fix udp socket source address prob
Craig Dowell <craigdo@ee.washington.edu>
parents: 1434
diff changeset
   270
  Ipv4Route *GetDefaultRoute (void);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   271
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   272
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   273
 * @brief Get a route from the static unicast routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   274
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   275
 * Externally, the unicast static routing table appears simply as a table with
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   276
 * n entries.  The one sublety of note is that if a default route has been set
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   277
 * it will appear as the zeroth entry in the table.  This means that if you
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   278
 * add only a default route, the table will have one entry that can be accessed
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   279
 * either by explicity calling GetDefaultRoute () or by calling GetRoute (0).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   280
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   281
 * Similarly, if the default route has been set, calling RemoveRoute (0) will
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   282
 * remove the default route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   283
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   284
 * @param i The index (into the routing table) of the route to retrieve.  If
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   285
 * the default route has been set, it will occupy index zero.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   286
 * @return If route is set, a pointer to that Ipv4Route is returned, otherwise
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   287
 * a zero pointer is returned.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   288
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   289
 * @see Ipv4Route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   290
 * @see Ipv4StaticRouting::RemoveRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   291
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   292
  Ipv4Route *GetRoute (uint32_t i);
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   293
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   294
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   295
 * @brief Remove a route from the static unicast routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   296
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   297
 * Externally, the unicast static routing table appears simply as a table with
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   298
 * n entries.  The one sublety of note is that if a default route has been set
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   299
 * it will appear as the zeroth entry in the table.  This means that if the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   300
 * default route has been set, calling RemoveRoute (0) will remove the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   301
 * default route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   302
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   303
 * @param i The index (into the routing table) of the route to remove.  If
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   304
 * the default route has been set, it will occupy index zero.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   305
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   306
 * @see Ipv4Route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   307
 * @see Ipv4StaticRouting::GetRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   308
 * @see Ipv4StaticRouting::AddRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   309
 */
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   310
  void RemoveRoute (uint32_t i);
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   311
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   312
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   313
 * @brief Add a multicast route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   314
 *
1446
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   315
 * A multicast route must specify an origin IP address, a multicast group and
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   316
 * an input network interface index as conditions and provide a vector of
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   317
 * output network interface indices over which packets matching the conditions
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   318
 * are sent.
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   319
 *
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   320
 * Typically there are two main types of multicast routes:  routes of the 
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   321
 * first kind are used during forwarding.  All of the conditions must be
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   322
 * exlicitly provided.  The second kind of routes are used to get packets off
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   323
 * of a local node.  The difference is in the input interface.  Routes for
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   324
 * forwarding will always have an explicit input interface specified.  Routes
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   325
 * off of a node will always set the input interface to a wildcard specified
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   326
 * by the index Ipv4RoutingProtocol::IF_INDEX_ANY.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   327
 *
1446
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   328
 * For routes off of a local node wildcards may be used in the origin and
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   329
 * multicast group addresses.  The wildcard used for Ipv4Adresses is that 
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   330
 * address returned by Ipv4Address::GetAny () -- typically "0.0.0.0".  Usage
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   331
 * of a wildcard allows one to specify default behavior to varying degrees.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   332
 *
1446
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   333
 * For example, making the origin address a wildcard, but leaving the 
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   334
 * multicast group specific allows one (in the case of a node with multiple
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   335
 * interfaces) to create different routes using different output interfaces
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   336
 * for each multicast group.
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   337
 *
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   338
 * If the origin and multicast addresses are made wildcards, you have created
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   339
 * essentially a default multicast address that can forward to multiple 
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   340
 * interfaces.  Compare this to the actual default multicast address that is
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   341
 * limited to specifying a single output interface for compatibility with
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   342
 * existing functionality in other systems.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   343
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   344
 * @param origin The Ipv4Address of the origin of packets for this route.  May
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   345
 * be Ipv4Address:GetAny for open groups.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   346
 * @param group The Ipv4Address of the multicast group or this route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   347
 * @param inputInterface The input network interface index over which to 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   348
 * expect packets destined for this route.  May be
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   349
 * Ipv4RoutingProtocol::IF_INDEX_ANY for packets of local origin.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   350
 * @param outputInterfaces A vector of network interface indices used to specify
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   351
 * how to send packets to the destination(s).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   352
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   353
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   354
 */
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   355
  void AddMulticastRoute (Ipv4Address origin,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   356
                          Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   357
                          uint32_t inputInterface,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   358
                          std::vector<uint32_t> outputInterfaces);
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   359
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   360
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   361
 * @brief Add a default multicast route to the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   362
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   363
 * This is the multicast equivalent of the unicast version SetDefaultRoute.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   364
 * We tell the routing system what to do in the case where a specific route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   365
 * to a destination multicast group is not found.  The system forwards 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   366
 * packets out the specified interface in the hope that "something out there"
1447
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   367
 * knows better how to route the packet.  This method is only used in 
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   368
 * initially sending packets off of a host.  The default multicast route is
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   369
 * not consulted during forwarding -- exact routes must be specified using
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   370
 * AddMulticastRoute for that case.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   371
 *
1447
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   372
 * Since we're basically sending packets to some entity we think may know
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   373
 * better what to do, we don't pay attention to "subtleties" like origin
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   374
 * address, nor do we worry about forwarding out multiple  interfaces.  If the
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   375
 * default multicast route is set, it is returned as the selected route from 
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   376
 * LookupStatic irrespective of origin or multicast group if another specific
f136fc719267 readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1446
diff changeset
   377
 * route is not found.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   378
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   379
 * @param outputInterface The network interface index used to specify where
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   380
 * to send packets in the case of unknown routes.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   381
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   382
 * @see Ipv4Address
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   383
 */
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   384
  void SetDefaultMulticastRoute (uint32_t outputInterface);
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   385
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   386
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   387
 * @brief Get the number of individual multicast routes that have been added
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   388
 * to the routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   389
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   390
 * @warning The default multicast route counts as one of the routes.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   391
 */
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   392
  uint32_t GetNMulticastRoutes (void) const;
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   393
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   394
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   395
 * @brief Get a route from the static multicast routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   396
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   397
 * Externally, the multicast static routing table appears simply as a table 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   398
 * with n entries.  The one sublety of note is that if a default route has 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   399
 * been set it will appear as the zeroth entry in the table.  This means that 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   400
 * if you add only a default route, the table will have one entry that can be
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   401
 * accessed either by explicity calling GetDefaultMulticastRoute () or by
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   402
 * calling GetMulticastRoute (0).
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   403
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   404
 * Similarly, if the default route has been set, calling 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   405
 * RemoveMulticastRoute (0) will remove the default route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   406
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   407
 * @param i The index (into the routing table) of the multicast route to
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   408
 * retrieve.  If the default route has been set, it will occupy index zero.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   409
 * @return If route \e i is set, a pointer to that Ipv4MulticastRoute is
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   410
 * returned, otherwise a zero pointer is returned.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   411
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   412
 * @see Ipv4MulticastRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   413
 * @see Ipv4StaticRouting::RemoveRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   414
 */
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   415
  Ipv4MulticastRoute *GetMulticastRoute (uint32_t i) const;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   416
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   417
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   418
 * @brief Get the default multicast route from the static routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   419
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   420
 * @return If the default route is set, a pointer to that Ipv4MulticastRoute is
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   421
 * returned, otherwise a zero pointer is returned.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   422
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   423
 * @see Ipv4Route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   424
 */
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   425
  Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   426
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   427
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   428
 * @brief Remove a route from the static multicast routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   429
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   430
 * Externally, the multicast static routing table appears simply as a table 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   431
 * with n entries.  The one sublety of note is that if a default multicast
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   432
 * route has been set it will appear as the zeroth entry in the table.  This
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   433
 * means that the default route may be removed by calling this method with
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   434
 * appropriate wildcard parameters.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   435
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   436
 * This method causes the multicast routing table to be searched for the first
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   437
 * route that matches the parameters and removes it.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   438
 *
1446
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   439
 * Wildcards may be provided to this function, but the wildcards are used to
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   440
 * exacly match wildcards in the routes (see AddMulticastRoute).  That is,
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   441
 * calling RemoveMulticastRoute with the origin set to "0.0.0.0" will not
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   442
 * remove routes with any address in the origin, but will only remove routes
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   443
 * with "0.0.0.0" set as the the origin.
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   444
 *
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   445
 * @param origin The IP address specified as the origin of packets for the
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   446
 * route.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   447
 * @param group The IP address specified as the multicast group addres of
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   448
 * the route.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   449
 * @param inputInterface The network interface index specified as the expected
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   450
 * input interface for the route.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1449
diff changeset
   451
 * @returns true if a route was found and removed, false otherwise.
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   452
 *
1446
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   453
 * @see Ipv4MulticastRoute
f9bc98cbe5fe clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents: 1444
diff changeset
   454
 * @see Ipv4StaticRouting::AddMulticastRoute
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   455
 */
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   456
  bool RemoveMulticastRoute (Ipv4Address origin,
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   457
                             Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   458
                             uint32_t inputInterface);
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   459
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   460
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   461
 * @brief Remove a route from the static multicast routing table.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   462
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   463
 * Externally, the multicast static routing table appears simply as a table 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   464
 * with n entries.  The one sublety of note is that if a default multicast
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   465
 * route has been set it will appear as the zeroth entry in the table.  This 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   466
 * means that if the default route has been set, calling 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   467
 * RemoveMulticastRoute (0) will remove the default route.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   468
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   469
 * @param index The index (into the multicast routing table) of the route to
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   470
 * remove.  If the default route has been set, it will occupy index zero.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   471
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   472
 * @see Ipv4Route
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   473
 * @see Ipv4StaticRouting::GetRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   474
 * @see Ipv4StaticRouting::AddRoute
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   475
 */
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   476
  void RemoveMulticastRoute (uint32_t index);
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   477
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   478
protected:
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   479
  void DoDispose (void);
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   480
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   481
private:
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   482
  typedef std::list<Ipv4Route *> HostRoutes;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   483
  typedef std::list<Ipv4Route *>::const_iterator HostRoutesCI;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   484
  typedef std::list<Ipv4Route *>::iterator HostRoutesI;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   485
  typedef std::list<Ipv4Route *> NetworkRoutes;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   486
  typedef std::list<Ipv4Route *>::const_iterator NetworkRoutesCI;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   487
  typedef std::list<Ipv4Route *>::iterator NetworkRoutesI;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   488
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   489
  typedef std::list<Ipv4MulticastRoute *> MulticastRoutes;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   490
  typedef std::list<Ipv4MulticastRoute *>::const_iterator MulticastRoutesCI;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   491
  typedef std::list<Ipv4MulticastRoute *>::iterator MulticastRoutesI;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   492
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   493
  Ipv4Route *LookupStatic (Ipv4Address dest);
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   494
  Ipv4MulticastRoute *LookupStatic (Ipv4Address origin, Ipv4Address group,
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   495
                                    uint32_t ifIndex);
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   496
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   497
  HostRoutes m_hostRoutes;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   498
  NetworkRoutes m_networkRoutes;
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   499
  Ipv4Route *m_defaultRoute;
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   500
  Ipv4MulticastRoute *m_defaultMulticastRoute;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 1176
diff changeset
   501
  MulticastRoutes m_multicastRoutes;
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   502
};
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   503
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   504
} // Namespace ns3
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   505
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
   506
#endif /* IPV4_STATIC_ROUTING_H */