Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -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 | #ifndef NDNSIM_SMART_FLOODING_H |
| 22 | #define NDNSIM_SMART_FLOODING_H |
| 23 | |
| 24 | #include "green-yellow-red.h" |
Alexander Afanasyev | 042b4a7 | 2012-11-09 17:47:48 -0800 | [diff] [blame] | 25 | #include "ns3/log.h" |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ns3 { |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 28 | namespace ndn { |
| 29 | namespace fw { |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * \ingroup ccnx |
| 33 | */ |
| 34 | class SmartFlooding : |
| 35 | public GreenYellowRed |
| 36 | { |
Alexander Afanasyev | 042b4a7 | 2012-11-09 17:47:48 -0800 | [diff] [blame] | 37 | private: |
| 38 | typedef GreenYellowRed super; |
| 39 | |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 40 | public: |
Alexander Afanasyev | 042b4a7 | 2012-11-09 17:47:48 -0800 | [diff] [blame] | 41 | 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 Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * @brief Default constructor |
| 52 | */ |
| 53 | SmartFlooding (); |
| 54 | |
| 55 | // inherited |
| 56 | virtual bool |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 57 | DoPropagateInterest (Ptr<Face> inFace, |
Alexander Afanasyev | eae83ee | 2013-03-15 15:01:10 -0700 | [diff] [blame] | 58 | Ptr<const Interest> header, |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 59 | Ptr<const Packet> origPacket, |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 60 | Ptr<pit::Entry> pitEntry); |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 61 | |
Alexander Afanasyev | 042b4a7 | 2012-11-09 17:47:48 -0800 | [diff] [blame] | 62 | protected: |
| 63 | static LogComponent g_log; |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 66 | } // namespace fw |
| 67 | } // namespace ndn |
Alexander Afanasyev | 996b487 | 2012-07-17 17:07:56 -0700 | [diff] [blame] | 68 | } // namespace ns3 |
| 69 | |
| 70 | #endif // NDNSIM_SMART_FLOODING_H |