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
arp-l3-protocol.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef ARP_L3_PROTOCOL_H
21
#define ARP_L3_PROTOCOL_H
22
23
#include <list>
24
#include "ns3/ipv4-address.h"
25
#include "ns3/net-device.h"
26
#include "ns3/address.h"
27
#include "ns3/ptr.h"
28
#include "ns3/traced-callback.h"
29
#include "ns3/random-variable-stream.h"
30
31
namespace
ns3 {
32
33
class
ArpCache;
34
class
NetDevice;
35
class
Node;
36
class
Packet;
37
class
Ipv4Interface;
38
49
class
ArpL3Protocol
:
public
Object
50
{
51
public
:
52
static
TypeId
GetTypeId
(
void
);
53
static
const
uint16_t
PROT_NUMBER
;
54
55
ArpL3Protocol
();
56
virtual
~ArpL3Protocol
();
57
58
void
SetNode
(
Ptr<Node>
node);
59
60
Ptr<ArpCache>
CreateCache
(
Ptr<NetDevice>
device,
Ptr<Ipv4Interface>
interface);
61
65
void
Receive
(
Ptr<NetDevice>
device,
Ptr<const Packet>
p, uint16_t protocol,
const
Address
&from,
const
Address
&to,
66
NetDevice::PacketType
packetType);
76
bool
Lookup
(
Ptr<Packet>
p,
Ipv4Address
destination,
77
Ptr<NetDevice>
device,
78
Ptr<ArpCache>
cache,
79
Address
*hardwareDestination);
80
89
int64_t
AssignStreams
(int64_t stream);
90
91
protected
:
92
virtual
void
DoDispose
(
void
);
93
/*
94
* This function will notify other components connected to the node that a new stack member is now connected
95
* This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
96
*/
97
virtual
void
NotifyNewAggregate
();
98
private
:
99
typedef
std::list<Ptr<ArpCache> >
CacheList
;
100
ArpL3Protocol
(
const
ArpL3Protocol
&o);
101
ArpL3Protocol
&
operator =
(
const
ArpL3Protocol
&o);
102
Ptr<ArpCache>
FindCache
(
Ptr<NetDevice>
device);
103
void
SendArpRequest
(
Ptr<const ArpCache>
cache,
Ipv4Address
to);
104
void
SendArpReply
(
Ptr<const ArpCache>
cache,
Ipv4Address
myIp,
Ipv4Address
toIp,
Address
toMac);
105
CacheList
m_cacheList
;
106
Ptr<Node>
m_node
;
107
TracedCallback<Ptr<const Packet>
>
m_dropTrace
;
108
Ptr<RandomVariableStream>
m_requestJitter
;
109
110
};
111
112
}
// namespace ns3
113
114
115
#endif
/* ARP_L3_PROTOCOL_H */
src
internet
model
arp-l3-protocol.h
Generated on Fri Aug 30 2013 01:42:50 for ns-3 by
1.8.1.2