blob: 2ee5141883522c0c6e7d62badd06ab554d2853a7 [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{
40public:
41 static TypeId
42 GetTypeId ();
43
44 /**
45 * @brief Default constructor
46 */
47 PerFibLimits ();
48
49 virtual void
50 WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry);
51
52protected:
53 virtual bool
54 WillSendOutInterest (const Ptr<Face> &outgoingFace,
55 Ptr<InterestHeader> header,
56 Ptr<pit::Entry> pitEntry);
57
58 virtual void
59 WillSatisfyPendingInterest (const Ptr<Face> &incomingFace,
60 Ptr<pit::Entry> pitEntry);
61
62 // from Object
63 void
64 DoDispose ();
65
66private:
67 void
68 DecayLimits ();
69
70private:
71 EventId m_decayLimitsEvent;
72
73 typedef FwStats super;
74};
75
76
77} // namespace fw
78} // namespace ndn
79} // namespace ns3
80
81#endif // NDNSIM_PER_FIB_LIMITS_H