src/node/ipv4.h
author Craig Dowell <craigdo@ee.washington.edu>
Mon, 13 Aug 2007 12:08:01 -0700
changeset 1432 3aef7d7a71c2
parent 1428 a8f3d01d4a2c
child 1434 2b63aafb050b
permissions -rw-r--r--
more multicast plumbing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2007 INRIA
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 * All rights reserved.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 * GNU General Public License for more details.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
 */
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
    21
#ifndef IPV4_H
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
    22
#define IPV4_H
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <stdint.h>
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/ipv4-address.h"
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 638
diff changeset
    26
#include "ns3/object.h"
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 757
diff changeset
    27
#include "ns3/callback.h"
757
f4a677b1f753 fix bug 28
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 755
diff changeset
    28
#include "ipv4-route.h"
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
namespace ns3 {
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
class NetDevice;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
class Packet;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
class Ipv4Route;
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: 757
diff changeset
    35
class Ipv4Header; // FIXME: ipv4-header.h needs to move from module
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: 757
diff changeset
    36
                  // "internet-node" to module "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: 757
diff changeset
    37
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    38
/**
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    39
 * \brief Base class for IPv4 routing protocols.
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    40
 *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    41
 * This class represents the interface between the IPv4 routing core
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    42
 * and a specific IPv4 routing protocol.  The interface is
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    43
 * asynchronous (callback based) in order to support reactive routing
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    44
 * protocols (e.g. AODV).
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    45
 */
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: 757
diff changeset
    46
class Ipv4RoutingProtocol : public Object
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: 757
diff changeset
    47
{
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: 757
diff changeset
    48
public:
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: 757
diff changeset
    49
  // void (*RouteReply) (bool found, Ipv4Route route, Packet packet, Ipv4Header const &ipHeader);
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    50
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: 757
diff changeset
    51
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: 757
diff changeset
    52
  /**
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    53
   * \brief Callback to be invoked when route discovery is completed
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    54
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    55
   * \param bool flag indicating whether a route was actually found;
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    56
   * when this is false, the Ipv4Route parameter is ignored
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    57
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    58
   * \param Ipv4Route the route found
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    59
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    60
   * \param Packet the packet for which a route was requested; can be
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    61
   * modified by the routing protocol
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    62
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    63
   * \param Ipv4Header the IP header supplied to the route request
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    64
   * method (possibly modified in case a new routing header is
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    65
   * inserted and consequently the protocol type has to change).
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    66
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    67
   */
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    68
  typedef Callback<void, bool, const Ipv4Route&, Packet, const Ipv4Header&> RouteReplyCallback;
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    69
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    70
  /**
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    71
   * \brief Asynchronously requests a route for a given packet and IP header
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: 757
diff changeset
    72
   *
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
    73
   * \param ifIndex The interface index on which the packet was received.
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: 757
diff changeset
    74
   * \param ipHeader IP header of the 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: 757
diff changeset
    75
   * \param packet packet that is being sent or forwarded
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: 757
diff changeset
    76
   * \param routeReply callback that will receive the route reply
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: 757
diff changeset
    77
   *
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: 757
diff changeset
    78
   * \returns true if the routing protocol should be able to get 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: 757
diff changeset
    79
   * route, false otherwise.
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    80
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    81
   * This method is called whenever a node's IPv4 forwarding engine
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    82
   * needs to lookup a route for a given packet and IP header.
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    83
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    84
   * The routing protocol implementation may determine immediately it
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    85
   * should not be handling this particular the route request.  For
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    86
   * instance, a routing protocol may decline to search for routes for
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    87
   * certain classes of addresses, like link-local.  In this case,
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    88
   * RequestRoute() should return false and the routeReply callback
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    89
   * must not be invoked.
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    90
   *
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    91
   * If the routing protocol implementations assumes it can provide
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    92
   * the requested route, then it should return true, and the
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    93
   * routeReply callback must be invoked, either immediately before
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    94
   * returning true (synchronously), or in the future (asynchronous).
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    95
   * The routing protocol may use any information available in the IP
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    96
   * header and packet as routing key, although most routing protocols
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    97
   * use only the destination address (as given by
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    98
   * ipHeader.GetDestination ()).  The routing protocol is also
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
    99
   * allowed to add a new header to the packet, which will appear
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   100
   * immediately after the IP header, although most routing do not
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   101
   * insert any extra header.
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: 757
diff changeset
   102
   */
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   103
  virtual bool RequestRoute (uint32_t ifIndex,
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   104
                             const Ipv4Header &ipHeader,
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: 757
diff changeset
   105
                             Packet 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: 757
diff changeset
   106
                             RouteReplyCallback routeReply) = 0;
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   107
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   108
  static const uint32_t IF_INDEX_ANY = 0xffffffff;
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: 757
diff changeset
   109
};
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: 757
diff changeset
   110
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 593
diff changeset
   111
/**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   112
 * \brief Access to the Ipv4 forwarding table and to the ipv4 interfaces
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   113
 *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   114
 * This class allows you to create ipv4 interfaces based on a NetDevice.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   115
 * Multiple interfaces can be created for a single NetDevice, hence
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   116
 * achieving multihoming.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   117
 *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   118
 * This class also allows you to control the content of the ipv4 
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   119
 * forwarding table.
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 593
diff changeset
   120
 */
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   121
class Ipv4 : public Object
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   122
{
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   123
public:
580
80f53b488bd3 rename Iid to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 579
diff changeset
   124
  static const InterfaceId iid;
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   125
  Ipv4 ();
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   126
  virtual ~Ipv4 ();
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: 757
diff changeset
   127
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   128
  /**
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   129
   * \brief Register a new routing protocol to be used in this IPv4 stack
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   130
   * 
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   131
   * \param routingProtocol new routing protocol implementation object
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   132
   * \param priority priority to give to this routing protocol.
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   133
   * Values may range between -32768 and +32767.  The priority 0
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   134
   * corresponds to static routing table lookups, higher values have
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   135
   * more priority.  The order by which routing protocols with the
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   136
   * same priority value are consulted is undefined.
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   137
   */
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: 757
diff changeset
   138
  virtual void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
985
b15a6fa08c14 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 983
diff changeset
   139
                                   int16_t priority) = 0;
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: 757
diff changeset
   140
  
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   141
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   142
   * \param dest destination address
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   143
   * \param nextHop address of next hop.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   144
   * \param interface interface of next hop.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   145
   *
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   146
   * Add route to host dest through host nextHop 
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   147
   * on interface.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   149
  virtual void AddHostRouteTo (Ipv4Address dest, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   150
			       Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   151
			       uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   152
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   153
   * \param dest destination address
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   154
   * \param interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   155
   *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   156
   * add route to host dest on interface.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   157
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   158
  virtual void AddHostRouteTo (Ipv4Address dest, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   159
			       uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   160
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   161
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   162
   * \param network destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   163
   * \param networkMask netmask of destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   164
   * \param nextHop address of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   165
   * \param interface interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   166
   * 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   167
   * add route to network dest with netmask 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   168
   * through host nextHop on interface
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   169
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   170
  virtual void AddNetworkRouteTo (Ipv4Address network, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   171
				  Ipv4Mask networkMask, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   172
				  Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   173
				  uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   174
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   175
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   176
   * \param network destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   177
   * \param networkMask netmask of destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   178
   * \param interface interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   179
   *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   180
   * add route to network dest with netmask 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   181
   * on interface
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   182
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   183
  virtual void AddNetworkRouteTo (Ipv4Address network, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   184
				  Ipv4Mask networkMask, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   185
				  uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   186
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   187
   * \param nextHop address of default next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   188
   * \param interface interface of default next hop.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   189
   * 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   190
   * set the default route to host nextHop on
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
   * interface. 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   193
  virtual void SetDefaultRoute (Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   194
				uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   195
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   196
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   197
   * \returns the number of entries in the routing table.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   198
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   199
  virtual uint32_t GetNRoutes (void) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   200
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   201
   * \param i index of route to return
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   202
   * \returns the route whose index is i
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   203
   */
757
f4a677b1f753 fix bug 28
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 755
diff changeset
   204
  virtual Ipv4Route GetRoute (uint32_t i) = 0;
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   205
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   206
   * \param i index of route to remove from routing table.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   207
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   208
  virtual void RemoveRoute (uint32_t i) = 0;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   209
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   210
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   211
   * \brief Add a static multicast route for a given multicast source and 
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   212
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   213
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   214
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   215
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   216
   * \param inputInterface The interface index over which the packet arrived.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   217
   * \param outputInterfaces The list of output interface indices over which 
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   218
   *        the packet should be sent (excluding the inputInterface).
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   219
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   220
  virtual void AddMulticastRoute (Ipv4Address origin,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   221
                                  Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   222
                                  uint32_t inputInterface,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   223
                                  std::vector<uint32_t> outputInterfaces) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   224
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   225
   * \brief Remove a static multicast route for a given multicast source and
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   226
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   227
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   228
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   229
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   230
   * \param inputInterface The interface index over which the packet arrived.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   231
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   232
  virtual void RemoveMulticastRoute (Ipv4Address origin,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   233
                                     Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   234
                                     uint32_t inputInterface) = 0;
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
  
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   236
  /**
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   237
   * \returns the number of entries in the multicast routing table.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   238
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   239
  virtual uint32_t GetNMulticastRoutes (void) const = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   240
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   241
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   242
   * \param i index of route to return
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   243
   * \returns the route whose index is i
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   244
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   245
  virtual Ipv4MulticastRoute GetMulticastRoute (uint32_t i) const = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   246
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   247
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   248
   * \param i index of route to remove from routing table.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   249
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   250
  virtual void RemoveMulticastRoute (uint32_t i) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   251
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   252
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   253
   * \param device device to add to the list of ipv4 interfaces
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   254
   *        which can be used as output interfaces during packet forwarding.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   255
   * \returns the index of the ipv4 interface added.
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   256
   *
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   257
   * Once a device has been added, it can never be removed: if you want
755
64403472ab29 IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 752
diff changeset
   258
   * to disable it, you can invoke Ipv4::SetDown which will
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   259
   * make sure that it is never used during packet forwarding.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   260
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 525
diff changeset
   261
  virtual uint32_t AddInterface (Ptr<NetDevice> device) = 0;
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   262
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   263
   * \returns the number of interfaces added by the user.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   264
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   265
  virtual uint32_t GetNInterfaces (void) = 0;  
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   266
540
507eababb124 Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents: 525
diff changeset
   267
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   268
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   269
   * \returns the NetDevice associated with the ipv4 interface index
540
507eababb124 Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents: 525
diff changeset
   270
   */
593
90cf12cb4ab7 merge with trunk
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 580 540
diff changeset
   271
  virtual Ptr<NetDevice> GetNetDevice (uint32_t i) = 0;
540
507eababb124 Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents: 525
diff changeset
   272
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   273
  /**
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   274
   * \brief Join a multicast group for a given multicast source and 
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   275
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   276
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   277
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   278
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   279
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   280
  virtual void JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   281
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   282
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   283
   * \brief Leave a multicast group for a given multicast source and 
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   284
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   285
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   286
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   287
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   288
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   289
  virtual void LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   290
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   291
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   292
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   293
   * \param address address to associate to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   294
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   295
  virtual void SetAddress (uint32_t i, Ipv4Address address) = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   296
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   297
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   298
   * \param mask mask to associate to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   299
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   300
  virtual void SetNetworkMask (uint32_t i, Ipv4Mask mask) = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   301
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   302
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   303
   * \returns the mask associated to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   304
   */
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   305
  virtual Ipv4Mask GetNetworkMask (uint32_t i) const = 0;
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   306
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   307
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   308
   * \returns the address associated to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   309
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   310
  virtual Ipv4Address GetAddress (uint32_t i) const = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   311
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   312
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   313
   * \returns the Maximum Transmission Unit (in bytes) associated
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   314
   *          to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   315
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   316
  virtual uint16_t GetMtu (uint32_t i) const = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   317
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   318
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   319
   * \returns true if the underlying interface is in the "up" state,
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   320
   *          false otherwise.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   321
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   322
  virtual bool IsUp (uint32_t i) const = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   323
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   324
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   325
   * 
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   326
   * Set the interface into the "up" state. In this state, it is
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   327
   * considered valid during ipv4 forwarding.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   328
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   329
  virtual void SetUp (uint32_t i) = 0;
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   330
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   331
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   332
   *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   333
   * Set the interface into the "down" state. In this state, it is
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   334
   * ignored during ipv4 forwarding.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   335
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   336
  virtual void SetDown (uint32_t i) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   337
  
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   338
};
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   339
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   340
} // namespace ns3 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   341
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   342
#endif /* IPV4_H */