blob: ce006cb45e033a998986e31e743de3a12c182de9 [file] [log] [blame]
Yukai Tu2d6d5632015-10-26 11:06:02 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Davide Pesavento2d83a862019-03-16 19:27:16 -04002/*
3 * Copyright (c) 2014-2019, Regents of the University of California,
Yukai Tu2d6d5632015-10-26 11:06:02 -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.
10 *
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/>.
24 */
25
Davide Pesaventoa8098582019-03-31 15:48:02 -040026#include "dummy-link-service.hpp"
Yukai Tu2d6d5632015-10-26 11:06:02 -070027
28namespace nfd {
29namespace face {
30namespace tests {
31
Davide Pesaventoa8098582019-03-31 15:48:02 -040032void
Davide Pesaventob3a23ca2019-05-04 20:40:21 -040033DummyLinkService::doSendInterest(const Interest& interest, const EndpointId&)
Yukai Tu2d6d5632015-10-26 11:06:02 -070034{
Davide Pesaventoa8098582019-03-31 15:48:02 -040035 if (m_loggingFlags & LogSentInterests)
36 sentInterests.push_back(interest);
Yukai Tu2d6d5632015-10-26 11:06:02 -070037
Davide Pesaventoa8098582019-03-31 15:48:02 -040038 afterSend(tlv::Interest);
39}
Yukai Tu2d6d5632015-10-26 11:06:02 -070040
Davide Pesaventoa8098582019-03-31 15:48:02 -040041void
Davide Pesaventob3a23ca2019-05-04 20:40:21 -040042DummyLinkService::doSendData(const Data& data, const EndpointId&)
Davide Pesaventoa8098582019-03-31 15:48:02 -040043{
44 if (m_loggingFlags & LogSentData)
45 sentData.push_back(data);
Yukai Tu2d6d5632015-10-26 11:06:02 -070046
Davide Pesaventoa8098582019-03-31 15:48:02 -040047 afterSend(tlv::Data);
48}
49
50void
Davide Pesaventob3a23ca2019-05-04 20:40:21 -040051DummyLinkService::doSendNack(const lp::Nack& nack, const EndpointId&)
Davide Pesaventoa8098582019-03-31 15:48:02 -040052{
53 if (m_loggingFlags & LogSentNacks)
54 sentNacks.push_back(nack);
55
56 afterSend(lp::tlv::Nack);
57}
58
59void
Davide Pesaventob3a23ca2019-05-04 20:40:21 -040060DummyLinkService::doReceivePacket(const Block& packet, const EndpointId& endpoint)
Davide Pesaventoa8098582019-03-31 15:48:02 -040061{
62 if (m_loggingFlags & LogReceivedPackets)
Davide Pesaventob3a23ca2019-05-04 20:40:21 -040063 receivedPackets.push_back({packet, endpoint});
Davide Pesaventoa8098582019-03-31 15:48:02 -040064}
Yukai Tu2d6d5632015-10-26 11:06:02 -070065
66} // namespace tests
67} // namespace face
68} // namespace nfd