blob: 00e58c702c4fbb88fd402af289e859b782b0d08a [file] [log] [blame]
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "ccnx-pit.h"
#include "ns3/ccnx-interest-header.h"
#include "ns3/ccnx-content-object-header.h"
#include "ns3/log.h"
#include "ns3/string.h"
#include "ns3/uinteger.h"
#include "ns3/simulator.h"
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>
NS_LOG_COMPONENT_DEFINE ("CcnxPit");
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (CcnxPit);
using namespace __ccnx_private;
TypeId
CcnxPit::GetTypeId ()
{
static TypeId tid = TypeId ("ns3::private::CcnxPit")
.SetGroupName ("Ccnx")
.SetParent<Object> ()
// .AddAttribute ("CleanupTimeout",
// "Timeout defining how frequent RIT should be cleaned up",
// StringValue ("1s"),
// MakeTimeAccessor (&CcnxPit::GetCleanupTimeout, &CcnxPit::SetCleanupTimeout),
// MakeTimeChecker ())
.AddAttribute ("PitEntryPruningTimout",
"Timeout for PIT entry to live after being satisfied. To make sure recently satisfied interest will not be satisfied again",
StringValue ("100ms"),
MakeTimeAccessor (&CcnxPit::m_PitEntryPruningTimout),
MakeTimeChecker ())
;
return tid;
}
CcnxPit::CcnxPit ()
{
}
CcnxPit::~CcnxPit ()
{
}
// void CcnxPit::CleanExpired ()
// {
// DoCleanExpired ();
// // schedule next event
// m_cleanupEvent = Simulator::Schedule (m_cleanupTimeout,
// &CcnxPit::CleanExpired, this);
// }
// void
// CcnxPit::SetCleanupTimeout (const Time &timeout)
// {
// m_cleanupTimeout = timeout;
// if (m_cleanupEvent.IsRunning ())
// m_cleanupEvent.Cancel (); // cancel any scheduled cleanup events
// // schedule even with new timeout
// m_cleanupEvent = Simulator::Schedule (m_cleanupTimeout,
// &CcnxPit::CleanExpired, this);
// }
// Time
// CcnxPit::GetCleanupTimeout () const
// {
// return m_cleanupTimeout;
// }
} // namespace ns3