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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
icmpv4-l4-protocol.h
1
#ifndef ICMPV4_L4_PROTOCOL_H
2
#define ICMPV4_L4_PROTOCOL_H
3
4
#include "ip-l4-protocol.h"
5
#include "icmpv4.h"
6
#include "ns3/ipv4-address.h"
7
8
namespace
ns3 {
9
10
class
Node;
11
class
Ipv4Interface;
12
class
Ipv4Route;
13
14
class
Icmpv4L4Protocol
:
public
IpL4Protocol
15
{
16
public
:
17
static
TypeId
GetTypeId (
void
);
18
static
const
uint8_t PROT_NUMBER;
19
20
Icmpv4L4Protocol
();
21
virtual
~
Icmpv4L4Protocol
();
22
23
void
SetNode (
Ptr<Node>
node);
24
25
static
uint16_t GetStaticProtocolNumber (
void
);
26
virtual
int
GetProtocolNumber
(
void
)
const
;
27
virtual
enum
IpL4Protocol::RxStatus
Receive
(
Ptr<Packet>
p,
28
Ipv4Header
const
&header,
29
Ptr<Ipv4Interface>
incomingInterface);
30
virtual
enum
IpL4Protocol::RxStatus
Receive
(
Ptr<Packet>
p,
31
Ipv6Header
const
&header,
32
Ptr<Ipv6Interface>
incomingInterface);
33
34
void
SendDestUnreachFragNeeded (
Ipv4Header
header,
Ptr<const Packet>
orgData, uint16_t nextHopMtu);
35
void
SendTimeExceededTtl (
Ipv4Header
header,
Ptr<const Packet>
orgData);
36
void
SendDestUnreachPort (
Ipv4Header
header,
Ptr<const Packet>
orgData);
37
38
// From IpL4Protocol
39
virtual
void
SetDownTarget
(
IpL4Protocol::DownTargetCallback
cb);
40
virtual
void
SetDownTarget6 (
IpL4Protocol::DownTargetCallback6
cb);
41
// From IpL4Protocol
42
virtual
IpL4Protocol::DownTargetCallback
GetDownTarget
(
void
)
const
;
43
virtual
IpL4Protocol::DownTargetCallback6
GetDownTarget6 (
void
)
const
;
44
protected
:
45
/*
46
* This function will notify other components connected to the node that a new stack member is now connected
47
* This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
48
*/
49
virtual
void
NotifyNewAggregate
();
50
private
:
51
void
HandleEcho (
Ptr<Packet>
p,
52
Icmpv4Header
header,
53
Ipv4Address
source,
54
Ipv4Address
destination);
55
void
HandleDestUnreach (
Ptr<Packet>
p,
56
Icmpv4Header
header,
57
Ipv4Address
source,
58
Ipv4Address
destination);
59
void
HandleTimeExceeded (
Ptr<Packet>
p,
60
Icmpv4Header
icmp,
61
Ipv4Address
source,
62
Ipv4Address
destination);
63
void
SendDestUnreach (
Ipv4Header
header,
Ptr<const Packet>
orgData,
64
uint8_t code, uint16_t nextHopMtu);
65
void
SendMessage (
Ptr<Packet>
packet,
Ipv4Address
dest, uint8_t type, uint8_t code);
66
void
SendMessage (
Ptr<Packet>
packet,
Ipv4Address
source,
Ipv4Address
dest, uint8_t type, uint8_t code,
Ptr<Ipv4Route>
route);
67
void
Forward (
Ipv4Address
source,
Icmpv4Header
icmp,
68
uint32_t info,
Ipv4Header
ipHeader,
69
const
uint8_t payload[8]);
70
71
virtual
void
DoDispose
(
void
);
72
73
Ptr<Node>
m_node;
74
IpL4Protocol::DownTargetCallback
m_downTarget;
75
};
76
77
}
// namespace ns3
78
79
#endif
/* ICMPV4_L4_PROTOCOL_H */
ns3::Ipv6Header
Packet header for IPv6.
Definition:
ipv6-header.h:33
ns3::Ptr< Node >
ns3::Callback< void, Ptr< Packet >, Ipv4Address, Ipv4Address, uint8_t, Ptr< Ipv4Route > >
ns3::Icmpv4Header
Definition:
icmpv4.h:33
ns3::Ipv4Header
Packet header for IPv4.
Definition:
ipv4-header.h:31
ns3::Icmpv4L4Protocol::GetDownTarget
virtual IpL4Protocol::DownTargetCallback GetDownTarget(void) const
Definition:
icmpv4-l4-protocol.cc:288
ns3::Icmpv4L4Protocol::GetProtocolNumber
virtual int GetProtocolNumber(void) const
Definition:
icmpv4-l4-protocol.cc:85
ns3::IpL4Protocol
L4 Protocol abstract base class.
Definition:
ip-l4-protocol.h:47
ns3::Icmpv4L4Protocol::NotifyNewAggregate
virtual void NotifyNewAggregate()
Definition:
icmpv4-l4-protocol.cc:55
ns3::Icmpv4L4Protocol::Receive
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > incomingInterface)
Definition:
icmpv4-l4-protocol.cc:233
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::Icmpv4L4Protocol::DoDispose
virtual void DoDispose(void)
Definition:
icmpv4-l4-protocol.cc:266
ns3::Icmpv4L4Protocol
Definition:
icmpv4-l4-protocol.h:14
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::Icmpv4L4Protocol::SetDownTarget
virtual void SetDownTarget(IpL4Protocol::DownTargetCallback cb)
Definition:
icmpv4-l4-protocol.cc:275
src
internet
model
icmpv4-l4-protocol.h
Generated on Sun Mar 16 2014 11:25:04 for ns-3 by
1.8.6