blob: ddd23f3c81eae66bd4a63d32e0dd0efa2480b70d [file] [log] [blame]
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -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
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
29namespace ns3 {
30namespace ndn {
31namespace fw {
32
33/**
34 * \ingroup ndn
35 * \brief Strategy implementing per-FIB entry limits
36 */
37class PerFibLimits :
38 public FwStats
39{
Alexander Afanasyev31cb4692012-08-17 13:08:20 -070040private:
41 typedef FwStats super;
42
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070043public:
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
55protected:
56 virtual bool
Alexander Afanasyev31cb4692012-08-17 13:08:20 -070057 WillSendOutInterest (Ptr<Face> outFace,
58 Ptr<const InterestHeader> header,
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070059 Ptr<pit::Entry> pitEntry);
60
61 virtual void
Alexander Afanasyev31cb4692012-08-17 13:08:20 -070062 WillSatisfyPendingInterest (Ptr<Face> inFace,
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070063 Ptr<pit::Entry> pitEntry);
64
65 // from Object
66 void
67 DoDispose ();
68
69private:
70 void
71 DecayLimits ();
72
73private:
74 EventId m_decayLimitsEvent;
75
Alexander Afanasyevccbd8342012-08-16 16:54:39 -070076 double m_threshold;
77 double m_graceAcceptProbability;
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070078};
79
80
81} // namespace fw
82} // namespace ndn
83} // namespace ns3
84
85#endif // NDNSIM_PER_FIB_LIMITS_H