NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-ns3-packet-tag.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
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 
27 namespace ns3 {
28 namespace ndn {
29 
30 class Ns3PacketTag : public ::ndn::Tag {
31 public:
32  static size_t
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 
49 private:
50  Ptr<const Packet> m_packet;
51 };
52 
53 } // namespace ndn
54 } // namespace ns3
55 
56 #endif // NDN_NS3_PACKET_TAG_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Ptr< const Packet > getPacket() const
Ns3PacketTag(Ptr< const Packet > packet)
Copyright (c) 2011-2015 Regents of the University of California.
Base class for packet tags that can hold any arbitrary information.
Definition: tag.hpp:30