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 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 20 | #ifndef NDNSIM_NDN_BLOCK_HEADER_HPP |
| 21 | #define NDNSIM_NDN_BLOCK_HEADER_HPP |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 22 | |
| 23 | #include "ns3/header.h" |
| 24 | |
| 25 | #include "ndn-common.hpp" |
| 26 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 27 | namespace nfdFace = nfd::face; |
| 28 | |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 29 | namespace ns3 { |
| 30 | namespace ndn { |
| 31 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 32 | class BlockHeader : public Header { |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 33 | public: |
| 34 | static ns3::TypeId |
| 35 | GetTypeId(); |
| 36 | |
| 37 | virtual TypeId |
| 38 | GetInstanceTypeId(void) const; |
| 39 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 40 | BlockHeader(); |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 41 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 42 | BlockHeader(const nfdFace::Transport::Packet& packet); |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 43 | |
| 44 | virtual uint32_t |
| 45 | GetSerializedSize(void) const; |
| 46 | |
| 47 | virtual void |
| 48 | Serialize(ns3::Buffer::Iterator start) const; |
| 49 | |
| 50 | virtual uint32_t |
| 51 | Deserialize(ns3::Buffer::Iterator start); |
| 52 | |
| 53 | virtual void |
| 54 | Print(std::ostream& os) const; |
| 55 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 56 | Block& |
| 57 | getBlock(); |
| 58 | |
| 59 | const Block& |
| 60 | getBlock() const; |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 61 | |
| 62 | private: |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 63 | Block m_block; |
Spyridon Mastorakis | ded1aa6 | 2014-10-29 16:36:40 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | } // namespace ndn |
| 67 | } // namespace ns3 |
| 68 | |
Spyridon Mastorakis | 5ea3322 | 2016-12-07 14:33:53 -0800 | [diff] [blame] | 69 | #endif // NDNSIM_NDN_BLOCK_HEADER_HPP |