NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ndn-pit.cc
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19  */
20 
21 #include "ndn-pit.h"
22 
23 #include "ns3/ndn-interest.h"
24 #include "ns3/ndn-data.h"
25 
26 #include "ns3/log.h"
27 #include "ns3/nstime.h"
28 #include "ns3/uinteger.h"
29 #include "ns3/simulator.h"
30 #include "ns3/packet.h"
31 
32 #include <boost/lambda/bind.hpp>
33 #include <boost/lambda/lambda.hpp>
34 
35 NS_LOG_COMPONENT_DEFINE ("ndn.Pit");
36 
37 namespace ns3 {
38 namespace ndn {
39 
40 NS_OBJECT_ENSURE_REGISTERED (Pit);
41 
42 TypeId
44 {
45  static TypeId tid = TypeId ("ns3::ndn::Pit")
46  .SetGroupName ("Ndn")
47  .SetParent<Object> ()
48 
49  .AddAttribute ("PitEntryPruningTimout",
50  "Timeout for PIT entry to live after being satisfied. To make sure recently satisfied interest will not be satisfied again",
51  TimeValue (), // by default, PIT entries are removed instantly
52  MakeTimeAccessor (&Pit::m_PitEntryPruningTimout),
53  MakeTimeChecker ())
54 
55  .AddAttribute ("MaxPitEntryLifetime",
56  "Maximum amount of time for which a router is willing to maintain a PIT entry. "
57  "Actual PIT lifetime should be minimum of MaxPitEntryLifetime and InterestLifetime specified in the Interest packet",
58  TimeValue (), // by default, PIT entries are kept for the time, specified by the InterestLifetime
60  MakeTimeChecker ())
61  ;
62 
63  return tid;
64 }
65 
67 {
68 }
69 
71 {
72 }
73 
74 } // namespace ndn
75 } // namespace ns3
const Time & GetMaxPitEntryLifetime() const
Get maximum PIT entry lifetime.
Definition: ndn-pit.h:211
Pit()
PIT constructor.
Definition: ndn-pit.cc:66
static TypeId GetTypeId()
Interface ID.
Definition: ndn-pit.cc:43
void SetMaxPitEntryLifetime(const Time &maxLifetime)
Set maximum PIT entry lifetime.
Definition: ndn-pit.h:217
virtual ~Pit()
Destructor.
Definition: ndn-pit.cc:70