A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
24namespace ns3
25{
26namespace aodv
27{
28
29bool
31{
32 return m_idCache.IsDuplicate(header.GetSource(), p->GetUid());
33}
34
35void
37{
38 m_idCache.SetLifetime(lifetime);
39}
40
41Time
43{
44 return m_idCache.GetLifeTime();
45}
46
47} // namespace aodv
48} // namespace ns3
Packet header for IPv4.
Definition: ipv4-header.h:34
Ipv4Address GetSource() const
Definition: ipv4-header.cc:302
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Time GetLifetime() const
Get duplicate record lifetime.
Definition: aodv-dpd.cc:42
bool IsDuplicate(Ptr< const Packet > p, const Ipv4Header &header)
Check if the packet is a duplicate.
Definition: aodv-dpd.cc:30
void SetLifetime(Time lifetime)
Set duplicate record lifetime.
Definition: aodv-dpd.cc:36
void SetLifetime(Time lifetime)
Set lifetime for future added entries.
Definition: aodv-id-cache.h:75
Time GetLifeTime() const
Return lifetime for existing entries in cache.
Definition: aodv-id-cache.h:84
bool IsDuplicate(Ipv4Address addr, uint32_t id)
Check that entry (addr, id) exists in cache.
Every class exported by the ns3 library is enclosed in the ns3 namespace.