blob: 1f1bcde1a0ed2b89fd1a8295a30ccb1073b763e2 [file] [log] [blame]
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -07001/* -*- 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
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070021#include "ndn-pit.h"
Alexander Afanasyeve3d126f2012-07-16 17:07:31 -070022
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070023#include "ns3/ndn-interest-header.h"
24#include "ns3/ndn-content-object-header.h"
Alexander Afanasyeve3d126f2012-07-16 17:07:31 -070025
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070026#include "ns3/log.h"
Alexander Afanasyeva5bbe0e2011-11-22 17:28:39 -080027#include "ns3/string.h"
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -070028#include "ns3/uinteger.h"
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070029#include "ns3/simulator.h"
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070030
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -070031#include <boost/lambda/bind.hpp>
Alexander Afanasyeva5bbe0e2011-11-22 17:28:39 -080032#include <boost/lambda/lambda.hpp>
33
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070034NS_LOG_COMPONENT_DEFINE ("NdnPit");
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070035
36namespace ns3 {
37
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070038NS_OBJECT_ENSURE_REGISTERED (NdnPit);
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070039
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070040using namespace __ndn_private;
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070041
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080042TypeId
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070043NdnPit::GetTypeId ()
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070044{
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070045 static TypeId tid = TypeId ("ns3::private::NdnPit")
46 .SetGroupName ("Ndn")
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070047 .SetParent<Object> ()
Alexander Afanasyevf9f4eb02011-12-16 01:51:14 -080048
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080049 .AddAttribute ("PitEntryPruningTimout",
50 "Timeout for PIT entry to live after being satisfied. To make sure recently satisfied interest will not be satisfied again",
51 StringValue ("100ms"),
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070052 MakeTimeAccessor (&NdnPit::m_PitEntryPruningTimout),
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080053 MakeTimeChecker ())
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070054 ;
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070055
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070056 return tid;
57}
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070058
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070059NdnPit::NdnPit ()
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070060{
61}
62
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070063NdnPit::~NdnPit ()
Alexander Afanasyevd02a5d62011-11-21 11:01:51 -080064{
Alexander Afanasyevd02a5d62011-11-21 11:01:51 -080065}
66
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070067} // namespace ns3