blob: dd7eab59b700a54122ea0cb6fe29d9a79af9213e [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
26Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry)
27{
28 NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
29}
30
31void
32Strategy::afterAddFibEntry(shared_ptr<fib::Entry> fibEntry)
33{
34 NFD_LOG_DEBUG("afterAddFibEntry fibEntry=" << fibEntry->getPrefix());
35}
36
37void
38Strategy::afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry)
39{
40 NFD_LOG_DEBUG("afterUpdateFibEntry fibEntry=" << fibEntry->getPrefix());
41}
42
43void
44Strategy::beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry)
45{
46 NFD_LOG_DEBUG("beforeRemoveFibEntry fibEntry=" << fibEntry->getPrefix());
47}
Junxiao Shid3c792f2014-01-30 00:46:13 -070048
49void
50Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry,
51 shared_ptr<Face> outFace)
52{
Junxiao Shi8c8d2182014-01-30 22:33:00 -070053 m_forwarder.onOutgoingInterest(pitEntry, *outFace);
Junxiao Shid3c792f2014-01-30 00:46:13 -070054}
55
56void
57Strategy::rebuffPendingInterest(shared_ptr<pit::Entry> pitEntry)
58{
Junxiao Shi8c8d2182014-01-30 22:33:00 -070059 m_forwarder.onInterestRebuff(pitEntry);
Junxiao Shid3c792f2014-01-30 00:46:13 -070060}
61
Junxiao Shi8c8d2182014-01-30 22:33:00 -070062} // namespace fw
Junxiao Shid3c792f2014-01-30 00:46:13 -070063} // namespace nfd