blob: e1637aa42e38bc75ada3ae7f8a31d9bfd742a176 [file] [log] [blame]
Alexander Afanasyev996b4872012-07-17 17:07:56 -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#ifndef NDNSIM_SMART_FLOODING_H
22#define NDNSIM_SMART_FLOODING_H
23
24#include "green-yellow-red.h"
Alexander Afanasyev042b4a72012-11-09 17:47:48 -080025#include "ns3/log.h"
Alexander Afanasyev996b4872012-07-17 17:07:56 -070026
27namespace ns3 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070028namespace ndn {
29namespace fw {
Alexander Afanasyev996b4872012-07-17 17:07:56 -070030
31/**
32 * \ingroup ccnx
33 */
34class SmartFlooding :
35 public GreenYellowRed
36{
Alexander Afanasyev042b4a72012-11-09 17:47:48 -080037private:
38 typedef GreenYellowRed super;
39
Alexander Afanasyev996b4872012-07-17 17:07:56 -070040public:
Alexander Afanasyev042b4a72012-11-09 17:47:48 -080041 static TypeId
42 GetTypeId ();
43
44 /**
45 * @brief Helper function to retrieve logging name for the forwarding strategy
46 */
47 static std::string
48 GetLogName ();
Alexander Afanasyev996b4872012-07-17 17:07:56 -070049
50 /**
51 * @brief Default constructor
52 */
53 SmartFlooding ();
54
55 // inherited
56 virtual bool
Alexander Afanasyev31cb4692012-08-17 13:08:20 -070057 DoPropagateInterest (Ptr<Face> inFace,
Alexander Afanasyeveae83ee2013-03-15 15:01:10 -070058 Ptr<const Interest> header,
Alexander Afanasyev31cb4692012-08-17 13:08:20 -070059 Ptr<const Packet> origPacket,
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070060 Ptr<pit::Entry> pitEntry);
Alexander Afanasyev996b4872012-07-17 17:07:56 -070061
Alexander Afanasyev042b4a72012-11-09 17:47:48 -080062protected:
63 static LogComponent g_log;
Alexander Afanasyev996b4872012-07-17 17:07:56 -070064};
65
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070066} // namespace fw
67} // namespace ndn
Alexander Afanasyev996b4872012-07-17 17:07:56 -070068} // namespace ns3
69
70#endif // NDNSIM_SMART_FLOODING_H