Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #include "strategy.hpp" |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 8 | #include "forwarder.hpp" |
Junxiao Shi | 679e927 | 2014-02-15 20:10:21 -0700 | [diff] [blame] | 9 | #include "core/logger.hpp" |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 10 | |
| 11 | namespace nfd { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 12 | namespace fw { |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 13 | |
Junxiao Shi | 679e927 | 2014-02-15 20:10:21 -0700 | [diff] [blame] | 14 | NFD_LOG_INIT("Strategy"); |
| 15 | |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 16 | Strategy::Strategy(Forwarder& forwarder) |
| 17 | : m_forwarder(forwarder) |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 18 | { |
| 19 | } |
| 20 | |
| 21 | Strategy::~Strategy() |
| 22 | { |
| 23 | } |
| 24 | |
Junxiao Shi | 679e927 | 2014-02-15 20:10:21 -0700 | [diff] [blame] | 25 | void |
Junxiao Shi | 22be22c | 2014-02-16 22:53:48 -0700 | [diff] [blame] | 26 | Strategy::beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry, |
| 27 | const Face& inFace, const Data& data) |
| 28 | { |
| 29 | NFD_LOG_DEBUG("beforeSatisfyPendingInterest pitEntry=" << pitEntry->getName() << |
| 30 | " inFace=" << inFace.getId() << " data=" << data.getName()); |
| 31 | } |
| 32 | |
| 33 | void |
Junxiao Shi | 679e927 | 2014-02-15 20:10:21 -0700 | [diff] [blame] | 34 | Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry) |
| 35 | { |
| 36 | NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName()); |
| 37 | } |
| 38 | |
Junxiao Shi | 22be22c | 2014-02-16 22:53:48 -0700 | [diff] [blame] | 39 | //void |
| 40 | //Strategy::afterAddFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 41 | //{ |
| 42 | // NFD_LOG_DEBUG("afterAddFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 43 | //} |
| 44 | // |
| 45 | //void |
| 46 | //Strategy::afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 47 | //{ |
| 48 | // NFD_LOG_DEBUG("afterUpdateFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 49 | //} |
| 50 | // |
| 51 | //void |
| 52 | //Strategy::beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 53 | //{ |
| 54 | // NFD_LOG_DEBUG("beforeRemoveFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 55 | //} |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 56 | |
| 57 | void |
| 58 | Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry, |
| 59 | shared_ptr<Face> outFace) |
| 60 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 61 | m_forwarder.onOutgoingInterest(pitEntry, *outFace); |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | void |
| 65 | Strategy::rebuffPendingInterest(shared_ptr<pit::Entry> pitEntry) |
| 66 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 67 | m_forwarder.onInterestRebuff(pitEntry); |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 70 | } // namespace fw |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 71 | } // namespace nfd |