blob: fc59378da097db7fe6cb27847fb209591bcd8984 [file] [log] [blame]
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08003 * Copyright (c) 2011-2015 Regents of the University of California.
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -07004 *
5 * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
6 * contributors.
7 *
8 * ndnSIM is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20#ifndef NDN_NS3_PACKET_TAG_HPP
21#define NDN_NS3_PACKET_TAG_HPP
22
23#include "ns3/packet.h"
24#include "ns3/ptr.h"
25#include <ndn-cxx/tag.hpp>
26
27namespace ns3 {
28namespace ndn {
29
30class Ns3PacketTag : public ::ndn::Tag {
31public:
32 static size_t
33 getTypeId()
34 {
35 return 0xaee87802; // md5("Ns3PacketTag")[0:8]
36 }
37
38 Ns3PacketTag(Ptr<const Packet> packet)
39 : m_packet(packet)
40 {
41 }
42
43 Ptr<const Packet>
44 getPacket() const
45 {
46 return m_packet;
47 }
48
49private:
50 Ptr<const Packet> m_packet;
51};
52
53} // namespace ndn
54} // namespace ns3
55
56#endif // NDN_NS3_PACKET_TAG_HPP