Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -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 | |
| 22 | #ifndef NDNSIM_PER_FIB_LIMITS_H |
| 23 | #define NDNSIM_PER_FIB_LIMITS_H |
| 24 | |
| 25 | #include "ns3/event-id.h" |
| 26 | |
| 27 | #include "fw-stats.h" |
| 28 | |
| 29 | namespace ns3 { |
| 30 | namespace ndn { |
| 31 | namespace fw { |
| 32 | |
| 33 | /** |
| 34 | * \ingroup ndn |
| 35 | * \brief Strategy implementing per-FIB entry limits |
| 36 | */ |
| 37 | class PerFibLimits : |
| 38 | public FwStats |
| 39 | { |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 40 | private: |
| 41 | typedef FwStats super; |
| 42 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 43 | public: |
| 44 | static TypeId |
| 45 | GetTypeId (); |
| 46 | |
| 47 | /** |
| 48 | * @brief Default constructor |
| 49 | */ |
| 50 | PerFibLimits (); |
| 51 | |
| 52 | virtual void |
| 53 | WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry); |
| 54 | |
| 55 | protected: |
| 56 | virtual bool |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 57 | WillSendOutInterest (Ptr<Face> outFace, |
| 58 | Ptr<const InterestHeader> header, |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 59 | Ptr<pit::Entry> pitEntry); |
| 60 | |
| 61 | virtual void |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 62 | WillSatisfyPendingInterest (Ptr<Face> inFace, |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 63 | Ptr<pit::Entry> pitEntry); |
| 64 | |
| 65 | // from Object |
| 66 | void |
| 67 | DoDispose (); |
| 68 | |
| 69 | private: |
| 70 | void |
| 71 | DecayLimits (); |
| 72 | |
| 73 | private: |
| 74 | EventId m_decayLimitsEvent; |
| 75 | |
Alexander Afanasyev | ccbd834 | 2012-08-16 16:54:39 -0700 | [diff] [blame] | 76 | double m_threshold; |
| 77 | double m_graceAcceptProbability; |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | |
| 81 | } // namespace fw |
| 82 | } // namespace ndn |
| 83 | } // namespace ns3 |
| 84 | |
| 85 | #endif // NDNSIM_PER_FIB_LIMITS_H |