blob: 14e4cbe92417ec06e7ddf1570b88b15a9e1a5c8d [file] [log] [blame]
Junxiao Shid3c792f2014-01-30 00:46:13 -07001/* -*- 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 Shi8c8d2182014-01-30 22:33:00 -07008#include "forwarder.hpp"
Junxiao Shi679e9272014-02-15 20:10:21 -07009#include "core/logger.hpp"
Junxiao Shid3c792f2014-01-30 00:46:13 -070010
11namespace nfd {
Junxiao Shi8c8d2182014-01-30 22:33:00 -070012namespace fw {
Junxiao Shid3c792f2014-01-30 00:46:13 -070013
Junxiao Shi679e9272014-02-15 20:10:21 -070014NFD_LOG_INIT("Strategy");
15
Junxiao Shi8c8d2182014-01-30 22:33:00 -070016Strategy::Strategy(Forwarder& forwarder)
17 : m_forwarder(forwarder)
Junxiao Shid3c792f2014-01-30 00:46:13 -070018{
19}
20
21Strategy::~Strategy()
22{
23}
24
Junxiao Shi679e9272014-02-15 20:10:21 -070025void
Junxiao Shi22be22c2014-02-16 22:53:48 -070026Strategy::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
33void
Junxiao Shi679e9272014-02-15 20:10:21 -070034Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry)
35{
36 NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
37}
38
Junxiao Shi22be22c2014-02-16 22:53:48 -070039//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 Shid3c792f2014-01-30 00:46:13 -070056
57void
58Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry,
59 shared_ptr<Face> outFace)
60{
Junxiao Shi8c8d2182014-01-30 22:33:00 -070061 m_forwarder.onOutgoingInterest(pitEntry, *outFace);
Junxiao Shid3c792f2014-01-30 00:46:13 -070062}
63
64void
65Strategy::rebuffPendingInterest(shared_ptr<pit::Entry> pitEntry)
66{
Junxiao Shi8c8d2182014-01-30 22:33:00 -070067 m_forwarder.onInterestRebuff(pitEntry);
Junxiao Shid3c792f2014-01-30 00:46:13 -070068}
69
Junxiao Shi8c8d2182014-01-30 22:33:00 -070070} // namespace fw
Junxiao Shid3c792f2014-01-30 00:46:13 -070071} // namespace nfd