Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 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 "ccnx-pit-entry.h" |
| 22 | #include "ccnx-name-components.h" |
| 23 | #include "ccnx-fib.h" |
| 24 | |
Alexander Afanasyev | 78cf0c9 | 2011-09-01 19:57:14 -0700 | [diff] [blame] | 25 | #include "ns3/simulator.h" |
| 26 | |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 27 | namespace ns3 |
| 28 | { |
| 29 | |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 30 | CcnxPitEntry::CcnxPitEntry (Ptr<CcnxNameComponents> prefix, |
| 31 | const Time &expireTime, |
| 32 | const CcnxFibEntry &fibEntry) |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 33 | : m_prefix (prefix) |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 34 | , m_fibEntry (fibEntry) |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 35 | , m_expireTime (expireTime) |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 36 | , m_timerExpired (false) |
| 37 | , m_counterExpirations (0) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | const CcnxNameComponents & |
| 42 | CcnxPitEntry::GetPrefix () const |
| 43 | { |
| 44 | return *m_prefix; |
| 45 | } |
| 46 | |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 47 | // 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 Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 60 | // { |
| 61 | // } |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 62 | |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 63 | // void |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 64 | // CcnxPitEntry::UpdateFibStatus::operator() (CcnxPitEntry &entry) |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 65 | // { |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 66 | // NS_ASSERT_MSG (false, "Broken"); |
| 67 | // m_fib->modify (m_fib->iterator_to (entry.m_fibEntry), |
| 68 | // CcnxFibEntry::UpdateStatus (m_face, m_status)); |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 69 | // } |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 70 | |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 71 | // 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 Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 77 | |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 78 | // 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 Afanasyev | 78cf0c9 | 2011-09-01 19:57:14 -0700 | [diff] [blame] | 81 | |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame^] | 82 | // entry.m_outgoing.erase (m_outFace); |
| 83 | // } |
Alexander Afanasyev | a98cdd2 | 2011-08-29 17:32:37 -0700 | [diff] [blame] | 84 | |
| 85 | } |