A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
icmpv6-l4-protocol.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007-2009 Strasbourg University
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19
* David Gross <gdavid.devel@gmail.com>
20
* Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
21
*/
22
23
#ifndef ICMPV6_L4_PROTOCOL_H
24
#define ICMPV6_L4_PROTOCOL_H
25
26
#include <list>
27
28
#include "ns3/ipv6-address.h"
29
#include "ns3/random-variable-stream.h"
30
31
#include "
icmpv6-header.h
"
32
#include "
ip-l4-protocol.h
"
33
34
namespace
ns3 {
35
36
class
NetDevice;
37
class
Node;
38
class
Packet;
39
class
TraceContext;
40
class
NdiscCache;
41
46
class
Icmpv6L4Protocol
:
public
IpL4Protocol
47
{
48
public
:
52
static
TypeId
GetTypeId
();
53
57
static
const
uint8_t
PROT_NUMBER
;
58
62
static
const
uint8_t
MAX_INITIAL_RTR_ADVERT_INTERVAL
;
63
67
static
const
uint8_t
MAX_INITIAL_RTR_ADVERTISEMENTS
;
68
72
static
const
uint8_t
MAX_FINAL_RTR_ADVERTISEMENTS
;
73
77
static
const
uint8_t
MIN_DELAY_BETWEEN_RAS
;
78
82
static
const
uint32_t
MAX_RA_DELAY_TIME
;
83
87
static
const
uint8_t
MAX_RTR_SOLICITATION_DELAY
;
88
92
static
const
uint8_t
RTR_SOLICITATION_INTERVAL
;
93
97
static
const
uint8_t
MAX_RTR_SOLICITATIONS
;
98
102
static
const
uint8_t
MAX_MULTICAST_SOLICIT
;
103
107
static
const
uint8_t
MAX_UNICAST_SOLICIT
;
108
112
static
const
uint8_t
MAX_ANYCAST_DELAY_TIME
;
113
117
static
const
uint8_t
MAX_NEIGHBOR_ADVERTISEMENT
;
118
122
static
const
uint32_t
REACHABLE_TIME
;
123
127
static
const
uint32_t
RETRANS_TIMER
;
128
132
static
const
uint8_t
DELAY_FIRST_PROBE_TIME
;
133
137
static
const
double
MIN_RANDOM_FACTOR
;
138
142
static
const
double
MAX_RANDOM_FACTOR
;
143
148
static
uint16_t
GetStaticProtocolNumber
();
149
153
Icmpv6L4Protocol
();
154
158
virtual
~Icmpv6L4Protocol
();
159
164
void
SetNode
(
Ptr<Node>
node);
165
171
void
NotifyNewAggregate
();
172
177
virtual
int
GetProtocolNumber
()
const
;
178
183
virtual
int
GetVersion
()
const
;
184
192
void
SendMessage
(
Ptr<Packet>
packet,
Ipv6Address
src,
Ipv6Address
dst, uint8_t ttl);
193
201
void
DelayedSendMessage
(
Ptr<Packet>
packet,
Ipv6Address
src,
Ipv6Address
dst, uint8_t ttl);
202
211
void
SendMessage
(
Ptr<Packet>
packet,
Ipv6Address
dst,
Icmpv6Header
& icmpv6Hdr, uint8_t ttl);
212
222
void
DoDAD
(
Ipv6Address
target,
Ptr<Ipv6Interface>
interface);
223
231
void
SendNA
(
Ipv6Address
src,
Ipv6Address
dst,
Address
* hardwareAddress, uint8_t flags);
232
241
void
SendEchoReply
(
Ipv6Address
src,
Ipv6Address
dst, uint16_t
id
, uint16_t seq,
Ptr<Packet>
data
);
242
250
void
SendNS
(
Ipv6Address
src,
Ipv6Address
dst,
Ipv6Address
target,
Address
hardwareAddress);
251
258
void
SendErrorDestinationUnreachable
(
Ptr<Packet>
malformedPacket,
Ipv6Address
dst, uint8_t code);
259
266
void
SendErrorTooBig
(
Ptr<Packet>
malformedPacket,
Ipv6Address
dst, uint32_t mtu);
267
274
void
SendErrorTimeExceeded
(
Ptr<Packet>
malformedPacket,
Ipv6Address
dst, uint8_t code);
275
283
void
SendErrorParameterError
(
Ptr<Packet>
malformedPacket,
Ipv6Address
dst, uint8_t code, uint32_t ptr);
284
294
void
SendRedirection
(
Ptr<Packet>
redirectedPacket,
Ipv6Address
src,
Ipv6Address
dst,
Ipv6Address
redirTarget,
Ipv6Address
redirDestination,
Address
redirHardwareTarget);
295
304
Ptr<Packet>
ForgeNS
(
Ipv6Address
src,
Ipv6Address
dst,
Ipv6Address
target,
Address
hardwareAddress);
305
314
Ptr<Packet>
ForgeNA
(
Ipv6Address
src,
Ipv6Address
dst,
Address
* hardwareAddress, uint8_t flags);
315
323
Ptr<Packet>
ForgeRS
(
Ipv6Address
src,
Ipv6Address
dst,
Address
hardwareAddress);
324
334
Ptr<Packet>
ForgeEchoRequest
(
Ipv6Address
src,
Ipv6Address
dst, uint16_t
id
, uint16_t seq,
Ptr<Packet>
data
);
335
342
virtual
enum
IpL4Protocol::RxStatus
Receive
(
Ptr<Packet>
p,
343
Ipv4Header
const
&header,
344
Ptr<Ipv4Interface>
interface);
345
353
virtual
enum
IpL4Protocol::RxStatus
Receive
(
Ptr<Packet>
p,
354
Ipv6Header
const
&header,
355
Ptr<Ipv6Interface>
interface);
356
363
static
void
FunctionDadTimeout
(
Ptr<Icmpv6L4Protocol>
icmpv6,
Ipv6Interface
* interface,
Ipv6Address
addr);
364
373
bool
Lookup
(
Ipv6Address
dst,
Ptr<NetDevice>
device,
Ptr<NdiscCache>
cache,
Address
* hardwareDestination);
374
386
bool
Lookup
(
Ptr<Packet>
p,
Ipv6Address
dst,
Ptr<NetDevice>
device,
Ptr<NdiscCache>
cache,
Address
* hardwareDestination);
387
394
void
SendRS
(
Ipv6Address
src,
Ipv6Address
dst,
Address
hardwareAddress);
395
402
Ptr<NdiscCache>
CreateCache
(
Ptr<NetDevice>
device,
Ptr<Ipv6Interface>
interface);
403
408
bool
IsAlwaysDad
()
const
;
409
418
int64_t
AssignStreams
(int64_t stream);
419
420
protected
:
424
virtual
void
DoDispose
();
425
426
private
:
427
typedef
std::list<Ptr<NdiscCache> >
CacheList
;
428
432
Ptr<Node>
m_node
;
433
437
CacheList
m_cacheList
;
438
442
bool
m_alwaysDad
;
443
447
Ptr<RandomVariableStream>
m_solicitationJitter
;
448
457
void
Forward
(
Ipv6Address
source,
Icmpv6Header
icmp,
458
uint32_t info,
Ipv6Header
ipHeader,
459
const
uint8_t payload[8]);
460
468
void
HandleNS
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
469
477
void
HandleRS
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
478
486
void
HandleRA
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
487
495
void
HandleEchoRequest
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
496
504
void
HandleNA
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
505
513
void
HandleRedirection
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
514
522
void
HandleDestinationUnreachable
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
523
531
void
HandleTimeExceeded
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
532
540
void
HandlePacketTooBig
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
541
549
void
HandleParameterError
(
Ptr<Packet>
p,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
550
558
void
ReceiveLLA
(
Icmpv6OptionLinkLayerAddress
lla,
Ipv6Address
const
&src,
Ipv6Address
const
&dst,
Ptr<Ipv6Interface>
interface);
559
564
Ptr<NdiscCache>
FindCache
(
Ptr<NetDevice>
device);
565
566
// From IpL4Protocol
567
virtual
void
SetDownTarget
(
IpL4Protocol::DownTargetCallback
cb);
568
virtual
void
SetDownTarget6
(
IpL4Protocol::DownTargetCallback6
cb);
569
// From IpL4Protocol
570
virtual
IpL4Protocol::DownTargetCallback
GetDownTarget
(
void
)
const
;
571
virtual
IpL4Protocol::DownTargetCallback6
GetDownTarget6
(
void
)
const
;
572
573
IpL4Protocol::DownTargetCallback6
m_downTarget
;
574
575
};
576
577
}
/* namespace ns3 */
578
579
#endif
/* ICMPV6_L4_PROTOCOL_H */
580
src
internet
model
icmpv6-l4-protocol.h
Generated on Fri Aug 30 2013 01:42:51 for ns-3 by
1.8.1.2