author | Pedro Silva <pmms@inesctec.pt> |
Wed, 29 Oct 2014 10:12:53 -0700 | |
changeset 11040 | cd2eda848730 |
parent 10563 | 4ae5b76ae0c2 |
permissions | -rw-r--r-- |
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> |
710
2a9c061219a7
port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
638
diff
changeset
|
24 |
#include "ns3/object.h" |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
25 |
#include "ns3/socket.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" |
6823
a27f86fb4e55
Merge node and common modules into new network module
Tom Henderson <tomh@tomh.org>
parents:
6273
diff
changeset
|
27 |
#include "ns3/ipv4-address.h" |
6825
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
28 |
#include "ipv4-route.h" |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
29 |
#include "ipv4-interface-address.h" |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
|
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
namespace ns3 { |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
|
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
|
33 |
class Node; |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
class NetDevice; |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
class Packet; |
4560
2f106fd728ab
Remove static routing dependencies in code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4482
diff
changeset
|
36 |
class Ipv4RoutingProtocol; |
10563 | 37 |
class IpL4Protocol; |
38 |
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
|
39 |
|
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
|
40 |
/** |
7149
87514e0d866b
Fix doxygen groups for some new modules
Mitch Watrous <watrous@u.washington.edu>
parents:
6834
diff
changeset
|
41 |
* \ingroup internet |
3183 | 42 |
* \defgroup ipv4 Ipv4 |
4701 | 43 |
*/ |
44 |
/** |
|
45 |
* \ingroup ipv4 |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
46 |
* \brief Access to the Ipv4 forwarding table, interfaces, and configuration |
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
|
47 |
* |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
48 |
* This class defines the API to manipulate the following aspects of |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
49 |
* the Ipv4 implementation: |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
50 |
* -# set/get an Ipv4RoutingProtocol |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
51 |
* -# register a NetDevice for use by the Ipv4 layer (basically, to |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
52 |
* create Ipv4-related state such as addressing and neighbor cache that |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
53 |
* is associated with a NetDevice) |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
54 |
* -# manipulate the status of the NetDevice from the Ipv4 perspective, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
55 |
* such as marking it as Up or Down, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
56 |
* -# adding, deleting, and getting addresses associated to the Ipv4 |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
57 |
* interfaces. |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
58 |
* -# exporting Ipv4 configuration attributes |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
59 |
* |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
60 |
* Each NetDevice has conceptually a single Ipv4 interface associated |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
61 |
* with it (the corresponding structure in the Linux Ipv4 implementation |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
62 |
* is struct in_device). Each interface may have one or more Ipv4 |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
63 |
* addresses associated with it. Each Ipv4 address may have different |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
64 |
* subnet mask, scope, etc., so all of this per-address information |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
65 |
* is stored in an Ipv4InterfaceAddress class (the corresponding |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
66 |
* structure in Linux is struct in_ifaddr) |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
67 |
* |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
68 |
* Ipv4 attributes such as whether IP forwarding is enabled and disabled |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
69 |
* are also stored in this class |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
70 |
* |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
71 |
* TO DO: Add API to allow access to the Ipv4 neighbor table |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
72 |
* |
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
73 |
* \see Ipv4RoutingProtocol |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
74 |
* \see Ipv4InterfaceAddress |
633
ecedbcb39fb7
Some dox additions/fixes
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
593
diff
changeset
|
75 |
*/ |
752
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
751
diff
changeset
|
76 |
class Ipv4 : public Object |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
{ |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
public: |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
79 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
80 |
* \brief Get the type ID. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
81 |
* \return the object TypeId |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
82 |
*/ |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
83 |
static TypeId GetTypeId (void); |
752
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
751
diff
changeset
|
84 |
Ipv4 (); |
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
751
diff
changeset
|
85 |
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
|
86 |
|
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
|
87 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
88 |
* \brief Register a new routing protocol to be used by this Ipv4 stack |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
89 |
* |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
90 |
* This call will replace any routing protocol that has been previously |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
91 |
* registered. If you want to add multiple routing protocols, you must |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
92 |
* add them to a Ipv4ListRoutingProtocol directly. |
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
|
93 |
* |
4481 | 94 |
* \param routingProtocol smart pointer to Ipv4RoutingProtocol object |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
96 |
virtual void SetRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol) = 0; |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
97 |
|
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
98 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
99 |
* \brief Get the routing protocol to be used by this Ipv4 stack |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
100 |
* |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
101 |
* \returns smart pointer to Ipv4RoutingProtocol object, or null pointer if none |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
102 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
103 |
virtual Ptr<Ipv4RoutingProtocol> GetRoutingProtocol (void) const = 0; |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
985
diff
changeset
|
104 |
|
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
985
diff
changeset
|
105 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
106 |
* \param device device to add to the list of Ipv4 interfaces |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
107 |
* which can be used as output interfaces during packet forwarding. |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
108 |
* \returns the index of the Ipv4 interface added. |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
109 |
* |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
110 |
* 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
|
111 |
* 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
|
112 |
* make sure that it is never used during packet forwarding. |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
113 |
*/ |
568
e1660959ecbb
use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
525
diff
changeset
|
114 |
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
|
115 |
|
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
116 |
/** |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
117 |
* \returns the number of interfaces added by the user. |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
118 |
*/ |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
119 |
virtual uint32_t GetNInterfaces (void) const = 0; |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
120 |
|
540
507eababb124
Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents:
525
diff
changeset
|
121 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
122 |
* \brief Return the interface number of the interface that has been |
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
|
123 |
* assigned the specified IP address. |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
124 |
* |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
125 |
* \param address The IP address being searched for |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
126 |
* \returns The interface number of the Ipv4 interface with the given |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
127 |
* address or -1 if not found. |
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
|
128 |
* |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
129 |
* Each IP interface has one or more IP addresses associated with it. |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
130 |
* This method searches the list of interfaces for one that holds a |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
131 |
* particular address. This call takes an IP address as a parameter and |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
132 |
* returns the interface number of the first interface that has been assigned |
5760
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
133 |
* that address, or -1 if not found. There must be an exact match; this |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
134 |
* method will not match broadcast or multicast addresses. |
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
|
135 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
136 |
virtual int32_t GetInterfaceForAddress (Ipv4Address address) const = 0; |
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
|
137 |
|
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
|
138 |
/** |
6825
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
139 |
* \param packet packet to send |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
140 |
* \param source source address of packet |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
141 |
* \param destination address of packet |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
142 |
* \param protocol number of packet |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
143 |
* \param route route entry |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
144 |
* |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
145 |
* Higher-level layers call this method to send a packet |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
146 |
* down the stack to the MAC and PHY layers. |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
147 |
*/ |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
148 |
virtual void Send (Ptr<Packet> packet, Ipv4Address source, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
149 |
Ipv4Address destination, uint8_t protocol, Ptr<Ipv4Route> route) = 0; |
6825
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
150 |
|
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
151 |
/** |
8922
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
152 |
* \param packet packet to send |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
153 |
* \param ipHeader IP Header |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
154 |
* \param route route entry |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
155 |
* |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
156 |
* Higher-level layers call this method to send a packet with IPv4 Header |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
157 |
* (Intend to be used with IpHeaderInclude attribute.) |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
158 |
*/ |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
159 |
virtual void SendWithHeader (Ptr<Packet> packet, Ipv4Header ipHeader, Ptr<Ipv4Route> route) = 0; |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
160 |
|
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
161 |
/** |
6825
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
162 |
* \param protocol a pointer to the protocol to add to this L4 Demux. |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
163 |
* |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
164 |
* Adds a protocol to an internal list of L4 protocols. |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
165 |
* |
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
166 |
*/ |
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7256
diff
changeset
|
167 |
virtual void Insert (Ptr<IpL4Protocol> protocol) = 0; |
6825
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
168 |
|
f9a45d9a10d0
NS-3 Click Integration merge
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6823
diff
changeset
|
169 |
/** |
5760
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
170 |
* \brief Determine whether address and interface corresponding to |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
171 |
* received packet can be accepted for local delivery |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
172 |
* |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
173 |
* \param address The IP address being considered |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
174 |
* \param iif The incoming Ipv4 interface index |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
175 |
* \returns true if the address is associated with the interface index |
5760
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
176 |
* |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
177 |
* This method can be used to determine whether a received packet has |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
178 |
* an acceptable address for local delivery on the host. The address |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
179 |
* may be a unicast, multicast, or broadcast address. This method will |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
180 |
* return true if address is an exact match of a unicast address on |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
181 |
* one of the host's interfaces (see below), if address corresponds to |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
182 |
* a multicast group that the host has joined (and the incoming device |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
183 |
* is acceptable), or if address corresponds to a broadcast address. |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
184 |
* |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
185 |
* If the Ipv4 attribute WeakEsModel is true, the unicast address may |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
186 |
* match any of the Ipv4 addresses on any interface. If the attribute is |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
187 |
* false, the address must match one assigned to the incoming device. |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
188 |
*/ |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
189 |
virtual bool IsDestinationAddress (Ipv4Address address, uint32_t iif) const = 0; |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
190 |
|
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
191 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
192 |
* \brief Return the interface number of first interface found that |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
193 |
* has an Ipv4 address within the prefix specified by the input |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
194 |
* address and mask parameters |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
195 |
* |
4481 | 196 |
* \param address The IP address assigned to the interface of interest. |
197 |
* \param mask The IP prefix to use in the mask |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
198 |
* \returns The interface number of the Ipv4 interface with the given |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
199 |
* address or -1 if not found. |
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
|
200 |
* |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
201 |
* Each IP interface has one or more IP addresses associated with it. |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
202 |
* This method searches the list of interfaces for the first one found |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
203 |
* that holds an address that is included within the prefix |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
204 |
* formed by the input address and mask parameters. The value -1 is |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
205 |
* returned if no match is found. |
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
|
206 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
207 |
virtual int32_t GetInterfaceForPrefix (Ipv4Address address, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
208 |
Ipv4Mask mask) const = 0; |
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
|
209 |
|
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
|
210 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
211 |
* \param interface The interface number of an Ipv4 interface. |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
212 |
* \returns The NetDevice associated with the Ipv4 interface number. |
2711
83addb15f632
ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents:
2253
diff
changeset
|
213 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
214 |
virtual Ptr<NetDevice> GetNetDevice (uint32_t interface) = 0; |
2711
83addb15f632
ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents:
2253
diff
changeset
|
215 |
|
83addb15f632
ip helper and find ip interface for device method on ipv4
Craig Dowell <craigdo@ee.washington.edu>
parents:
2253
diff
changeset
|
216 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
217 |
* \param device The NetDevice for an Ipv4Interface |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
218 |
* \returns The interface number of an Ipv4 interface or -1 if not found. |
540
507eababb124
Separate address assignment from routing in PointToPoint topology code
Tom Henderson <tomh@tomh.org>
parents:
525
diff
changeset
|
219 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
220 |
virtual int32_t GetInterfaceForDevice (Ptr<const NetDevice> device) const = 0; |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
985
diff
changeset
|
221 |
|
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
985
diff
changeset
|
222 |
/** |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
223 |
* \param interface Interface number of an Ipv4 interface |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
224 |
* \param address Ipv4InterfaceAddress address to associate with the underlying Ipv4 interface |
4563 | 225 |
* \returns true if the operation succeeded |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
226 |
*/ |
4563 | 227 |
virtual bool AddAddress (uint32_t interface, Ipv4InterfaceAddress address) = 0; |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
228 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
229 |
/** |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
230 |
* \param interface Interface number of an Ipv4 interface |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
231 |
* \returns the number of Ipv4InterfaceAddress entries for the interface. |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
232 |
*/ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
233 |
virtual uint32_t GetNAddresses (uint32_t interface) const = 0; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
234 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
235 |
/** |
4563 | 236 |
* Because addresses can be removed, the addressIndex is not guaranteed |
237 |
* to be static across calls to this method. |
|
238 |
* |
|
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
239 |
* \param interface Interface number of an Ipv4 interface |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
240 |
* \param addressIndex index of Ipv4InterfaceAddress |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5850
diff
changeset
|
241 |
* \returns the Ipv4InterfaceAddress associated to the interface and addressIndex |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
242 |
*/ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
243 |
virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
244 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
245 |
/** |
4563 | 246 |
* Remove the address at addressIndex on named interface. The addressIndex |
247 |
* for all higher indices will decrement by one after this method is called; |
|
248 |
* so, for example, to remove 5 addresses from an interface i, one could |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
249 |
* call RemoveAddress (i, 0); 5 times. |
4563 | 250 |
* |
251 |
* \param interface Interface number of an Ipv4 interface |
|
252 |
* \param addressIndex index of Ipv4InterfaceAddress to remove |
|
253 |
* \returns true if the operation succeeded |
|
254 |
*/ |
|
255 |
virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0; |
|
256 |
||
9915
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
257 |
/** |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
258 |
* \brief Remove the given address on named Ipv4 interface |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
259 |
* |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
260 |
* \param interface Interface number of an Ipv4 interface |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
261 |
* \param address The address to remove |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
262 |
* \returns true if the operation succeeded |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
263 |
*/ |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
264 |
virtual bool RemoveAddress (uint32_t interface, Ipv4Address address) = 0; |
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
8922
diff
changeset
|
265 |
|
4563 | 266 |
/** |
5850
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
267 |
* \brief Return the first primary source address with scope less than |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
268 |
* or equal to the requested scope, to use in sending a packet to |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
269 |
* destination dst out of the specified device. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
270 |
* |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
271 |
* This method mirrors the behavior of Linux inet_select_addr() and is |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
272 |
* provided because interfaces may have multiple IP addresses configured |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
273 |
* on them with different scopes, and with a primary and secondary status. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
274 |
* Secondary addresses are never returned. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
275 |
* \see Ipv4InterfaceAddress |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
276 |
* |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
277 |
* If a non-zero device pointer is provided, the method first tries to |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
278 |
* return a primary address that is configured on that device, and whose |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
279 |
* subnet matches that of dst and whose scope is less than or equal to |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
280 |
* the requested scope. If a primary address does not match the |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
281 |
* subnet of dst but otherwise matches the scope, it is returned. |
5850
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
282 |
* If no such address on the device is found, the other devices are |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
283 |
* searched in order of their interface index, but not considering dst |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
284 |
* as a factor in the search. Because a loopback interface is typically |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
285 |
* the first one configured on a node, it will be the first alternate |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
286 |
* device to be tried. Addresses scoped at LINK scope are not returned |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
287 |
* in this phase. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
288 |
* |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
289 |
* If no device pointer is provided, the same logic as above applies, only |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
290 |
* that there is no preferred device that is consulted first. This means |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
291 |
* that if the device pointer is null, input parameter dst will be ignored. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
292 |
* |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
293 |
* If there are no possible addresses to return, a warning log message |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
294 |
* is issued and the all-zeroes address is returned. |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
295 |
* |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
296 |
* \param device output NetDevice (optionally provided, only to constrain the search) |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
297 |
* \param dst Destination address to match, if device is provided |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
298 |
* \param scope Scope of returned address must be less than or equal to this |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
299 |
* \returns the first primary Ipv4Address that meets the search criteria |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
300 |
*/ |
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
301 |
virtual Ipv4Address SelectSourceAddress (Ptr<const NetDevice> device, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7149
diff
changeset
|
302 |
Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope) = 0; |
5850
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
303 |
|
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
304 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
305 |
* \param interface The interface number of an 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
|
306 |
* \param metric routing metric (cost) associated to the underlying |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
307 |
* 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
|
308 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
309 |
virtual void SetMetric (uint32_t interface, uint16_t metric) = 0; |
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
|
310 |
|
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
|
311 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
312 |
* \param interface The interface number of an Ipv4 interface |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
313 |
* \returns routing metric (cost) associated to the underlying |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
314 |
* Ipv4 interface |
1434
2b63aafb050b
set source address in socket
Craig Dowell <craigdo@ee.washington.edu>
parents:
1432
diff
changeset
|
315 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
316 |
virtual uint16_t GetMetric (uint32_t interface) const = 0; |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
317 |
|
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
318 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
319 |
* \param interface Interface number of Ipv4 interface |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
320 |
* \returns the Maximum Transmission Unit (in bytes) associated |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
321 |
* to the underlying Ipv4 interface |
1452
973c456d3684
socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents:
1449
diff
changeset
|
322 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
323 |
virtual uint16_t GetMtu (uint32_t interface) const = 0; |
1452
973c456d3684
socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents:
1449
diff
changeset
|
324 |
|
973c456d3684
socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents:
1449
diff
changeset
|
325 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
326 |
* \param interface Interface number of Ipv4 interface |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
327 |
* \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
|
328 |
* false otherwise. |
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
329 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
330 |
virtual bool IsUp (uint32_t interface) const = 0; |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
331 |
|
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
332 |
/** |
4481 | 333 |
* \param interface Interface number of Ipv4 interface |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
334 |
* |
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
335 |
* Set the interface into the "up" state. In this state, it is |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
336 |
* considered valid during Ipv4 forwarding. |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
337 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
338 |
virtual void SetUp (uint32_t interface) = 0; |
1444
7c81b4e2617d
piles of doxygen, changes to SetDefaultMulticastRoute plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1442
diff
changeset
|
339 |
|
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
340 |
/** |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
341 |
* \param interface Interface number of Ipv4 interface |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
342 |
* |
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
343 |
* Set the interface into the "down" state. In this state, it is |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
344 |
* ignored during Ipv4 forwarding. |
638
e979214cc52d
improve IIpv4 dox
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
345 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
346 |
virtual void SetDown (uint32_t interface) = 0; |
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
347 |
|
4607
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
348 |
/** |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
349 |
* \param interface Interface number of Ipv4 interface |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
350 |
* \returns true if IP forwarding enabled for input datagrams on this device |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
351 |
*/ |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
352 |
virtual bool IsForwarding (uint32_t interface) const = 0; |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
353 |
|
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
354 |
/** |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
355 |
* \param interface Interface number of Ipv4 interface |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
356 |
* \param val Value to set the forwarding flag |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
357 |
* |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
358 |
* If set to true, IP forwarding is enabled for input datagrams on this device |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
359 |
*/ |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
360 |
virtual void SetForwarding (uint32_t interface, bool val) = 0; |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4563
diff
changeset
|
361 |
|
8922
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
362 |
/** |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
363 |
* \param protocolNumber number of protocol to lookup |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
364 |
* in this L4 Demux |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
365 |
* \returns a matching L4 Protocol |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
366 |
* |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
367 |
* This method is typically called by lower layers |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
368 |
* to forward packets up the stack to the right protocol. |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
369 |
*/ |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
370 |
virtual Ptr<IpL4Protocol> GetProtocol (int protocolNumber) const = 0; |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
371 |
|
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
372 |
/** |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
373 |
* \brief Creates a raw socket |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
374 |
* |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
375 |
* \returns a smart pointer to the instantiated raw socket |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
376 |
*/ |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
377 |
virtual Ptr<Socket> CreateRawSocket (void) = 0; |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
378 |
|
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
379 |
/** |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
380 |
* \brief Deletes a particular raw socket |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
381 |
* |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
382 |
* \param socket Smart pointer to the raw socket to be deleted |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
383 |
*/ |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
384 |
virtual void DeleteRawSocket (Ptr<Socket> socket) = 0; |
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
385 |
|
922350836734
Bug 1477: Click doesn't work with raw sockets
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7717
diff
changeset
|
386 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
387 |
static const uint32_t IF_ANY = 0xffffffff; //!< interface wildcard, meaning any interface |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
388 |
|
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
389 |
private: |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
390 |
// Indirect the Ipv4 attributes through private pure virtual methods |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
391 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
392 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
393 |
* \brief Set or unset the IP forwarding state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
394 |
* \param forward the forwarding state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
395 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
396 |
virtual void SetIpForward (bool forward) = 0; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
397 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
398 |
* \brief Get the IP forwarding state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
399 |
* \returns true if IP is in forwarding state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
400 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
401 |
virtual bool GetIpForward (void) const = 0; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
402 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
403 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
404 |
* \brief Set or unset the Weak Es Model |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
405 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
406 |
* RFC1122 term for whether host accepts datagram with a dest. address on another interface |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
407 |
* \param model true for Weak Es Model |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
408 |
*/ |
5760
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
409 |
virtual void SetWeakEsModel (bool model) = 0; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
410 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
411 |
* \brief Get the Weak Es Model status |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
412 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
413 |
* RFC1122 term for whether host accepts datagram with a dest. address on another interface |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
414 |
* \returns true for Weak Es Model activated |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
415 |
*/ |
5760
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
4701
diff
changeset
|
416 |
virtual bool GetWeakEsModel (void) const = 0; |
1452
973c456d3684
socket update broke multicast
Craig Dowell <craigdo@ee.washington.edu>
parents:
1449
diff
changeset
|
417 |
}; |
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
|
418 |
|
522
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
419 |
} // namespace ns3 |
d5039448597a
remove Node::GetIpv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
420 |
|
752
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
751
diff
changeset
|
421 |
#endif /* IPV4_H */ |