author | Pedro Silva <pmms@inesctec.pt> |
Wed, 29 Oct 2014 10:12:53 -0700 | |
changeset 11040 | cd2eda848730 |
parent 10847 | e72b8f4c25bb |
child 11086 | 65914b1ed5b3 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7366
diff
changeset
|
1 |
// -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
// Copyright (c) 2006 Georgia Tech Research Corporation |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
// This program is free software; you can redistribute it and/or modify |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
// it under the terms of the GNU General Public License version 2 as |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
// published by the Free Software Foundation; |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
// This program is distributed in the hope that it will be useful, |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
// GNU General Public License for more details. |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
// You should have received a copy of the GNU General Public License |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
// along with this program; if not, write to the Free Software |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
// Author: George F. Riley<riley@ece.gatech.edu> |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
// |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
752
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
734
diff
changeset
|
21 |
#ifndef IPV4_L3_PROTOCOL_H |
a4febfb8416f
IIpv4 -> Ipv4
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
734
diff
changeset
|
22 |
#define IPV4_L3_PROTOCOL_H |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <list> |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
25 |
#include <map> |
5487
9485bee6b7eb
Ipv4L3Protocol::GetInterface optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5374
diff
changeset
|
26 |
#include <vector> |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
#include <stdint.h> |
524
082ffdd8fbd7
move code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
513
diff
changeset
|
28 |
#include "ns3/ipv4-address.h" |
555
4d3b2a77bc92
convert Node * to Ptr<Node>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
551
diff
changeset
|
29 |
#include "ns3/ptr.h" |
3448
0bd851bb1225
Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3266
diff
changeset
|
30 |
#include "ns3/net-device.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:
752
diff
changeset
|
31 |
#include "ns3/ipv4.h" |
2498
e01570293b98
convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
32 |
#include "ns3/traced-callback.h" |
3216
b36bb98d766e
bug 207: ipv4-header.h needed in src/node module.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
33 |
#include "ns3/ipv4-header.h" |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
34 |
#include "ns3/ipv4-routing-protocol.h" |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
35 |
#include "ns3/nstime.h" |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
36 |
#include "ns3/simulator.h" |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
|
10553
8c347165bb56
Move tests outside ns3 namespace
Vedran Miletić <rivanvx@gmail.com>
parents:
10496
diff
changeset
|
38 |
class Ipv4L3ProtocolTestCase; |
8c347165bb56
Move tests outside ns3 namespace
Vedran Miletić <rivanvx@gmail.com>
parents:
10496
diff
changeset
|
39 |
|
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
namespace ns3 { |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
|
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
class Packet; |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
class NetDevice; |
551
12ed30c77cab
revert Ipv4Interface * -> Ptr<Ipv4Interface>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
548
diff
changeset
|
44 |
class Ipv4Interface; |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
class Ipv4Address; |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
class Ipv4Header; |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
47 |
class Ipv4RoutingTableEntry; |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
class Ipv4Route; |
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
639
diff
changeset
|
49 |
class Node; |
3820 | 50 |
class Socket; |
51 |
class Ipv4RawSocketImpl; |
|
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7385
diff
changeset
|
52 |
class IpL4Protocol; |
3820 | 53 |
class Icmpv4L4Protocol; |
1229
e4cfe4094c10
build with the new TraceContextElement API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1195
diff
changeset
|
54 |
|
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
|
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
56 |
/** |
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
57 |
* \brief Implement the Ipv4 layer. |
3266
1ae7df5cf87b
Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3260
diff
changeset
|
58 |
* |
1ae7df5cf87b
Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3260
diff
changeset
|
59 |
* This is the actual implementation of IP. It contains APIs to send and |
1ae7df5cf87b
Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3260
diff
changeset
|
60 |
* receive packets at the IP layer, as well as APIs for IP routing. |
5373
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
61 |
* |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
62 |
* This class contains two distinct groups of trace sources. The |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
63 |
* trace sources 'Rx' and 'Tx' are called, respectively, immediately |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
64 |
* after receiving from the NetDevice and immediately before sending |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
65 |
* to a NetDevice for transmitting a packet. These are low level |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
66 |
* trace sources that include the Ipv4Header already serialized into |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
67 |
* the packet. In contrast, the Drop, SendOutgoing, UnicastForward, |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
68 |
* and LocalDeliver trace sources are slightly higher-level and pass |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
69 |
* around the Ipv4Header as an explicit parameter and not as part of |
97402b61fb82
Gustavo patch for bug 676
Craig Dowell <craigdo@ee.washington.edu>
parents:
5339
diff
changeset
|
70 |
* the packet. |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
71 |
* |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
72 |
* IP fragmentation and reassembly is handled at this level. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
73 |
* At the moment the fragmentation does not handle IP option headers, |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
74 |
* and in particular the ones that shall not be fragmented. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
75 |
* Moreover, the actual implementation does not mimic exactly the Linux |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
76 |
* kernel. Hence it is not possible, for instance, to test a fragmentation |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
77 |
* attack. |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
78 |
*/ |
4377 | 79 |
class Ipv4L3Protocol : public Ipv4 |
293
007bc9e735f3
remove Ipv4L3Protocol class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
242
diff
changeset
|
80 |
{ |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
81 |
public: |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
82 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
83 |
* \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
|
84 |
* \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
|
85 |
*/ |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
86 |
static TypeId GetTypeId (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
87 |
static const uint16_t PROT_NUMBER; //!< Protocol number (0x0800) |
293
007bc9e735f3
remove Ipv4L3Protocol class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
242
diff
changeset
|
88 |
|
2498
e01570293b98
convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
89 |
Ipv4L3Protocol(); |
734
039fb338b6e9
Ipv4 -> Ipv4L3Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
733
diff
changeset
|
90 |
virtual ~Ipv4L3Protocol (); |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
91 |
|
5225
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5204
diff
changeset
|
92 |
/** |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5204
diff
changeset
|
93 |
* \enum DropReason |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5204
diff
changeset
|
94 |
* \brief Reason why a packet has been dropped. |
9c612cb88d6b
Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5204
diff
changeset
|
95 |
*/ |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
96 |
enum DropReason |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
97 |
{ |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
98 |
DROP_TTL_EXPIRED = 1, /**< Packet TTL has expired */ |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
99 |
DROP_NO_ROUTE, /**< No route to host */ |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
100 |
DROP_BAD_CHECKSUM, /**< Bad checksum */ |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
101 |
DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
102 |
DROP_ROUTE_ERROR, /**< Route error */ |
10496
4218ca3fc829
Backed out of changeset 10495:e877c029ed3e
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10495
diff
changeset
|
103 |
DROP_FRAGMENT_TIMEOUT /**< Fragment timeout exceeded */ |
4218ca3fc829
Backed out of changeset 10495:e877c029ed3e
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10495
diff
changeset
|
104 |
}; |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
105 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
106 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
107 |
* \brief Set node associated with this stack. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
108 |
* \param node node to set |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
109 |
*/ |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2498
diff
changeset
|
110 |
void SetNode (Ptr<Node> node); |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2498
diff
changeset
|
111 |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
112 |
// functions defined in base class Ipv4 |
4481 | 113 |
|
114 |
void SetRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol); |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
115 |
Ptr<Ipv4RoutingProtocol> GetRoutingProtocol (void) const; |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
116 |
|
3820 | 117 |
Ptr<Socket> CreateRawSocket (void); |
118 |
void DeleteRawSocket (Ptr<Socket> socket); |
|
119 |
||
406
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
120 |
/** |
3588
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
121 |
* \param protocol a template for the protocol to add to this L4 Demux. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
122 |
* \returns the L4Protocol effectively added. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
123 |
* |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
124 |
* Invoke Copy on the input template to get a copy of the input |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
125 |
* protocol which can be used on the Node on which this L4 Demux |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
126 |
* is running. The new L4Protocol is registered internally as |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
127 |
* a working L4 Protocol and returned from this method. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
128 |
* The caller does not get ownership of the returned pointer. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
129 |
*/ |
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7385
diff
changeset
|
130 |
void Insert (Ptr<IpL4Protocol> protocol); |
3588
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
131 |
/** |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
132 |
* \param protocolNumber number of protocol to lookup |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
133 |
* in this L4 Demux |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
134 |
* \returns a matching L4 Protocol |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
135 |
* |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
136 |
* This method is typically called by lower layers |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
137 |
* to forward packets up the stack to the right protocol. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
138 |
*/ |
10566
9594a4df3bde
Bug 1826 - make ns3::Ipv6Interface independent from ns3::IPv6L3protocol
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
10553
diff
changeset
|
139 |
virtual Ptr<IpL4Protocol> GetProtocol (int protocolNumber) const; |
3588
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
140 |
/** |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
141 |
* \param protocol protocol to remove from this demux. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
142 |
* |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
143 |
* The input value to this method should be the value |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
144 |
* returned from the Ipv4L4Protocol::Insert method. |
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
145 |
*/ |
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7385
diff
changeset
|
146 |
void Remove (Ptr<IpL4Protocol> protocol); |
3588
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
147 |
|
ad0a36bfdb62
bug 282: remove Ipv4L4Demux
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3548
diff
changeset
|
148 |
/** |
406
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
149 |
* \param ttl default ttl to use |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
150 |
* |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
151 |
* When we need to send an ipv4 packet, we use this default |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
152 |
* ttl value. |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
153 |
*/ |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
154 |
void SetDefaultTtl (uint8_t ttl); |
406
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
155 |
|
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
156 |
/** |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
157 |
* Lower layer calls this method after calling L3Demux::Lookup |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
158 |
* The ARP subclass needs to know from which NetDevice this |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
159 |
* packet is coming to: |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
160 |
* - implement a per-NetDevice ARP cache |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
161 |
* - send back arp replies on the right device |
5227
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
162 |
* \param device network device |
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
163 |
* \param p the packet |
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
164 |
* \param protocol protocol value |
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
165 |
* \param from address of the correspondant |
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
166 |
* \param to address of the destination |
ecb08c1fc273
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5225
diff
changeset
|
167 |
* \param packetType type of the packet |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
168 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
169 |
void Receive ( Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol, const Address &from, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
170 |
const Address &to, NetDevice::PacketType packetType); |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
171 |
|
406
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
172 |
/** |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
173 |
* \param packet packet to send |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
174 |
* \param source source address of packet |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
175 |
* \param destination address of packet |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
176 |
* \param protocol number of packet |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
177 |
* \param route route entry |
406
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
178 |
* |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
179 |
* Higher-level layers call this method to send a packet |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
180 |
* down the stack to the MAC and PHY layers. |
c3f72daa6430
doxygen for Ipv4 class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
181 |
*/ |
1866
e7dbcc4df546
do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1524
diff
changeset
|
182 |
void Send (Ptr<Packet> packet, Ipv4Address source, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
183 |
Ipv4Address destination, uint8_t protocol, Ptr<Ipv4Route> route); |
6334
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
184 |
/** |
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
185 |
* \param packet packet to send |
6336
464e8093700d
update Bug 932 (Support IP_HDRINCL option for Ipv4RawSocket) again: regarding w/ Tom's comments.
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6334
diff
changeset
|
186 |
* \param ipHeader IP Header |
6334
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
187 |
* \param route route entry |
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
188 |
* |
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
189 |
* Higher-level layers call this method to send a packet with IPv4 Header |
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
190 |
* (Intend to be used with IpHeaderInclude attribute.) |
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6015
diff
changeset
|
191 |
*/ |
6723
fff5c512f345
bug 967: decouple Ipv4L4Protocols from Ipv4L3Protocol::Send() via a new callback
Tom Henderson <tomh@tomh.org>
parents:
6347
diff
changeset
|
192 |
void SendWithHeader (Ptr<Packet> packet, Ipv4Header ipHeader, Ptr<Ipv4Route> route); |
1428
a8f3d01d4a2c
untested multicast support
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
193 |
|
639
4e3a1dc4b1e4
cleanup old dox and reorg header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
194 |
uint32_t AddInterface (Ptr<NetDevice> device); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
195 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
196 |
* \brief Get an interface. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
197 |
* \param i interface index |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
198 |
* \return IPv4 interface pointer |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
199 |
*/ |
1341
f685d4bf320f
use the Object::GetTraceResolver tracing support rather than the old adhoc tracing code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1333
diff
changeset
|
200 |
Ptr<Ipv4Interface> GetInterface (uint32_t i) const; |
639
4e3a1dc4b1e4
cleanup old dox and reorg header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
201 |
uint32_t GetNInterfaces (void) const; |
4e3a1dc4b1e4
cleanup old dox and reorg header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
202 |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
203 |
int32_t GetInterfaceForAddress (Ipv4Address addr) const; |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
204 |
int32_t GetInterfaceForPrefix (Ipv4Address addr, Ipv4Mask mask) const; |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
205 |
int32_t GetInterfaceForDevice (Ptr<const NetDevice> device) const; |
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:
5739
diff
changeset
|
206 |
bool IsDestinationAddress (Ipv4Address address, uint32_t iif) const; |
639
4e3a1dc4b1e4
cleanup old dox and reorg header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
633
diff
changeset
|
207 |
|
4563 | 208 |
bool AddAddress (uint32_t i, Ipv4InterfaceAddress address); |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
209 |
Ipv4InterfaceAddress GetAddress (uint32_t interfaceIndex, uint32_t addressIndex) const; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
210 |
uint32_t GetNAddresses (uint32_t interface) const; |
4563 | 211 |
bool RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex); |
9915
d4c2228d3c30
Bug 760 - IP address removal can be painful
Alexander D'souza (moijes12@gmail.com)
parents:
9145
diff
changeset
|
212 |
bool RemoveAddress (uint32_t interface, Ipv4Address address); |
5850
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
213 |
Ipv4Address SelectSourceAddress (Ptr<const NetDevice> device, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
214 |
Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope); |
5850
1a6375ac5431
Fix bug 606: Arp depends on IP routing system
Tom Henderson <tomh@tomh.org>
parents:
5760
diff
changeset
|
215 |
|
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
4372
diff
changeset
|
216 |
|
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:
1524
diff
changeset
|
217 |
void SetMetric (uint32_t i, uint16_t metric); |
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:
1524
diff
changeset
|
218 |
uint16_t GetMetric (uint32_t i) const; |
444
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
219 |
uint16_t GetMtu (uint32_t i) const; |
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
220 |
bool IsUp (uint32_t i) const; |
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
221 |
void SetUp (uint32_t i); |
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
222 |
void SetDown (uint32_t i); |
4607
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4573
diff
changeset
|
223 |
bool IsForwarding (uint32_t i) const; |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4573
diff
changeset
|
224 |
void SetForwarding (uint32_t i, bool val); |
444
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
225 |
|
4377 | 226 |
Ptr<NetDevice> GetNetDevice (uint32_t i); |
227 |
||
10670
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
228 |
/** |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
229 |
* \brief Check if an IPv4 address is unicast according to the node. |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
230 |
* |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
231 |
* This function checks all the node's interfaces and the respective subnet masks. |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
232 |
* An address is considered unicast if it's not broadcast, subnet-broadcast or multicast. |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
233 |
* |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
234 |
* \param ad address |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
235 |
* |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
236 |
* \return true if the address is unicast |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
237 |
*/ |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
238 |
bool IsUnicast (Ipv4Address ad) const; |
d04c750525d7
Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10566
diff
changeset
|
239 |
|
513
b7c7ea629de9
make L3Demux an NsUnknown object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
504
diff
changeset
|
240 |
protected: |
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:
752
diff
changeset
|
241 |
|
513
b7c7ea629de9
make L3Demux an NsUnknown object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
504
diff
changeset
|
242 |
virtual void DoDispose (void); |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
243 |
/** |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
244 |
* This function will notify other components connected to the node that a new stack member is now connected |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
245 |
* This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together. |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
246 |
*/ |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
247 |
virtual void NotifyNewAggregate (); |
513
b7c7ea629de9
make L3Demux an NsUnknown object.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
504
diff
changeset
|
248 |
private: |
10553
8c347165bb56
Move tests outside ns3 namespace
Vedran Miletić <rivanvx@gmail.com>
parents:
10496
diff
changeset
|
249 |
friend class ::Ipv4L3ProtocolTestCase; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
250 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
251 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
252 |
* \brief Copy constructor. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
253 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
254 |
* Defined but not implemented to avoid misuse |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
255 |
*/ |
3820 | 256 |
Ipv4L3Protocol(const Ipv4L3Protocol &); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
257 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
258 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
259 |
* \brief Copy constructor. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
260 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
261 |
* Defined but not implemented to avoid misuse |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
262 |
* \returns the copied object |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
263 |
*/ |
3820 | 264 |
Ipv4L3Protocol &operator = (const Ipv4L3Protocol &); |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
265 |
|
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:
5739
diff
changeset
|
266 |
// class Ipv4 attributes |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
267 |
virtual void SetIpForward (bool forward); |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
268 |
virtual bool GetIpForward (void) const; |
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:
5739
diff
changeset
|
269 |
virtual void SetWeakEsModel (bool model); |
4f08a0837018
Add new method for determining whether Ipv4 dest address is mine; add attribute to control RFC1122 behavior
Tom Henderson <tomh@tomh.org>
parents:
5739
diff
changeset
|
270 |
virtual bool GetWeakEsModel (void) const; |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
271 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
272 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
273 |
* \brief Construct an IPv4 header. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
274 |
* \param source source IPv4 address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
275 |
* \param destination destination IPv4 address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
276 |
* \param protocol L4 protocol |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
277 |
* \param payloadSize payload size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
278 |
* \param ttl Time to Live |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
279 |
* \param tos Type of Service |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
280 |
* \param mayFragment true if the packet can be fragmented |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
281 |
* \return newly created IPv4 header |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
282 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
283 |
Ipv4Header BuildHeader ( |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
284 |
Ipv4Address source, |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
285 |
Ipv4Address destination, |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
286 |
uint8_t protocol, |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
287 |
uint16_t payloadSize, |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
288 |
uint8_t ttl, |
9145
5752b425cdf5
Bug 1361 - Set TOS from Application level (sockets)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
8924
diff
changeset
|
289 |
uint8_t tos, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
290 |
bool mayFragment); |
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:
752
diff
changeset
|
291 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
292 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
293 |
* \brief Send packet with route. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
294 |
* \param route route |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
295 |
* \param packet packet to send |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
296 |
* \param ipHeader IPv4 header to add to the packet |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
297 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
298 |
void |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
299 |
SendRealOut (Ptr<Ipv4Route> route, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
300 |
Ptr<Packet> packet, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
301 |
Ipv4Header const &ipHeader); |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
302 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
303 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
304 |
* \brief Forward a packet. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
305 |
* \param rtentry route |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
306 |
* \param p packet to forward |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
307 |
* \param header IPv4 header to add to the packet |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
308 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
309 |
void |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
310 |
IpForward (Ptr<Ipv4Route> rtentry, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
311 |
Ptr<const Packet> p, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
312 |
const Ipv4Header &header); |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
313 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
314 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
315 |
* \brief Forward a multicast packet. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
316 |
* \param mrtentry route |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
317 |
* \param p packet to forward |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
318 |
* \param header IPv6 header to add to the packet |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
319 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
320 |
void |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
321 |
IpMulticastForward (Ptr<Ipv4MulticastRoute> mrtentry, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
322 |
Ptr<const Packet> p, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
323 |
const Ipv4Header &header); |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
324 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
325 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
326 |
* \brief Deliver a packet. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
327 |
* \param p packet delivered |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
328 |
* \param ip IPv4 header |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
329 |
* \param iif input interface packet was received |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
330 |
*/ |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4377
diff
changeset
|
331 |
void LocalDeliver (Ptr<const Packet> p, Ipv4Header const&ip, uint32_t iif); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
332 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
333 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
334 |
* \brief Fallback when no route is found. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
335 |
* \param p packet |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
336 |
* \param ipHeader IPv4 header |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
337 |
* \param sockErrno error number |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
338 |
*/ |
4607
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4573
diff
changeset
|
339 |
void RouteInputError (Ptr<const Packet> p, const Ipv4Header & ipHeader, Socket::SocketErrno sockErrno); |
0e15594f67f3
bug 63: allow enabling or disabling ip forwarding on a per-interface basis
Tom Henderson <tomh@tomh.org>
parents:
4573
diff
changeset
|
340 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
341 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
342 |
* \brief Add an IPv4 interface to the stack. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
343 |
* \param interface interface to add |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
344 |
* \return index of newly added interface |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
345 |
*/ |
1341
f685d4bf320f
use the Object::GetTraceResolver tracing support rather than the old adhoc tracing code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1333
diff
changeset
|
346 |
uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
347 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
348 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
349 |
* \brief Setup loopback interface. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
350 |
*/ |
444
1647ca57f19d
remove ipv4 interface from public API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
415
diff
changeset
|
351 |
void SetupLoopback (void); |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
352 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
353 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
354 |
* \brief Get ICMPv4 protocol. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
355 |
* \return Icmpv4L4Protocol pointer |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
356 |
*/ |
3820 | 357 |
Ptr<Icmpv4L4Protocol> GetIcmp (void) const; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
358 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
359 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
360 |
* \brief Check if an IPv4 address is unicast. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
361 |
* \param ad address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
362 |
* \param interfaceMask the network mask |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
363 |
* \return true if the address is unicast |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
364 |
*/ |
3820 | 365 |
bool IsUnicast (Ipv4Address ad, Ipv4Mask interfaceMask) const; |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
366 |
|
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
367 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
368 |
* \brief Fragment a packet |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
369 |
* \param packet the packet |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
370 |
* \param outIfaceMtu the MTU of the interface |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
371 |
* \param listFragments the list of fragments |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
372 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
373 |
void DoFragmentation (Ptr<Packet> packet, uint32_t outIfaceMtu, std::list<Ptr<Packet> >& listFragments); |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
374 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
375 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
376 |
* \brief Process a packet fragment |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
377 |
* \param packet the packet |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
378 |
* \param ipHeader the IP header |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
379 |
* \param iif Input Interface |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
380 |
* \return true is the fragment completed the packet |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
381 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
382 |
bool ProcessFragment (Ptr<Packet>& packet, Ipv4Header & ipHeader, uint32_t iif); |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
383 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
384 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
385 |
* \brief Process the timeout for packet fragments |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
386 |
* \param key representing the packet fragments |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
387 |
* \param ipHeader the IP header of the original packet |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
388 |
* \param iif Input Interface |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
389 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
390 |
void HandleFragmentsTimeout ( std::pair<uint64_t, uint32_t> key, Ipv4Header & ipHeader, uint32_t iif); |
10847
e72b8f4c25bb
Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
Lynne Salameh <l.salameh@cs.ucl.ac.uk>
parents:
10707
diff
changeset
|
391 |
|
10440
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 Container of the IPv4 Interfaces. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
394 |
*/ |
5487
9485bee6b7eb
Ipv4L3Protocol::GetInterface optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5374
diff
changeset
|
395 |
typedef std::vector<Ptr<Ipv4Interface> > Ipv4InterfaceList; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
396 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
397 |
* \brief Container of the IPv4 Raw Sockets. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
398 |
*/ |
3820 | 399 |
typedef std::list<Ptr<Ipv4RawSocketImpl> > SocketList; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
400 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
401 |
* \brief Container of the IPv4 L4 instances. |
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 |
typedef std::list<Ptr<IpL4Protocol> > L4List_t; |
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
404 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
405 |
bool m_ipForward; //!< Forwarding packets (i.e. router mode) state. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
406 |
bool m_weakEsModel; //!< Weak ES model state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
407 |
L4List_t m_protocols; //!< List of transport protocol. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
408 |
Ipv4InterfaceList m_interfaces; //!< List of IPv4 interfaces. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
409 |
uint8_t m_defaultTos; //!< Default TOS |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
410 |
uint8_t m_defaultTtl; //!< Default TTL |
10847
e72b8f4c25bb
Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
Lynne Salameh <l.salameh@cs.ucl.ac.uk>
parents:
10707
diff
changeset
|
411 |
std::map<std::pair<uint64_t, uint8_t>, uint16_t> m_identification; //!< Identification (for each {src, dst, proto} tuple) |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
412 |
Ptr<Node> m_node; //!< Node attached to stack. |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
413 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
414 |
/// Trace of sent packets |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
415 |
TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_sendOutgoingTrace; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
416 |
/// Trace of unicast forwarded packets |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
417 |
TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_unicastForwardTrace; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
418 |
/// Trace of locally delivered packets |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
419 |
TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_localDeliverTrace; |
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
420 |
|
5374
825478d4cf10
Tom's update to Gustavo's patch for bug 676.
Craig Dowell <craigdo@ee.washington.edu>
parents:
5373
diff
changeset
|
421 |
// The following two traces pass a packet with an IP header |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
422 |
/// Trace of transmitted packets |
6015
e9e4575cb6f3
clean up internet stack helper tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
5850
diff
changeset
|
423 |
TracedCallback<Ptr<const Packet>, Ptr<Ipv4>, uint32_t> m_txTrace; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
424 |
/// Trace of received packets |
6015
e9e4575cb6f3
clean up internet stack helper tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
5850
diff
changeset
|
425 |
TracedCallback<Ptr<const Packet>, Ptr<Ipv4>, uint32_t> m_rxTrace; |
5204
cb3087d8f330
Ipv4L3Protocol::Drop trace source enhanced, and add new SendOutgoing, UnicastForward, and LocalDeliver trace sources, for the FlowMonitor.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4616
diff
changeset
|
426 |
// <ip-header, payload, reason, ifindex> (ifindex not valid if reason is DROP_NO_ROUTE) |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
427 |
/// Trace of dropped packets |
6015
e9e4575cb6f3
clean up internet stack helper tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
5850
diff
changeset
|
428 |
TracedCallback<const Ipv4Header &, Ptr<const Packet>, DropReason, Ptr<Ipv4>, uint32_t> m_dropTrace; |
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:
752
diff
changeset
|
429 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
430 |
Ptr<Ipv4RoutingProtocol> m_routingProtocol; //!< Routing protocol associated with the stack |
3820 | 431 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
432 |
SocketList m_sockets; //!< List of IPv4 raw sockets. |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
433 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
434 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
435 |
* \class Fragments |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
436 |
* \brief A Set of Fragment belonging to the same packet (src, dst, identification and proto) |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
437 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
438 |
class Fragments : public SimpleRefCount<Fragments> |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
439 |
{ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
440 |
public: |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
441 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
442 |
* \brief Constructor. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
443 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
444 |
Fragments (); |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
445 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
446 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
447 |
* \brief Destructor. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
448 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
449 |
~Fragments (); |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
450 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
451 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
452 |
* \brief Add a fragment. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
453 |
* \param fragment the fragment |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
454 |
* \param fragmentOffset the offset of the fragment |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
455 |
* \param moreFragment the bit "More Fragment" |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
456 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
457 |
void AddFragment (Ptr<Packet> fragment, uint16_t fragmentOffset, bool moreFragment); |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
458 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
459 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
460 |
* \brief If all fragments have been added. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
461 |
* \returns true if the packet is entire |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
462 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
463 |
bool IsEntire () const; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
464 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
465 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
466 |
* \brief Get the entire packet. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
467 |
* \return the entire packet |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
468 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
469 |
Ptr<Packet> GetPacket () const; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
470 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
471 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
472 |
* \brief Get the complete part of the packet. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
473 |
* \return the part we have comeplete |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
474 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
475 |
Ptr<Packet> GetPartialPacket () const; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
476 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
477 |
private: |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
478 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
479 |
* \brief True if other fragments will be sent. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
480 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
481 |
bool m_moreFragment; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
482 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
483 |
/** |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
484 |
* \brief The current fragments. |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
485 |
*/ |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
486 |
std::list<std::pair<Ptr<Packet>, uint16_t> > m_fragments; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
487 |
|
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
488 |
}; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
489 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
490 |
/// Container of fragments, stored as pairs(src+dst addr, src+dst port) / fragment |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
491 |
typedef std::map< std::pair<uint64_t, uint32_t>, Ptr<Fragments> > MapFragments_t; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
492 |
/// Container of fragment timeout event, stored as pairs(src+dst addr, src+dst port) / EventId |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
493 |
typedef std::map< std::pair<uint64_t, uint32_t>, EventId > MapFragmentsTimers_t; |
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
494 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
495 |
MapFragments_t m_fragments; //!< Fragmented packets. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
496 |
Time m_fragmentExpirationTimeout; //!< Expiration timeout |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9915
diff
changeset
|
497 |
MapFragmentsTimers_t m_fragmentsTimers; //!< Expiration events. |
7366
838079534ff9
Support to IPv4 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
498 |
|
236
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
499 |
}; |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
500 |
|
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
501 |
} // Namespace ns3 |
5673656dc2e7
a basic untested ipv4 implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
502 |
|
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:
752
diff
changeset
|
503 |
#endif /* IPV4_L3_PROTOCOL_H */ |