A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
aodv-dpd.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
*
18
* Authors: Elena Buchatskaia <borovkovaes@iitp.ru>
19
* Pavel Boyko <boyko@iitp.ru>
20
*/
21
22
#include "
aodv-dpd.h
"
23
24
namespace
ns3
25
{
26
namespace
aodv
27
{
28
29
bool
30
DuplicatePacketDetection::IsDuplicate
(
Ptr<const Packet>
p,
const
Ipv4Header
& header)
31
{
32
return
m_idCache
.
IsDuplicate
(header.
GetSource
(), p->
GetUid
());
33
}
34
35
void
36
DuplicatePacketDetection::SetLifetime
(
Time
lifetime)
37
{
38
m_idCache
.
SetLifetime
(lifetime);
39
}
40
41
Time
42
DuplicatePacketDetection::GetLifetime
()
const
43
{
44
return
m_idCache
.
GetLifeTime
();
45
}
46
47
}
// namespace aodv
48
}
// namespace ns3
aodv-dpd.h
ns3::Ipv4Header
Packet header for IPv4.
Definition:
ipv4-header.h:34
ns3::Ipv4Header::GetSource
Ipv4Address GetSource() const
Definition:
ipv4-header.cc:302
ns3::Packet::GetUid
uint64_t GetUid() const
Returns the packet's Uid.
Definition:
packet.cc:412
ns3::Ptr< const Packet >
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::aodv::DuplicatePacketDetection::m_idCache
IdCache m_idCache
Impl.
Definition:
aodv-dpd.h:76
ns3::aodv::DuplicatePacketDetection::GetLifetime
Time GetLifetime() const
Get duplicate record lifetime.
Definition:
aodv-dpd.cc:42
ns3::aodv::DuplicatePacketDetection::IsDuplicate
bool IsDuplicate(Ptr< const Packet > p, const Ipv4Header &header)
Check if the packet is a duplicate.
Definition:
aodv-dpd.cc:30
ns3::aodv::DuplicatePacketDetection::SetLifetime
void SetLifetime(Time lifetime)
Set duplicate record lifetime.
Definition:
aodv-dpd.cc:36
ns3::aodv::IdCache::SetLifetime
void SetLifetime(Time lifetime)
Set lifetime for future added entries.
Definition:
aodv-id-cache.h:75
ns3::aodv::IdCache::GetLifeTime
Time GetLifeTime() const
Return lifetime for existing entries in cache.
Definition:
aodv-id-cache.h:84
ns3::aodv::IdCache::IsDuplicate
bool IsDuplicate(Ipv4Address addr, uint32_t id)
Check that entry (addr, id) exists in cache.
Definition:
aodv-id-cache.cc:36
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
aodv
model
aodv-dpd.cc
Generated on Sun Mar 3 2024 17:10:52 for ns-3 by
1.9.1