blob: 454f8e2455c688467c2d66e491ca954b112d861e [file] [log] [blame]
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
19 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
20 */
21
22#ifndef _CONTENT_OBJECT_HEADER_H_
23#define _CONTENT_OBJECT_HEADER_H_
24
25#include <ns3/integer.h>
26#include <ns3/header.h>
27
28#include <string>
29#include <vector>
30#include <list>
31
32#include "name-components.h"
33
34namespace ns3
35{
36namespace NDNabstraction
37{
38
39/**
40 * CCNx XML definition of ContentObject
41 *
42 * Only few important fields are actually implemented in the simulation
43 *
44 *
45 * NDN ContentObjectHeader and routines to serialize/deserialize
46 *
47 * Simplifications:
48 */
49
50class ContentObjectHeader : public Header
51{
52public:
53 /**
54 * Constructor
55 *
56 * Creates a null header
57 **/
58 ContentObjectHeader ();
59
60 /**
61 * \brief Set interest name
62 *
63 * Sets name of the interest. For example, SetName( Name::Components("prefix")("postfix") );
64 **/
65 void
66 SetName (const Ptr<Name::Components> &name);
67
68 const Name::Components&
69 GetName () const;
70
71 // void
72 // SetSignature ();
73
74 // ?
75 // GetSignature () const;
76
77 // void
78 // SetSignedInfo ();
79
80 // ?
81 // GetSignedInfo () const;
82
83 // void
84 // SetContent ();
85
86 // ?
87 // GetContent ();
88
89 //////////////////////////////////////////////////////////////////
90
91 static TypeId GetTypeId (void);
92 virtual TypeId GetInstanceTypeId (void) const;
93 virtual void Print (std::ostream &os) const;
94 virtual uint32_t GetSerializedSize (void) const;
95 virtual void Serialize (Buffer::Iterator start) const;
96 virtual uint32_t Deserialize (Buffer::Iterator start);
97
98private:
99 Ptr<Name::Components> m_name;
100 // m_signature;
101 // m_signedInfo;
102 // ? content
103};
104
105} // namespace NDNabstraction
106} // namespace ns3
107
108#endif // _CONTENT_OBJECT_HEADER_H_