blob: 5dab9ae0d3ac8722f9f2c9be0ca1391aa797943e [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
21#include "ccnx-pit-entry.h"
22#include "ccnx-name-components.h"
23#include "ccnx-fib.h"
24
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -070025#include "ns3/simulator.h"
26
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070027namespace ns3
28{
29
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080030CcnxPitEntry::CcnxPitEntry (Ptr<CcnxNameComponents> prefix,
31 const Time &expireTime,
32 const CcnxFibEntry &fibEntry)
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070033 : m_prefix (prefix)
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070034 , m_fibEntry (fibEntry)
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080035 , m_expireTime (expireTime)
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070036 , m_timerExpired (false)
37 , m_counterExpirations (0)
38{
39}
40
41const CcnxNameComponents &
42CcnxPitEntry::GetPrefix () const
43{
44 return *m_prefix;
45}
46
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080047// void
48// CcnxPitEntry::AddIncoming (Ptr<CcnxFace> face)
49// {
50// m_incoming.insert (CcnxPitEntryIncomingFace (face, )
51// }
52
53
54// CcnxPitEntry::UpdateFibStatus::UpdateFibStatus (Ptr<CcnxFace> face,
55// CcnxFibFaceMetric::Status status,
56// Ptr<CcnxFib> fib)
57// : m_face (face)
58// , m_status (status)
59// , m_fib (fib)
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070060// {
61// }
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070062
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070063// void
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080064// CcnxPitEntry::UpdateFibStatus::operator() (CcnxPitEntry &entry)
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070065// {
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080066// NS_ASSERT_MSG (false, "Broken");
67// m_fib->modify (m_fib->iterator_to (entry.m_fibEntry),
68// CcnxFibEntry::UpdateStatus (m_face, m_status));
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070069// }
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070070
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080071// void
72// CcnxPitEntry::EstimateRttAndRemoveFace::operator() (CcnxPitEntry &entry)
73// {
74// // similar to Karn's Algorithm, we don't use RTT measurements for retx packets
75// if (m_outFace->m_retxNum>0)
76// return;
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070077
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080078// m_fib->modify (m_fib->iterator_to (entry.m_fibEntry),
79// CcnxFibEntry::UpdateFaceRtt (m_outFace->m_face,
80// Simulator::Now() - m_outFace->m_sendTime));
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -070081
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080082// entry.m_outgoing.erase (m_outFace);
83// }
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070084
85}