Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 3 | * Copyright (c) 2011-2015 Regents of the University of California. |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 4 | * |
| 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 NDNSIM_NDN_HEADER_HPP |
| 21 | #define NDNSIM_NDN_HEADER_HPP |
| 22 | |
| 23 | #include "ns3/header.h" |
| 24 | |
| 25 | #include "ndn-common.hpp" |
| 26 | |
| 27 | namespace ns3 { |
| 28 | namespace ndn { |
| 29 | |
| 30 | template<class Pkt> |
| 31 | class PacketHeader : public Header { |
| 32 | public: |
| 33 | static ns3::TypeId |
| 34 | GetTypeId(); |
| 35 | |
| 36 | virtual TypeId |
| 37 | GetInstanceTypeId(void) const; |
| 38 | |
| 39 | PacketHeader(); |
| 40 | |
| 41 | PacketHeader(const Pkt& packet); |
| 42 | |
| 43 | virtual uint32_t |
| 44 | GetSerializedSize(void) const; |
| 45 | |
| 46 | virtual void |
| 47 | Serialize(ns3::Buffer::Iterator start) const; |
| 48 | |
| 49 | virtual uint32_t |
| 50 | Deserialize(ns3::Buffer::Iterator start); |
| 51 | |
| 52 | virtual void |
| 53 | Print(std::ostream& os) const; |
| 54 | |
| 55 | shared_ptr<const Pkt> |
| 56 | getPacket(); |
| 57 | |
| 58 | private: |
| 59 | shared_ptr<const Pkt> m_packet; |
| 60 | }; |
| 61 | |
| 62 | } // namespace ndn |
| 63 | } // namespace ns3 |
| 64 | |
| 65 | #endif // NDNSIM_NDN_HEADER_HPP |