blob: 0800885c4fa97826a2bd2f76f6091d556d8aae9d [file] [log] [blame]
Alexander Afanasyev45b92d42011-08-14 23:11:38 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -07002/*
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
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070022#ifndef _CCNX_CONTENT_OBJECT_HEADER_H_
23#define _CCNX_CONTENT_OBJECT_HEADER_H_
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -070024
Alexander Afanasyev2536e202011-08-12 14:13:10 -070025#include "ns3/integer.h"
26#include "ns3/header.h"
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -070027
28#include <string>
29#include <vector>
30#include <list>
31
32#include "name-components.h"
33
34namespace ns3
35{
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -070036
37/**
38 * CCNx XML definition of ContentObject
39 *
40 * Only few important fields are actually implemented in the simulation
41 *
42 *
43 * NDN ContentObjectHeader and routines to serialize/deserialize
44 *
45 * Simplifications:
46 */
47
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070048class CcnxContentObjectHeader : public Header
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -070049{
50public:
51 /**
52 * Constructor
53 *
54 * Creates a null header
55 **/
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070056 CcnxContentObjectHeader ();
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -070057
58 /**
59 * \brief Set interest name
60 *
61 * Sets name of the interest. For example, SetName( Name::Components("prefix")("postfix") );
62 **/
63 void
64 SetName (const Ptr<Name::Components> &name);
65
66 const Name::Components&
67 GetName () const;
68
69 // void
70 // SetSignature ();
71
72 // ?
73 // GetSignature () const;
74
75 // void
76 // SetSignedInfo ();
77
78 // ?
79 // GetSignedInfo () const;
80
81 // void
82 // SetContent ();
83
84 // ?
85 // GetContent ();
86
87 //////////////////////////////////////////////////////////////////
88
89 static TypeId GetTypeId (void);
90 virtual TypeId GetInstanceTypeId (void) const;
91 virtual void Print (std::ostream &os) const;
92 virtual uint32_t GetSerializedSize (void) const;
93 virtual void Serialize (Buffer::Iterator start) const;
94 virtual uint32_t Deserialize (Buffer::Iterator start);
95
96private:
97 Ptr<Name::Components> m_name;
98 // m_signature;
99 // m_signedInfo;
100 // ? content
101};
102
Alexander Afanasyev8a677dd2011-08-12 13:08:15 -0700103} // namespace ns3
104
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700105#endif // _CCNX_CONTENT_OBJECT_HEADER_H_