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 |
| 26 | Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry) |
| 27 | { |
| 28 | NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName()); |
| 29 | } |
| 30 | |
| 31 | void |
| 32 | Strategy::afterAddFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 33 | { |
| 34 | NFD_LOG_DEBUG("afterAddFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 35 | } |
| 36 | |
| 37 | void |
| 38 | Strategy::afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 39 | { |
| 40 | NFD_LOG_DEBUG("afterUpdateFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 41 | } |
| 42 | |
| 43 | void |
| 44 | Strategy::beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry) |
| 45 | { |
| 46 | NFD_LOG_DEBUG("beforeRemoveFibEntry fibEntry=" << fibEntry->getPrefix()); |
| 47 | } |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 48 | |
| 49 | void |
| 50 | Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry, |
| 51 | shared_ptr<Face> outFace) |
| 52 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 53 | m_forwarder.onOutgoingInterest(pitEntry, *outFace); |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | void |
| 57 | Strategy::rebuffPendingInterest(shared_ptr<pit::Entry> pitEntry) |
| 58 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 59 | m_forwarder.onInterestRebuff(pitEntry); |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 62 | } // namespace fw |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 63 | } // namespace nfd |