Alexander Afanasyev | e74cc1c | 2012-11-21 13:10:03 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | |
| 3 | // custom-strategy.h |
| 4 | |
| 5 | #ifndef CUSTOM_STRATEGY_H |
| 6 | #define CUSTOM_STRATEGY_H |
| 7 | |
| 8 | #include "ns3/log.h" |
| 9 | #include "ns3/ndn-forwarding-strategy.h" |
| 10 | #include "ns3/ndn-l3-protocol.h" |
| 11 | |
| 12 | namespace ns3 { |
| 13 | namespace ndn { |
| 14 | namespace fw { |
| 15 | |
| 16 | typedef ForwardingStrategy BaseStrategy; |
| 17 | |
| 18 | class CustomStrategy: |
| 19 | public BaseStrategy |
| 20 | { |
| 21 | public: |
| 22 | static TypeId |
| 23 | GetTypeId (); |
| 24 | |
| 25 | static std::string |
| 26 | GetLogName (); |
| 27 | |
| 28 | CustomStrategy (); |
| 29 | |
| 30 | protected: |
| 31 | virtual bool |
| 32 | DoPropagateInterest (Ptr<Face> incomingFace, |
Alexander Afanasyev | eae83ee | 2013-03-15 15:01:10 -0700 | [diff] [blame] | 33 | Ptr<const Interest> header, |
Alexander Afanasyev | e74cc1c | 2012-11-21 13:10:03 -0800 | [diff] [blame] | 34 | Ptr<const Packet> origPacket, |
| 35 | Ptr<pit::Entry> pitEntry); |
| 36 | |
| 37 | public: |
| 38 | virtual void |
Alexander Afanasyev | 932d331 | 2012-11-26 23:55:01 -0800 | [diff] [blame] | 39 | DidSendOutInterest (Ptr<Face> inFace, Ptr<Face> outFace, |
Alexander Afanasyev | eae83ee | 2013-03-15 15:01:10 -0700 | [diff] [blame] | 40 | Ptr<const Interest> header, |
Alexander Afanasyev | e74cc1c | 2012-11-21 13:10:03 -0800 | [diff] [blame] | 41 | Ptr<const Packet> origPacket, |
| 42 | Ptr<pit::Entry> pitEntry); |
| 43 | |
| 44 | virtual void |
| 45 | WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry); |
| 46 | |
| 47 | virtual void |
| 48 | WillSatisfyPendingInterest (Ptr<Face> inFace, |
| 49 | Ptr<pit::Entry> pitEntry); |
| 50 | |
| 51 | protected: |
| 52 | static LogComponent g_log; |
| 53 | |
| 54 | // private: |
| 55 | // std::string m_variable; |
| 56 | |
| 57 | private: |
| 58 | uint32_t m_counter; |
| 59 | }; |
| 60 | |
| 61 | |
| 62 | |
| 63 | } // namespace fw |
| 64 | } // namespace ndn |
| 65 | } // namespace ns3 |
| 66 | |
| 67 | #endif // CUSTOM_STRATEGY_H |