blob: 8e4ba4cf180f7efa67e82b42ed73b79a62319389 [file] [log] [blame]
Alexander Afanasyev1a0fff62013-01-19 14:29:51 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#include "ndn-fw-hop-count-tag.h"
22
23namespace ns3 {
24namespace ndn {
25
26TypeId
27FwHopCountTag::GetTypeId ()
28{
29 static TypeId tid = TypeId("ns3::ndn::FwHopCountTag")
30 .SetParent<Tag>()
31 .AddConstructor<FwHopCountTag>()
32 ;
33 return tid;
34}
35
36TypeId
37FwHopCountTag::GetInstanceTypeId () const
38{
39 return FwHopCountTag::GetTypeId ();
40}
41
42uint32_t
43FwHopCountTag::GetSerializedSize () const
44{
45 return sizeof(uint32_t);
46}
47
48void
49FwHopCountTag::Serialize (TagBuffer i) const
50{
51 i.WriteU32 (m_hopCount);
52}
53
54void
55FwHopCountTag::Deserialize (TagBuffer i)
56{
57 m_hopCount = i.ReadU32 ();
58}
59
60void
61FwHopCountTag::Print (std::ostream &os) const
62{
63 os << m_hopCount;
64}
65
66} // namespace ndn
67} // namespace ns3