src/node/ipv4.h
author Tom Henderson <tomh@tomh.org>
Wed, 08 Apr 2009 13:35:34 -0700
changeset 4372 d99061f1167c
parent 3380 38b8549b1ad3
child 4373 e493e80274bd
permissions -rw-r--r--
Ipv4::ifIndex -> Ipv4::interface
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
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * 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
     6
 * 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
     7
 * published by the Free Software Foundation;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * 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
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * 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
    15
 * 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
    16
 * 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
    17
 *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
    20
#ifndef IPV4_H
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
    21
#define IPV4_H
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <stdint.h>
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include "ns3/ipv4-address.h"
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 638
diff changeset
    25
#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
    26
#include "ns3/callback.h"
757
f4a677b1f753 fix bug 28
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 755
diff changeset
    27
#include "ipv4-route.h"
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
namespace ns3 {
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
1316
f357c6a2bb37 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function
Tom Henderson <tomh@tomh.org>
parents: 1308
diff changeset
    31
class Node;
522
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;
3216
b36bb98d766e bug 207: ipv4-header.h needed in src/node module.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3183
diff changeset
    35
class Ipv4Header;
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
    36
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
    37
/**
3183
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    38
 * \ingroup node
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    39
 * \defgroup ipv4 Ipv4
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    40
 */
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    41
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    42
/**
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    43
 * \ingroup ipv4
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    44
 *
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
    45
 * \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
    46
 *
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
    47
 * 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
    48
 * 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
    49
 * 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
    50
 * 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
    51
 */
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
    52
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
    53
{
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
    54
public:
1308
5c5937a4150d backout 9856d1175cbb:642d6798feaa:27dd3e15308a
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1303
diff changeset
    55
  // 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
    56
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
    57
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
    58
  /**
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
    59
   * \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
    60
   *
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
   * \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
    62
   * 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
    63
   *
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
   * \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
    65
   *
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
   * \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
    67
   * 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
    68
   *
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
   * \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
    70
   * 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
    71
   * 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
    72
   *
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
    73
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1452
diff changeset
    74
  typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback;
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
    75
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
    76
  /**
3258
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
    77
   * \brief Request that a packet be routed.
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
    78
   *
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
    79
   * \param interface 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
    80
   * \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
    81
   * \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
    82
   * \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
    83
   *
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
    84
   * \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
    85
   * 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
    86
   *
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
   * 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
    88
   * 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
    89
   *
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
   * 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
    91
   * 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
    92
   * 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
    93
   * 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
    94
   * 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
    95
   * 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
    96
   *
3258
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
    97
   * If the routing protocol implementation assumes that it can provide
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
    98
   * 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
    99
   * 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
   100
   * 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
   101
   * 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
   102
   * 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
   103
   * 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
   104
   * 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
   105
   * 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
   106
   * 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
   107
   * insert any extra header.
3258
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
   108
   *
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
   109
   * Multicast routing is expected to be supported in this method.  If a
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
   110
   * multicast route is encountered, all routes to a given multicast
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
   111
   * destination will be serviced by cloning the packet and calling the 
232368ff7dec documentation to resolve bug 75
Craig Dowell <craigdo@ee.washington.edu>
parents: 3216
diff changeset
   112
   * route reply callback once for each outgoing interface in the route.
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
   113
   */
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   114
  virtual bool RequestRoute (uint32_t interface,
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   115
                             const Ipv4Header &ipHeader,
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1452
diff changeset
   116
                             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: 757
diff changeset
   117
                             RouteReplyCallback routeReply) = 0;
1452
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   118
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   119
/**
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   120
 * \brief Synchronously check to see if we can determine the interface index 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   121
 * that will be 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
   122
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   123
 * 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
   124
 * 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
   125
 * 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
   126
 * 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
   127
 * 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
   128
 * 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
   129
 * 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
   130
 * given destination.
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   131
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   132
 * 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
   133
 * 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
   134
 * 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
   135
 * 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   136
 * If there are multiple paths out of the node, the resolution is performed
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   137
 * by Ipv4L3Protocol::GetInterfaceforDestination which has access to more 
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   138
 * 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
   139
 *
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   140
 * \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
   141
 * packet.  This may be a multicast group address.
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   142
 * \param interface A reference to the interface index over which a packet
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   143
 * 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
   144
 * \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
   145
 * a single output interface index, otherwise false.
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
 * \see Ipv4StaticRouting
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   148
 * \see Ipv4RoutingProtocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   149
 * \see Ipv4L3Protocol
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   150
 */
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   151
  virtual bool RequestInterface (Ipv4Address destination, 
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   152
                              uint32_t& interface) = 0;
1432
3aef7d7a71c2 more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1428
diff changeset
   153
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   154
  static const uint32_t INTERFACE_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
   155
};
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
   156
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 593
diff changeset
   157
/**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   158
 * \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
   159
 *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   160
 * 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
   161
 * 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
   162
 * achieving multihoming.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   163
 *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   164
 * 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
   165
 * forwarding table.
633
ecedbcb39fb7 Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 593
diff changeset
   166
 */
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   167
class Ipv4 : public Object
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   168
{
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   169
public:
2251
04963d8cca51 iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2250
diff changeset
   170
  static TypeId GetTypeId (void);
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   171
  Ipv4 ();
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   172
  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
   173
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
   174
  /**
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
   175
   * \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
   176
   * 
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
   177
   * \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
   178
   * \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
   179
   * 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
   180
   * 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
   181
   * 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
   182
   * 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
   183
   */
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
   184
  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
   185
                                   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
   186
  
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   187
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   188
   * \param dest destination address
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   189
   * \param nextHop address of next hop.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   190
   * \param interface interface of next hop.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
   *
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   192
   * Add route to host dest through host nextHop 
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   193
   * on interface.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   194
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   195
  virtual void AddHostRouteTo (Ipv4Address dest, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   196
			       Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   197
			       uint32_t interface) = 0;
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
   * \param dest destination address
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   200
   * \param interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   201
   *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   202
   * add route to host dest on interface.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   203
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   204
  virtual void AddHostRouteTo (Ipv4Address dest, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   205
			       uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   206
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
   * \param network destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   209
   * \param networkMask netmask of destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   210
   * \param nextHop address of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   211
   * \param interface interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   212
   * 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   213
   * add route to network dest with netmask 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   214
   * through host nextHop on interface
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   215
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   216
  virtual void AddNetworkRouteTo (Ipv4Address network, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   217
				  Ipv4Mask networkMask, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   218
				  Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   219
				  uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   220
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   221
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   222
   * \param network destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   223
   * \param networkMask netmask of destination network
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   224
   * \param interface interface of next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
   *
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   226
   * add route to network dest with netmask 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
   * on interface
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
  virtual void AddNetworkRouteTo (Ipv4Address network, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   230
				  Ipv4Mask networkMask, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   231
				  uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   233
   * \param nextHop address of default next hop
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
   * \param interface interface of default next hop.
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
   * set the default route to host nextHop on
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   237
   * interface. 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   238
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
  virtual void SetDefaultRoute (Ipv4Address nextHop, 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   240
				uint32_t interface) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   241
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   242
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   243
   * \returns the number of entries in the routing table.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   244
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   245
  virtual uint32_t GetNRoutes (void) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   246
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   247
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   248
   * \param i index of route to return
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   249
   * \returns the route whose index is i
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   250
   */
757
f4a677b1f753 fix bug 28
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 755
diff changeset
   251
  virtual Ipv4Route GetRoute (uint32_t i) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   252
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   253
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   254
   * \param i index of route to remove from routing table.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   255
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   256
  virtual void RemoveRoute (uint32_t i) = 0;
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   257
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   258
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   259
   * \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
   260
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   261
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   262
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   263
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   264
   * \param inputInterface The interface index over which the packet arrived.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   265
   * \param outputInterfaces The list of output interface indices over which 
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   266
   *        the packet should be sent (excluding the inputInterface).
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   267
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   268
  virtual void AddMulticastRoute (Ipv4Address origin,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   269
                                  Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   270
                                  uint32_t inputInterface,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   271
                                  std::vector<uint32_t> outputInterfaces) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   272
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   273
   * \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
   274
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   275
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   276
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   277
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   278
   * \param inputInterface The interface index over which the packet arrived.
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 RemoveMulticastRoute (Ipv4Address origin,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   281
                                     Ipv4Address group,
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   282
                                     uint32_t inputInterface) = 0;
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   283
  
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   284
  /**
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   285
   * \brief Set the default static multicast route.
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   286
   *
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   287
   * \param outputInterface The network output interface index over which 
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   288
   *        packets without specific routes should be sent.
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   289
   */
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   290
  virtual void SetDefaultMulticastRoute (uint32_t outputInterface) = 0;
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   291
1442
bb5cf98c0c64 real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents: 1440
diff changeset
   292
  /**
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   293
   * \returns the number of entries in the multicast routing table.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   294
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   295
  virtual uint32_t GetNMulticastRoutes (void) const = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   296
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   297
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   298
   * \param i index of route to return
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   299
   * \returns the route whose index is i
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   300
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   301
  virtual Ipv4MulticastRoute GetMulticastRoute (uint32_t i) const = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   302
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   303
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   304
   * \param i index of route to remove from routing table.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   305
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   306
  virtual void RemoveMulticastRoute (uint32_t i) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   307
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   308
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   309
   * \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
   310
   *        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
   311
   * \returns the index of the ipv4 interface added.
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   312
   *
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   313
   * 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
   314
   * 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
   315
   * make sure that it is never used during packet forwarding.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   316
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 525
diff changeset
   317
  virtual uint32_t AddInterface (Ptr<NetDevice> device) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   318
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   319
  /**
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   320
   * \returns the number of interfaces added by the user.
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   321
   */
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   322
  virtual uint32_t GetNInterfaces (void) = 0;  
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   323
540
507eababb124 Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents: 525
diff changeset
   324
  /**
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
   325
   * \brief Find and return the interface ID of the interface that has been
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
   326
   *        assigned the specified IP address.
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
   327
   * \param addr The IP address assigned to the interface of interest.
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
   328
   * \returns The index of the ipv4 interface with the given address.
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
   329
   *
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
   330
   * Each IP interface has an IP address associated with it.  It is often 
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
   331
   * useful to search the list of interfaces for one that corresponds to 
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
   332
   * a known IP Address.  This call takes an IP address as a parameter and
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
   333
   * returns the interface index of the first interface that has been assigned
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
   334
   * that address.  If the address is not found, this function asserts.
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
   335
   */
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
   336
  virtual uint32_t FindInterfaceForAddr (Ipv4Address addr) const = 0;
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
   337
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
   338
  /**
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
   339
   * \brief Find and return the interface ID of the interface that has been
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
   340
   *        assigned the specified (masked) IP address.
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
   341
   * \param addr The IP address assigned to the interface of interest.
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
   342
   * \param mask The address mask to be used in address matching.
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
   343
   * \returns The index of the ipv4 interface with the given address.
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
   344
   *
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
   345
   * Each IP interface has an IP address associated with it.  It is often 
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
   346
   * useful to search the list of interfaces for one that corresponds to 
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
   347
   * a known IP Address.  This call takes an IP address and an IP address
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
   348
   * mask as parameters and returns the interface index of the first interface
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
   349
   * that matches the masked IP address.
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
   350
   */
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
   351
  virtual uint32_t FindInterfaceForAddr (Ipv4Address addr, 
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
   352
    Ipv4Mask mask) const = 0;
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
   353
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
   354
  /**
2711
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   355
   * \brief Find and return the interface ID of the interface that has been
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   356
   *        associated with the specified (masked) NetDevice
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   357
   * \param nd The net device of the interface of interest.
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   358
   * \returns The index of the ipv4 interface associated with the given net 
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   359
   *          device or -1 if not found.
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   360
   *
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   361
   * Each IP interface is associated with a net device.  It is often 
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   362
   * useful to search the list of interfaces for one that corresponds to 
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   363
   * a known net device.  This call takes an smart pointer to a net device
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   364
   * and returns the interface index of the first interface that matches the
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   365
   * net device.
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   366
   */
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   367
  virtual int32_t FindInterfaceForDevice(Ptr<NetDevice> nd) const = 0;
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   368
83addb15f632 ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents: 2253
diff changeset
   369
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   370
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   371
   * \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
   372
   */
593
90cf12cb4ab7 merge with trunk
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 580 540
diff changeset
   373
  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
   374
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   375
  /**
1428
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   376
   * \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
   377
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   378
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   379
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   380
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   381
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   382
  virtual void JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   383
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   384
  /**
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   385
   * \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
   386
   *        group.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   387
   *
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   388
   * \param origin The Ipv4 address of the multicast source.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   389
   * \param group The multicast group address.
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   390
   */
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   391
  virtual void LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) = 0;
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   392
a8f3d01d4a2c untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents: 985
diff changeset
   393
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   394
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   395
   * \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
   396
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   397
  virtual void SetAddress (uint32_t i, Ipv4Address address) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   398
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   399
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   400
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   401
   * \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
   402
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   403
  virtual void SetNetworkMask (uint32_t i, Ipv4Mask mask) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   404
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   405
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   406
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   407
   * \returns the mask associated to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   408
   */
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   409
  virtual Ipv4Mask GetNetworkMask (uint32_t i) const = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   410
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   411
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   412
   * \param i index of ipv4 interface
1776
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   413
   * \param metric routing metric (cost) associated to the underlying 
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   414
   *          ipv4 interface
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   415
   */
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   416
  virtual void SetMetric (uint32_t i, uint16_t metric) = 0;
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   417
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   418
  /**
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   419
   * \param i index of ipv4 interface
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   420
   * \returns routing metric (cost) associated to the underlying 
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   421
   *          ipv4 interface
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   422
   */
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   423
  virtual uint16_t GetMetric (uint32_t i) const = 0;
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   424
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   425
  /**
0d5be0c3d229 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc
Tom Henderson <tomh@tomh.org>
parents: 1452
diff changeset
   426
   * \param i index of ipv4 interface
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   427
   * \returns the address associated to the underlying ipv4 interface
3380
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   428
   *
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   429
   * Note that the broadcast address for this interface may be fetched
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   430
   * from the Ipv4Address object returned here using
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   431
   * Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   432
   * the interface may be retrived using Ipv4::GetNetworkMask(i).
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   433
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   434
  virtual Ipv4Address GetAddress (uint32_t i) const = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   435
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   436
  /**
1434
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   437
   * \param destination The IP address of a hypothetical destination.
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   438
   * \returns The IP address assigned to the interface that will be used
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   439
   * if we were to send a packet to destination.
3380
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   440
   *
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   441
   * Note that the broadcast address for this interface may be fetched
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   442
   * from the Ipv4Address object returned here using
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   443
   * Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3258
diff changeset
   444
   * the interface may be retrived using Ipv4::GetNetworkMask(i).
1434
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   445
   */
2b63aafb050b set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents: 1432
diff changeset
   446
  virtual Ipv4Address GetSourceAddress (Ipv4Address destination) const = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   447
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   448
  /**
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1776
diff changeset
   449
   * \param dest The IP address of a hypothetical destination.
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   450
   * \param interface filled in with the interface index that will be used to
1452
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   451
   *        send a packet to the hypothetical destination.
1795
820cc1254290 get rid of doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1776
diff changeset
   452
   * \returns true if a single interface can be identified, false otherwise.
1452
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   453
   */
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   454
  virtual bool GetInterfaceForDestination (Ipv4Address dest,
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   455
                                         uint32_t &interface) const = 0;
1452
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   456
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   457
  /**
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   458
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   459
   * \returns the Maximum Transmission Unit (in bytes) associated
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   460
   *          to the underlying ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   461
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   462
  virtual uint16_t GetMtu (uint32_t i) const = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   463
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   464
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   465
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   466
   * \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
   467
   *          false otherwise.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   468
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   469
  virtual bool IsUp (uint32_t i) const = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   470
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   471
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   472
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   473
   * 
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   474
   * 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
   475
   * considered valid during ipv4 forwarding.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   476
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   477
  virtual void SetUp (uint32_t i) = 0;
1444
7c81b4e2617d piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents: 1442
diff changeset
   478
638
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   479
  /**
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   480
   * \param i index of ipv4 interface
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   481
   *
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   482
   * 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
   483
   * ignored during ipv4 forwarding.
e979214cc52d improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 633
diff changeset
   484
   */
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   485
  virtual void SetDown (uint32_t i) = 0;
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   486
1824
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   487
  /**
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   488
   * \brief Convenience function to return the interface corresponding
1824
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   489
   * to the Ipv4Address provided
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   490
   *
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   491
   * \param addr Ipv4Address
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   492
   * \param mask corresponding Ipv4Mask
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   493
   * \returns interface corresponding to a/amask
1824
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   494
   */
4372
d99061f1167c Ipv4::ifIndex -> Ipv4::interface
Tom Henderson <tomh@tomh.org>
parents: 3380
diff changeset
   495
  virtual uint32_t GetInterfaceByAddress (Ipv4Address addr, 
1824
fd6f6604caad move ipv4 static to member functions
Tom Henderson <tomh@tomh.org>
parents: 1795
diff changeset
   496
    Ipv4Mask mask = Ipv4Mask("255.255.255.255"));
1452
973c456d3684 socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents: 1449
diff changeset
   497
};
1316
f357c6a2bb37 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function
Tom Henderson <tomh@tomh.org>
parents: 1308
diff changeset
   498
522
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   499
} // namespace ns3 
d5039448597a remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   500
752
a4febfb8416f IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 751
diff changeset
   501
#endif /* IPV4_H */