author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Mon, 03 Mar 2008 01:58:57 +0100 | |
changeset 2542 | a9b88fdc09d6 |
parent 1867 | 16deaedc0380 |
child 2834 | 1aab57845b07 |
permissions | -rw-r--r-- |
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 |
// All rights reserved. |
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 |
// |
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 |
// 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
|
7 |
// 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
|
8 |
// 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
|
9 |
// |
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 |
// 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
|
11 |
// 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
|
12 |
// 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
|
13 |
// 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
|
14 |
// |
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 |
// 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
|
16 |
// 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
|
17 |
// 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
|
18 |
// |
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 |
// 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
|
20 |
// 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
|
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 |
|
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 |
#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
|
24 |
#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
|
25 |
|
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 <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
|
27 |
#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
|
28 |
#include "ns3/ipv4-address.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
|
29 |
#include "ipv4-header.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/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
|
31 |
#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
|
32 |
|
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 |
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
|
34 |
|
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 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
|
36 |
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
|
37 |
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
|
38 |
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
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
|
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
|
43 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
44 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
45 |
* @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
|
46 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
47 |
* 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
|
48 |
* 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
|
49 |
* 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
|
50 |
* 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
|
51 |
* 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
|
52 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
53 |
* 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
|
54 |
* 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
|
55 |
* protocol must support. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
56 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
57 |
* 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
|
58 |
* 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
|
59 |
* 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
|
60 |
* (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
|
61 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
62 |
* 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
|
63 |
* 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
|
64 |
* 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
|
65 |
* 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
|
66 |
* 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
|
67 |
* 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
|
68 |
* the static routing protocol. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
69 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
70 |
* 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
|
71 |
* 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
|
72 |
* 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
|
73 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
74 |
* @see Ipv4RoutingProtocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
75 |
* @see Ipv4L3Protocol::AddRoutingProtocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
76 |
* @see Ipv4L3Protocol::Ipv4L3Protocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
77 |
*/ |
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
|
78 |
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
|
79 |
{ |
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
|
80 |
public: |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
81 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
82 |
* @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
|
83 |
* @internal |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
84 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
85 |
* 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
|
86 |
* 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
|
87 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
88 |
* @see Ipv4StaticRouting |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
89 |
*/ |
1442
bb5cf98c0c64
real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents:
1440
diff
changeset
|
90 |
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
|
91 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
92 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
93 |
* @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
|
94 |
* 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
|
95 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
96 |
* 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
|
97 |
* 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
|
98 |
* on the type of destination address. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
99 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
100 |
* 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
|
101 |
* 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
|
102 |
* 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
|
103 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
104 |
* 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
|
105 |
* 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
|
106 |
* 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
|
107 |
* 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
|
108 |
* 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
|
109 |
* 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
|
110 |
* 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
|
111 |
* 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
|
112 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
113 |
* 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
|
114 |
* 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
|
115 |
* 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
|
116 |
* 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
|
117 |
* (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
|
118 |
* 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
|
119 |
* 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
|
120 |
* (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
|
121 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
122 |
* @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
|
123 |
* 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
|
124 |
* Ipv4RoutingProtocol::IF_INDEX_ANY. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
125 |
* @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
|
126 |
* addresses for the packet. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
127 |
* @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
|
128 |
* @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
|
129 |
* packet. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
130 |
* @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
|
131 |
* 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
|
132 |
* 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
|
133 |
* protocol. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
134 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
135 |
* @see Ipv4StaticRouting |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
136 |
* @see Ipv4RoutingProtocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
137 |
*/ |
1432
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1428
diff
changeset
|
138 |
virtual bool RequestRoute (uint32_t ifIndex, |
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1428
diff
changeset
|
139 |
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
|
140 |
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
|
141 |
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
|
142 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
143 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
144 |
* @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
|
145 |
* 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
|
146 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
147 |
* 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
|
148 |
* 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
|
149 |
* 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
|
150 |
* 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
|
151 |
* 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
|
152 |
* 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
|
153 |
* 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
|
154 |
* given destination. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
155 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
156 |
* 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
|
157 |
* 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
|
158 |
* 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
|
159 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
160 |
* 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
|
161 |
* 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
|
162 |
* 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
|
163 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
164 |
* @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
|
165 |
* 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
|
166 |
* @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
|
167 |
* 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
|
168 |
* @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
|
169 |
* 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
|
170 |
* 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
|
171 |
* 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
|
172 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
173 |
* @see Ipv4StaticRouting |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
174 |
* @see Ipv4RoutingProtocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
175 |
* @see Ipv4L3Protocol |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
176 |
*/ |
1434
2b63aafb050b
set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents:
1432
diff
changeset
|
177 |
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
|
178 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
179 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
180 |
* @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
|
181 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
182 |
* @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
|
183 |
* @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
|
184 |
* @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
|
185 |
* destination. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
186 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
187 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
188 |
*/ |
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
|
189 |
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
|
190 |
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
|
191 |
uint32_t interface); |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
192 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
193 |
* @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
|
194 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
195 |
* @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
|
196 |
* @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
|
197 |
* destination. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
198 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
199 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
200 |
*/ |
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
|
201 |
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
|
202 |
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
|
203 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
204 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
205 |
* @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
|
206 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
207 |
* @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
|
208 |
* @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
|
209 |
* @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
|
210 |
* @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
|
211 |
* destination. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
212 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
213 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
214 |
*/ |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
uint32_t interface); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
221 |
* @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
|
222 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
223 |
* @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
|
224 |
* @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
|
225 |
* @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
|
226 |
* destination. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
227 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
228 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
229 |
*/ |
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
|
230 |
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
|
231 |
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
|
232 |
uint32_t interface); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
235 |
* @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
|
236 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
237 |
* 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
|
238 |
* 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
|
239 |
* 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
|
240 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
241 |
* 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
|
242 |
* 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
|
243 |
* found. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
244 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
245 |
* @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
|
246 |
* will be forwarded correctly. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
247 |
* @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
|
248 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
249 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
250 |
* @see Ipv4StaticRouting::Lookup |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
251 |
*/ |
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
|
252 |
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
|
253 |
uint32_t interface); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
256 |
* @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
|
257 |
* to the routing table. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
258 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
259 |
* @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
|
260 |
*/ |
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
|
261 |
uint32_t GetNRoutes (void); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
264 |
* @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
|
265 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
266 |
* @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
|
267 |
* 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
|
268 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
269 |
* @see Ipv4Route |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
270 |
*/ |
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
|
271 |
Ipv4Route *GetDefaultRoute (void); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
274 |
* @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
|
275 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
276 |
* 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
|
277 |
* 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
|
278 |
* 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
|
279 |
* 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
|
280 |
* 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
|
281 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
282 |
* 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
|
283 |
* remove the default route. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
284 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
285 |
* @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
|
286 |
* 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
|
287 |
* @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
|
288 |
* a zero pointer is returned. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
289 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
290 |
* @see Ipv4Route |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
291 |
* @see Ipv4StaticRouting::RemoveRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
292 |
*/ |
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
|
293 |
Ipv4Route *GetRoute (uint32_t i); |
1444
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
296 |
* @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
|
297 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
298 |
* 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
|
299 |
* 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
|
300 |
* 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
|
301 |
* 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
|
302 |
* default route. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
303 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
304 |
* @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
|
305 |
* 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
|
306 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
307 |
* @see Ipv4Route |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
308 |
* @see Ipv4StaticRouting::GetRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
309 |
* @see Ipv4StaticRouting::AddRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
310 |
*/ |
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
|
311 |
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
|
312 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
313 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
314 |
* @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
|
315 |
* |
1446
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
316 |
* 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
|
317 |
* 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
|
318 |
* 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
|
319 |
* are sent. |
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
320 |
* |
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
321 |
* 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
|
322 |
* 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
|
323 |
* 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
|
324 |
* 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
|
325 |
* 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
|
326 |
* 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
|
327 |
* 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
|
328 |
* |
1446
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
329 |
* 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
|
330 |
* 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
|
331 |
* 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
|
332 |
* 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
|
333 |
* |
1446
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
334 |
* 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
|
335 |
* 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
|
336 |
* 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
|
337 |
* 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
|
338 |
* |
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
339 |
* 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
|
340 |
* 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
|
341 |
* 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
|
342 |
* 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
|
343 |
* existing functionality in other systems. |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
344 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
345 |
* @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
|
346 |
* be Ipv4Address:GetAny for open groups. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
347 |
* @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
|
348 |
* @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
|
349 |
* 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
|
350 |
* 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
|
351 |
* @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
|
352 |
* 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
|
353 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
354 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
355 |
*/ |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
356 |
void AddMulticastRoute (Ipv4Address origin, |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
357 |
Ipv4Address group, |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
358 |
uint32_t inputInterface, |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
359 |
std::vector<uint32_t> outputInterfaces); |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
360 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
361 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
362 |
* @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
|
363 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
364 |
* 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
|
365 |
* 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
|
366 |
* 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
|
367 |
* 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
|
368 |
* 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
|
369 |
* 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
|
370 |
* 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
|
371 |
* AddMulticastRoute for that case. |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
372 |
* |
1447
f136fc719267
readme file includes APIs
Craig Dowell <craigdo@ee.washington.edu>
parents:
1446
diff
changeset
|
373 |
* 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
|
374 |
* 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
|
375 |
* 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
|
376 |
* 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
|
377 |
* 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
|
378 |
* route is not found. |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
379 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
380 |
* @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
|
381 |
* 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
|
382 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
383 |
* @see Ipv4Address |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
384 |
*/ |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
385 |
void SetDefaultMulticastRoute (uint32_t outputInterface); |
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 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
388 |
* @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
|
389 |
* to the routing table. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
390 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
391 |
* @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
|
392 |
*/ |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
393 |
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
|
394 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
395 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
396 |
* @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
|
397 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
398 |
* 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
|
399 |
* 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
|
400 |
* 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
|
401 |
* 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
|
402 |
* 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
|
403 |
* calling GetMulticastRoute (0). |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
404 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
405 |
* 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
|
406 |
* 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
|
407 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
408 |
* @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
|
409 |
* 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
|
410 |
* @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
|
411 |
* 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
|
412 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
413 |
* @see Ipv4MulticastRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
414 |
* @see Ipv4StaticRouting::RemoveRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
415 |
*/ |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
416 |
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
|
417 |
|
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
418 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
419 |
* @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
|
420 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
421 |
* @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
|
422 |
* 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
|
423 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
424 |
* @see Ipv4Route |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
425 |
*/ |
1442
bb5cf98c0c64
real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents:
1440
diff
changeset
|
426 |
Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const; |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
427 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
428 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
429 |
* @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
|
430 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
431 |
* 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
|
432 |
* 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
|
433 |
* 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
|
434 |
* 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
|
435 |
* appropriate wildcard parameters. |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
436 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
437 |
* 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
|
438 |
* 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
|
439 |
* |
1446
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
440 |
* 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
|
441 |
* 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
|
442 |
* 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
|
443 |
* 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
|
444 |
* 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
|
445 |
* |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
446 |
* @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
|
447 |
* route. |
1795
820cc1254290
get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1449
diff
changeset
|
448 |
* @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
|
449 |
* the route. |
1795
820cc1254290
get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1449
diff
changeset
|
450 |
* @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
|
451 |
* input interface for the route. |
1795
820cc1254290
get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1449
diff
changeset
|
452 |
* @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
|
453 |
* |
1446
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
454 |
* @see Ipv4MulticastRoute |
f9bc98cbe5fe
clarify use of wildcards in multicast routes versus default mulicast routes.
Craig Dowell <craigdo@ee.washington.edu>
parents:
1444
diff
changeset
|
455 |
* @see Ipv4StaticRouting::AddMulticastRoute |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
456 |
*/ |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
457 |
bool RemoveMulticastRoute (Ipv4Address origin, |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
458 |
Ipv4Address group, |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
459 |
uint32_t inputInterface); |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
460 |
|
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
461 |
/** |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
462 |
* @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
|
463 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
464 |
* 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
|
465 |
* 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
|
466 |
* 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
|
467 |
* 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
|
468 |
* 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
|
469 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
470 |
* @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
|
471 |
* 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
|
472 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
473 |
* @see Ipv4Route |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
474 |
* @see Ipv4StaticRouting::GetRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
475 |
* @see Ipv4StaticRouting::AddRoute |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
476 |
*/ |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
477 |
void RemoveMulticastRoute (uint32_t index); |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
478 |
|
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
|
479 |
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
|
480 |
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
|
481 |
|
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 |
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
|
483 |
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
|
484 |
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
|
485 |
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
|
486 |
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
|
487 |
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
|
488 |
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
|
489 |
|
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
490 |
typedef std::list<Ipv4MulticastRoute *> MulticastRoutes; |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
491 |
typedef std::list<Ipv4MulticastRoute *>::const_iterator MulticastRoutesCI; |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
492 |
typedef std::list<Ipv4MulticastRoute *>::iterator MulticastRoutesI; |
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
493 |
|
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
|
494 |
Ipv4Route *LookupStatic (Ipv4Address dest); |
1432
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1428
diff
changeset
|
495 |
Ipv4MulticastRoute *LookupStatic (Ipv4Address origin, Ipv4Address group, |
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1428
diff
changeset
|
496 |
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
|
497 |
|
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 |
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
|
499 |
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
|
500 |
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
|
501 |
Ipv4MulticastRoute *m_defaultMulticastRoute; |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1176
diff
changeset
|
502 |
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
|
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 |
|
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 |
} // 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
|
506 |
|
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
|
507 |
#endif /* IPV4_STATIC_ROUTING_H */ |