blob: f2c73ab431ece13350cb76ee291def160b124eb1 [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
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080020#ifndef NDNSIM_NDN_BLOCK_HEADER_HPP
21#define NDNSIM_NDN_BLOCK_HEADER_HPP
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070022
23#include "ns3/header.h"
24
25#include "ndn-common.hpp"
26
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080027namespace nfdFace = nfd::face;
28
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070029namespace ns3 {
30namespace ndn {
31
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080032class BlockHeader : public Header {
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070033public:
34 static ns3::TypeId
35 GetTypeId();
36
37 virtual TypeId
38 GetInstanceTypeId(void) const;
39
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080040 BlockHeader();
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070041
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080042 BlockHeader(const nfdFace::Transport::Packet& packet);
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070043
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 Mastorakis5ea33222016-12-07 14:33:53 -080056 Block&
57 getBlock();
58
59 const Block&
60 getBlock() const;
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070061
62private:
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080063 Block m_block;
Spyridon Mastorakisded1aa62014-10-29 16:36:40 -070064};
65
66} // namespace ndn
67} // namespace ns3
68
Spyridon Mastorakis5ea33222016-12-07 14:33:53 -080069#endif // NDNSIM_NDN_BLOCK_HEADER_HPP