NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
pit-face-record.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
pit-face-record.hpp
"
27
28
namespace
nfd {
29
namespace
pit {
30
31
FaceRecord::FaceRecord
(shared_ptr<Face> face)
32
: m_face(face)
33
, m_lastNonce(0)
34
, m_lastRenewed(time::steady_clock::TimePoint::min())
35
, m_expiry(time::steady_clock::TimePoint::min())
36
{
37
}
38
39
void
40
FaceRecord::update
(
const
Interest& interest)
41
{
42
m_lastNonce = interest.getNonce();
43
m_lastRenewed = time::steady_clock::now();
44
45
time::milliseconds lifetime = interest.getInterestLifetime();
46
if
(lifetime < time::milliseconds::zero()) {
47
lifetime = ndn::DEFAULT_INTEREST_LIFETIME;
48
}
49
m_expiry = m_lastRenewed + lifetime;
50
}
51
52
53
}
// namespace pit
54
}
// namespace nfd
pit-face-record.hpp
nfd::pit::FaceRecord::FaceRecord
FaceRecord(shared_ptr< Face > face)
Definition:
pit-face-record.cpp:31
nfd::pit::FaceRecord::update
void update(const Interest &interest)
updates lastNonce, lastRenewed, expiry fields
Definition:
pit-face-record.cpp:40
ndnSIM
NFD
daemon
table
pit-face-record.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7