blob: 611b151e073435a157138a6577ea6531c0332591 [file] [log] [blame]
Junxiao Shida93f1f2015-11-11 06:13:16 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014-2015, Regents of the University of California,
4 * 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
26#include "face-counters.hpp"
27#include "old-face-counters.hpp"
28
29namespace nfd {
30namespace face {
31
32FaceCounters::FaceCounters(const LinkService::Counters& linkServiceCounters,
33 const Transport::Counters& transportCounters)
34 : nInInterests(linkServiceCounters.nInInterests)
35 , nOutInterests(linkServiceCounters.nOutInterests)
36 , nInData(linkServiceCounters.nInData)
37 , nOutData(linkServiceCounters.nOutData)
38 , nInNacks(linkServiceCounters.nInNacks)
39 , nOutNacks(linkServiceCounters.nOutNacks)
40 , nInPackets(transportCounters.nInPackets)
41 , nOutPackets(transportCounters.nOutPackets)
42 , nInBytes(transportCounters.nInBytes)
43 , nOutBytes(transportCounters.nOutBytes)
44 , m_linkServiceCounters(linkServiceCounters)
45 , m_transportCounters(transportCounters)
46{
47}
48
49static const LinkService::Counters g_dummyLinkServiceCounters{};
50static const Transport::Counters g_dummyTransportCounters{};
51
52FaceCounters::FaceCounters(const OldFaceCounters& oldCounters)
53 : nInInterests(oldCounters.getNInInterests())
54 , nOutInterests(oldCounters.getNOutInterests())
55 , nInData(oldCounters.getNInDatas())
56 , nOutData(oldCounters.getNOutDatas())
57 , nInNacks(g_dummyLinkServiceCounters.nInNacks)
58 , nOutNacks(g_dummyLinkServiceCounters.nOutNacks)
59 , nInPackets(g_dummyTransportCounters.nInPackets)
60 , nOutPackets(g_dummyTransportCounters.nOutPackets)
61 , nInBytes(oldCounters.getNInBytes())
62 , nOutBytes(oldCounters.getNOutBytes())
63 , m_linkServiceCounters(g_dummyLinkServiceCounters)
64 , m_transportCounters(g_dummyTransportCounters)
65{
66}
67
68} // namespace face
69} // namespace nfd