blob: 253efc8bb76d2da61175ad665a75ea1dae58020e [file] [log] [blame]
Junxiao Shi727ed292014-02-19 23:26:45 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Junxiao Shi8d843142016-07-11 22:42:42 +00003 * Copyright (c) 2014-2016, Regents of the University of California,
Junxiao Shifaf3eb02015-02-16 10:50:36 -07004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
Alexander Afanasyev9bcbc7c2014-04-06 19:37:37 -070010 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Junxiao Shie93d6a32014-09-07 16:13:22 -070024 */
Junxiao Shi727ed292014-02-19 23:26:45 -070025
26#include "broadcast-strategy.hpp"
27
28namespace nfd {
29namespace fw {
30
Junxiao Shi67ba8d22015-08-21 21:21:28 -070031NFD_LOG_INIT("BroadcastStrategy");
32
33const Name BroadcastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/broadcast/%FD%02");
Junxiao Shifaf3eb02015-02-16 10:50:36 -070034NFD_REGISTER_STRATEGY(BroadcastStrategy);
Junxiao Shif3c07812014-03-11 21:48:49 -070035
36BroadcastStrategy::BroadcastStrategy(Forwarder& forwarder, const Name& name)
Junxiao Shi67ba8d22015-08-21 21:21:28 -070037 : MulticastStrategy(forwarder, name)
38 , m_isFirstUse(true)
Junxiao Shi727ed292014-02-19 23:26:45 -070039{
40}
41
42void
Junxiao Shi15e98b02016-08-12 11:21:44 +000043BroadcastStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
44 const shared_ptr<pit::Entry>& pitEntry)
Junxiao Shi727ed292014-02-19 23:26:45 -070045{
Junxiao Shi67ba8d22015-08-21 21:21:28 -070046 if (m_isFirstUse) {
47 NFD_LOG_WARN("The broadcast strategy has been renamed as multicast strategy. "
48 "Use ndn:/localhost/nfd/strategy/multicast to select the multicast strategy.");
49 m_isFirstUse = false;
Junxiao Shi727ed292014-02-19 23:26:45 -070050 }
51
Junxiao Shi8d843142016-07-11 22:42:42 +000052 this->MulticastStrategy::afterReceiveInterest(inFace, interest, pitEntry);
Junxiao Shi727ed292014-02-19 23:26:45 -070053}
54
55} // namespace fw
56} // namespace nfd