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 */
ns3::ArpL3Protocol::Receive
void Receive(Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Receive a packet.
Definition:
arp-l3-protocol.cc:156
ns3::ArpL3Protocol::SendArpReply
void SendArpReply(Ptr< const ArpCache > cache, Ipv4Address myIp, Ipv4Address toIp, Address toMac)
Definition:
arp-l3-protocol.cc:348
ns3::Ptr< Node >
ns3::ArpL3Protocol::ArpL3Protocol
ArpL3Protocol()
Definition:
arp-l3-protocol.cc:65
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::ArpL3Protocol::CacheList
std::list< Ptr< ArpCache > > CacheList
Definition:
arp-l3-protocol.h:99
ns3::ArpL3Protocol::operator=
ArpL3Protocol & operator=(const ArpL3Protocol &o)
ns3::ArpL3Protocol::CreateCache
Ptr< ArpCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv4Interface > interface)
Definition:
arp-l3-protocol.cc:126
ns3::ArpL3Protocol::~ArpL3Protocol
virtual ~ArpL3Protocol()
Definition:
arp-l3-protocol.cc:70
ns3::ArpL3Protocol::m_dropTrace
TracedCallback< Ptr< const Packet > > m_dropTrace
Definition:
arp-l3-protocol.h:107
ns3::ArpL3Protocol::SendArpRequest
void SendArpRequest(Ptr< const ArpCache >cache, Ipv4Address to)
Definition:
arp-l3-protocol.cc:327
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::ArpL3Protocol::NotifyNewAggregate
virtual void NotifyNewAggregate()
Definition:
arp-l3-protocol.cc:95
ns3::ArpL3Protocol::DoDispose
virtual void DoDispose(void)
Definition:
arp-l3-protocol.cc:112
ns3::ArpL3Protocol::PROT_NUMBER
static const uint16_t PROT_NUMBER
Definition:
arp-l3-protocol.h:53
ns3::ArpL3Protocol::m_node
Ptr< Node > m_node
Definition:
arp-l3-protocol.h:106
ns3::ArpL3Protocol::AssignStreams
int64_t AssignStreams(int64_t stream)
Definition:
arp-l3-protocol.cc:76
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::ArpL3Protocol::Lookup
bool Lookup(Ptr< Packet > p, Ipv4Address destination, Ptr< NetDevice > device, Ptr< ArpCache > cache, Address *hardwareDestination)
Perform an ARP lookup.
Definition:
arp-l3-protocol.cc:258
ns3::ArpL3Protocol::SetNode
void SetNode(Ptr< Node > node)
Definition:
arp-l3-protocol.cc:84
ns3::ArpL3Protocol::m_requestJitter
Ptr< RandomVariableStream > m_requestJitter
Definition:
arp-l3-protocol.h:108
ns3::ArpL3Protocol
An implementation of the ARP protocol.
Definition:
arp-l3-protocol.h:49
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::NetDevice::PacketType
PacketType
Definition:
net-device.h:270
ns3::ArpL3Protocol::m_cacheList
CacheList m_cacheList
Definition:
arp-l3-protocol.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::ArpL3Protocol::FindCache
Ptr< ArpCache > FindCache(Ptr< NetDevice > device)
Definition:
arp-l3-protocol.cc:140
ns3::ArpL3Protocol::GetTypeId
static TypeId GetTypeId(void)
Definition:
arp-l3-protocol.cc:44
src
internet
model
arp-l3-protocol.h
Generated on Sat Nov 16 2013 12:55:27 for ns-3 by
1.8.5