blob: f11296ce9b906470620748163108f3be2276d507 [file] [log] [blame]
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Alexander Afanasyev08d984e2011-08-13 19:20:22 -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
22#include "ccnx-content-object-header.h"
23
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070024#include "ns3/log.h"
Alexander Afanasyevf9f4eb02011-12-16 01:51:14 -080025#include "../helper/ccnx-encoding-helper.h"
26#include "../helper/ccnx-decoding-helper.h"
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070027
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -070028#include "../helper/ccnb-parser/ccnb-parser-common.h"
29#include "../helper/ccnb-parser/visitors/ccnb-parser-void-depth-first-visitor.h"
30#include "../helper/ccnb-parser/visitors/ccnb-parser-name-components-visitor.h"
31#include "../helper/ccnb-parser/visitors/ccnb-parser-non-negative-integer-visitor.h"
32#include "../helper/ccnb-parser/visitors/ccnb-parser-timestamp-visitor.h"
33#include "../helper/ccnb-parser/visitors/ccnb-parser-string-visitor.h"
34#include "../helper/ccnb-parser/visitors/ccnb-parser-uint32t-blob-visitor.h"
35#include "../helper/ccnb-parser/visitors/ccnb-parser-content-type-visitor.h"
36
37#include "../helper/ccnb-parser/syntax-tree/ccnb-parser-block.h"
38#include "../helper/ccnb-parser/syntax-tree/ccnb-parser-dtag.h"
39
40#include <boost/foreach.hpp>
41
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070042NS_LOG_COMPONENT_DEFINE ("CcnxContentObjectHeader");
43
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -070044using namespace ns3::CcnbParser;
45
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070046namespace ns3
47{
48
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -070049const std::string CcnxContentObjectHeader::Signature::DefaultDigestAlgorithm = "2.16.840.1.101.3.4.2.1";
50
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070051NS_OBJECT_ENSURE_REGISTERED (CcnxContentObjectHeader);
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070052NS_OBJECT_ENSURE_REGISTERED (CcnxContentObjectTail);
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070053
54TypeId
55CcnxContentObjectHeader::GetTypeId (void)
56{
57 static TypeId tid = TypeId ("ns3::CcnxContentObjectHeader")
Alexander Afanasyev070aa482011-08-20 00:38:25 -070058 .SetGroupName ("Ccnx")
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070059 .SetParent<Header> ()
60 .AddConstructor<CcnxContentObjectHeader> ()
61 ;
62 return tid;
63}
64
65CcnxContentObjectHeader::CcnxContentObjectHeader ()
66{
67}
68
69void
Ilya Moiseenko2bd1bc32011-08-23 16:01:35 -070070CcnxContentObjectHeader::SetName (const Ptr<CcnxNameComponents> &name)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070071{
72 m_name = name;
73}
74
Ilya Moiseenko2bd1bc32011-08-23 16:01:35 -070075const CcnxNameComponents&
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070076CcnxContentObjectHeader::GetName () const
77{
Alexander Afanasyeve91ab752011-08-31 19:13:40 -070078 if (m_name==0) throw CcnxContentObjectHeaderException();
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070079 return *m_name;
80}
81
Alexander Afanasyev30f60e32012-07-10 14:21:16 -070082Ptr<const CcnxNameComponents>
83CcnxContentObjectHeader::GetNamePtr () const
84{
85 return m_name;
86}
87
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -070088#define CCNB CcnxEncodingHelper // just to simplify writing
Alexander Afanasyev9568f952012-04-05 16:09:14 -070089
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070090void
91CcnxContentObjectHeader::Serialize (Buffer::Iterator start) const
92{
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -070093 size_t written = 0;
94 written += CCNB::AppendBlockHeader (start, CCN_DTAG_ContentObject, CcnbParser::CCN_DTAG); // <ContentObject>
95
96 // fake signature
97 written += CCNB::AppendBlockHeader (start, CCN_DTAG_Signature, CcnbParser::CCN_DTAG); // <Signature>
98 // Signature ::= √DigestAlgorithm?
99 // Witness?
100 // √SignatureBits
101 if (GetSignature ().GetDigestAlgorithm () != Signature::DefaultDigestAlgorithm)
102 {
103 written += CCNB::AppendString (start, CCN_DTAG_DigestAlgorithm, GetSignature ().GetDigestAlgorithm ());
104 }
105 written += CCNB::AppendTaggedBlob (start, CCN_DTAG_SignatureBits, GetSignature ().GetSignatureBits ()); // <SignatureBits />
106 written += CCNB::AppendCloser (start); // </Signature>
107
108 written += CCNB::AppendBlockHeader (start, CCN_DTAG_Name, CCN_DTAG); // <Name>
109 written += CCNB::AppendNameComponents (start, GetName()); // <Component>...</Component>...
110 written += CCNB::AppendCloser (start); // </Name>
111
112 // fake signature
113 written += CCNB::AppendBlockHeader (start, CCN_DTAG_SignedInfo, CCN_DTAG); // <SignedInfo>
114 // SignedInfo ::= √PublisherPublicKeyDigest
115 // √Timestamp
116 // √Type?
117 // √FreshnessSeconds?
118 // FinalBlockID?
119 // KeyLocator?
120 written += CCNB::AppendTaggedBlob (start, CCN_DTAG_PublisherPublicKeyDigest, // <PublisherPublicKeyDigest>...
121 GetSignedInfo ().GetPublisherPublicKeyDigest ());
122
123 written += CCNB::AppendBlockHeader (start, CCN_DTAG_Timestamp, CCN_DTAG); // <Timestamp>...
124 written += CCNB::AppendTimestampBlob (start, GetSignedInfo ().GetTimestamp ());
125 written += CCNB::AppendCloser (start);
126
127 if (GetSignedInfo ().GetContentType () != DATA)
128 {
129 uint8_t type[3];
130 type[0] = (GetSignedInfo ().GetContentType () >> 16) & 0xFF;
131 type[1] = (GetSignedInfo ().GetContentType () >> 8 ) & 0xFF;
132 type[2] = (GetSignedInfo ().GetContentType () ) & 0xFF;
133
134 written += CCNB::AppendTaggedBlob (start, CCN_DTAG_Type, type, 3);
135 }
Alexander Afanasyevfaf95812012-06-05 21:28:11 -0700136 if (GetSignedInfo ().GetFreshness () > Seconds(0))
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700137 {
138 written += CCNB::AppendBlockHeader (start, CCN_DTAG_FreshnessSeconds, CCN_DTAG);
139 written += CCNB::AppendNumber (start, GetSignedInfo ().GetFreshness ().ToInteger (Time::S));
140 written += CCNB::AppendCloser (start);
141 }
Alexander Afanasyevfaf95812012-06-05 21:28:11 -0700142 if (GetSignedInfo ().GetKeyLocator () != 0)
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700143 {
144 written += CCNB::AppendBlockHeader (start, CCN_DTAG_KeyLocator, CCN_DTAG); // <KeyLocator>
145 {
146 written += CCNB::AppendBlockHeader (start, CCN_DTAG_KeyName, CCN_DTAG); // <KeyName>
147 {
148 written += CCNB::AppendBlockHeader (start, CCN_DTAG_Name, CCN_DTAG); // <Name>
149 written += CCNB::AppendNameComponents (start, GetName()); // <Component>...</Component>...
150 written += CCNB::AppendCloser (start); // </Name>
151 }
152 written += CCNB::AppendCloser (start); // </KeyName>
153 }
154 written += CCNB::AppendCloser (start); // </KeyLocator>
155 }
156
157 written += CCNB::AppendCloser (start); // </SignedInfo>
158
159 written += CCNB::AppendBlockHeader (start, CCN_DTAG_Content, CCN_DTAG); // <Content>
160
161 // there are no closing tags !!!
162 // The closing tag is handled by CcnxContentObjectTail
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700163}
164
165uint32_t
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700166CcnxContentObjectHeader::GetSerializedSize () const
167{
168 size_t written = 0;
169 written += CCNB::EstimateBlockHeader (CCN_DTAG_ContentObject); // <ContentObject>
170
171 // fake signature
172 written += CCNB::EstimateBlockHeader (CCN_DTAG_Signature); // <Signature>
173 // Signature ::= DigestAlgorithm?
174 // Witness?
175 // SignatureBits
176 if (GetSignature ().GetDigestAlgorithm () != Signature::DefaultDigestAlgorithm)
177 {
178 written += CCNB::EstimateString (CCN_DTAG_DigestAlgorithm, GetSignature ().GetDigestAlgorithm ());
179 }
180 written += CCNB::EstimateTaggedBlob (CCN_DTAG_SignatureBits,
181 sizeof (GetSignature ().GetSignatureBits ())); // <SignatureBits />
182 written += 1; // </Signature>
183
184 written += CCNB::EstimateBlockHeader (CCN_DTAG_Name); // <Name>
185 written += CCNB::EstimateNameComponents (GetName()); // <Component>...</Component>...
186 written += 1; // </Name>
187
188 // fake signature
189 written += CCNB::EstimateBlockHeader (CCN_DTAG_SignedInfo); // <SignedInfo>
190 // SignedInfo ::= √PublisherPublicKeyDigest
191 // √Timestamp
192 // √Type?
193 // √FreshnessSeconds?
194 // FinalBlockID?
195 // KeyLocator?
196
197 written += CCNB::EstimateTaggedBlob (CCN_DTAG_PublisherPublicKeyDigest, // <PublisherPublicKeyDigest>...
198 sizeof (GetSignedInfo ().GetPublisherPublicKeyDigest ()));
199
200 written += CCNB::EstimateBlockHeader (CCN_DTAG_Timestamp); // <Timestamp>...
201 written += CCNB::EstimateTimestampBlob (GetSignedInfo ().GetTimestamp ());
202 written += 1;
203
204 if (GetSignedInfo ().GetContentType () != DATA)
205 {
206 written += CCNB::EstimateTaggedBlob (CCN_DTAG_Type, 3);
207 }
Alexander Afanasyevfaf95812012-06-05 21:28:11 -0700208 if (GetSignedInfo ().GetFreshness () > Seconds(0))
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700209 {
210 written += CCNB::EstimateBlockHeader (CCN_DTAG_FreshnessSeconds);
211 written += CCNB::EstimateNumber (GetSignedInfo ().GetFreshness ().ToInteger (Time::S));
212 written += 1;
213 }
214
Alexander Afanasyevfaf95812012-06-05 21:28:11 -0700215 if (GetSignedInfo ().GetKeyLocator () != 0)
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700216 {
217 written += CCNB::EstimateBlockHeader (CCN_DTAG_KeyLocator); // <KeyLocator>
218 {
219 written += CCNB::EstimateBlockHeader (CCN_DTAG_KeyName); // <KeyName>
220 {
221 written += CCNB::EstimateBlockHeader (CCN_DTAG_Name); // <Name>
222 written += CCNB::EstimateNameComponents (GetName()); // <Component>...</Component>...
223 written += 1; // </Name>
224 }
225 written += 1; // </KeyName>
226 }
227 written += 1; // </KeyLocator>
228 }
229
230 written += 1; // </SignedInfo>
231
232 written += CCNB::EstimateBlockHeader (CCN_DTAG_Content); // <Content>
233
234 // there are no closing tags !!!
235 // The closing tag is handled by CcnxContentObjectTail
236 return written;
237}
238#undef CCNB
239
240class ContentObjectVisitor : public VoidDepthFirstVisitor
241{
242public:
243 virtual void visit (Dtag &n, boost::any param/*should be CcnxContentObjectHeader* */)
244 {
245 // uint32_t n.m_dtag;
246 // std::list<Ptr<Block> > n.m_nestedBlocks;
247 static NameComponentsVisitor nameComponentsVisitor;
248 static NonNegativeIntegerVisitor nonNegativeIntegerVisitor;
249 static TimestampVisitor timestampVisitor;
250 static StringVisitor stringVisitor;
251 static Uint32tBlobVisitor uint32tBlobVisitor;
252 static ContentTypeVisitor contentTypeVisitor;
253
254 CcnxContentObjectHeader &contentObject = *(boost::any_cast<CcnxContentObjectHeader*> (param));
255
256 switch (n.m_dtag)
257 {
258 case CCN_DTAG_ContentObject:
259 // process nested blocks
260 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
261 {
262 block->accept (*this, param);
263 }
264 break;
265 case CCN_DTAG_Name:
266 {
267 // process name components
268 Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
269
270 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
271 {
272 block->accept (nameComponentsVisitor, &(*name));
273 }
274 contentObject.SetName (name);
275 break;
276 }
277
278 case CCN_DTAG_Signature:
279 // process nested blocks
280 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
281 {
282 block->accept (*this, param);
283 }
284 break;
285
286 case CCN_DTAG_DigestAlgorithm:
287 NS_LOG_DEBUG ("DigestAlgorithm");
288 if (n.m_nestedTags.size ()!=1) // should be exactly one UDATA inside this tag
289 throw CcnbDecodingException ();
290
291 contentObject.GetSignature ().SetDigestAlgorithm
292 (boost::any_cast<std::string> ((*n.m_nestedTags.begin())->accept
293 (stringVisitor)));
294 break;
295
296 case CCN_DTAG_SignatureBits:
297 NS_LOG_DEBUG ("SignatureBits");
298 if (n.m_nestedTags.size ()!=1) // should be only one nested tag
299 throw CcnbDecodingException ();
300
301 contentObject.GetSignature ().SetSignatureBits
302 (boost::any_cast<uint32_t> ((*n.m_nestedTags.begin())->accept
303 (uint32tBlobVisitor)));
304 break;
305
306 case CCN_DTAG_SignedInfo:
307 // process nested blocks
308 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
309 {
310 block->accept (*this, param);
311 }
312 break;
313
314 case CCN_DTAG_PublisherPublicKeyDigest:
315 NS_LOG_DEBUG ("PublisherPublicKeyDigest");
316 if (n.m_nestedTags.size ()!=1) // should be only one nested tag
317 throw CcnbDecodingException ();
318
319 contentObject.GetSignedInfo ().SetPublisherPublicKeyDigest
320 (boost::any_cast<uint32_t> ((*n.m_nestedTags.begin())->accept
321 (uint32tBlobVisitor)));
322 break;
323
324 case CCN_DTAG_Timestamp:
325 NS_LOG_DEBUG ("Timestamp");
326 if (n.m_nestedTags.size()!=1) // should be exactly one nested tag
327 throw CcnbDecodingException ();
328
329 contentObject.GetSignedInfo ().SetTimestamp
330 (boost::any_cast<Time> ((*n.m_nestedTags.begin())->accept
331 (timestampVisitor)));
332 break;
333
334 case CCN_DTAG_Type:
335 NS_LOG_DEBUG ("Type");
336 if (n.m_nestedTags.size ()!=1) // should be only one nested tag
337 throw CcnbDecodingException ();
338
339 contentObject.GetSignedInfo ().SetContentType
340 (static_cast<CcnxContentObjectHeader::ContentType>
341 (boost::any_cast<uint32_t> ((*n.m_nestedTags.begin())->accept
342 (contentTypeVisitor))));
343 break;
344
345 case CCN_DTAG_FreshnessSeconds:
346 NS_LOG_DEBUG ("FreshnessSeconds");
347
348 if (n.m_nestedTags.size()!=1) // should be exactly one nested tag
349 throw CcnbDecodingException ();
350
351 contentObject.GetSignedInfo ().SetFreshness
352 (Seconds
353 (boost::any_cast<uint32_t> ((*n.m_nestedTags.begin())->accept
354 (nonNegativeIntegerVisitor))));
355 break;
356
357 case CCN_DTAG_KeyLocator:
358 // process nested blocks
359 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
360 {
361 block->accept (*this, param);
362 }
363 break;
364
365 case CCN_DTAG_KeyName:
366 {
367 if (n.m_nestedTags.size ()!=1) // should be exactly one nested tag
368 throw CcnbDecodingException ();
369
370 Ptr<BaseTag> nameTag = DynamicCast<BaseTag>(n.m_nestedTags.front ());
371 if (nameTag == 0)
372 throw CcnbDecodingException ();
373
374 // process name components
375 Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
376
377 BOOST_FOREACH (Ptr<Block> block, nameTag->m_nestedTags)
378 {
379 block->accept (nameComponentsVisitor, &(*name));
380 }
381 contentObject.GetSignedInfo ().SetKeyLocator (name);
382 break;
383 }
384
385 case CCN_DTAG_Content: // !!! HACK
386 // This hack was necessary for memory optimizations (i.e., content is virtual payload)
387 NS_ASSERT_MSG (n.m_nestedTags.size() == 0, "Parser should have stopped just after processing <Content> tag");
388 break;
389
390 default: // ignore all other stuff
391 break;
392 }
393 }
394};
395
396uint32_t
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700397CcnxContentObjectHeader::Deserialize (Buffer::Iterator start)
398{
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700399 static ContentObjectVisitor contentObjectVisitor;
400
401 Buffer::Iterator i = start;
402 Ptr<CcnbParser::Block> root = CcnbParser::Block::ParseBlock (i);
403 root->accept (contentObjectVisitor, this);
404
405 return i.GetDistanceFrom (start);
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700406}
407
408TypeId
409CcnxContentObjectHeader::GetInstanceTypeId (void) const
410{
411 return GetTypeId ();
412}
413
414void
415CcnxContentObjectHeader::Print (std::ostream &os) const
416{
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700417 os << "D: " << GetName ();
418 // os << "<ContentObject><Name>" << GetName () << "</Name><Content>";
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700419}
420
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700421////////////////////////////////////////////////////////////////////////////////////////////////////
422
423CcnxContentObjectTail::CcnxContentObjectTail ()
424{
425}
426
427TypeId
428CcnxContentObjectTail::GetTypeId (void)
429{
Alexander Afanasyev834f35c2011-08-16 17:13:50 -0700430 static TypeId tid = TypeId ("ns3::CcnxContentObjectTail")
Alexander Afanasyeve91ab752011-08-31 19:13:40 -0700431 .SetParent<Trailer> ()
432 .AddConstructor<CcnxContentObjectTail> ()
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700433 ;
434 return tid;
435}
436
437TypeId
438CcnxContentObjectTail::GetInstanceTypeId (void) const
439{
440 return GetTypeId ();
441}
442
443void
444CcnxContentObjectTail::Print (std::ostream &os) const
445{
446 os << "</Content></ContentObject>";
447}
448
449uint32_t
450CcnxContentObjectTail::GetSerializedSize (void) const
451{
452 return 2;
453}
454
455void
456CcnxContentObjectTail::Serialize (Buffer::Iterator start) const
457{
458 Buffer::Iterator i = start;
Alexander Afanasyeve91ab752011-08-31 19:13:40 -0700459 i.Prev (2); // Trailer interface requires us to go backwards
460
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700461 i.WriteU8 (0x00); // </Content>
462 i.WriteU8 (0x00); // </ContentObject>
463}
464
465uint32_t
466CcnxContentObjectTail::Deserialize (Buffer::Iterator start)
467{
468 Buffer::Iterator i = start;
Alexander Afanasyeve91ab752011-08-31 19:13:40 -0700469 i.Prev (2); // Trailer interface requires us to go backwards
470
Alexander Afanasyevd9fecdd2012-06-08 16:22:24 -0700471 uint8_t closing_tag_content = i.ReadU8 ();
Alexander Afanasyev834f35c2011-08-16 17:13:50 -0700472 NS_ASSERT_MSG (closing_tag_content==0, "Should be a closing tag </Content> (0x00)");
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700473
Alexander Afanasyevd9fecdd2012-06-08 16:22:24 -0700474 uint8_t closing_tag_content_object = i.ReadU8 ();
Alexander Afanasyev834f35c2011-08-16 17:13:50 -0700475 NS_ASSERT_MSG (closing_tag_content_object==0, "Should be a closing tag </ContentObject> (0x00)");
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700476
477 return 2;
478}
Alexander Afanasyev8c5046a2012-06-05 16:22:14 -0700479
480///////////////////////////////////////////////////////////////////////
481///////////////////////////////////////////////////////////////////////
482///////////////////////////////////////////////////////////////////////
483
484CcnxContentObjectHeader::SignedInfo::SignedInfo ()
485 : m_publisherPublicKeyDigest (0)
486 // , m_timestamp
487 , m_type (DATA)
488 // , m_freshness
489 // , FinalBlockID
490 // , KeyLocator
491{
492}
493
494void
495CcnxContentObjectHeader::SignedInfo::SetPublisherPublicKeyDigest (uint32_t digest)
496{
497 m_publisherPublicKeyDigest = digest;
498}
499
500uint32_t
501CcnxContentObjectHeader::SignedInfo::GetPublisherPublicKeyDigest () const
502{
503 return m_publisherPublicKeyDigest;
504}
505
506void
507CcnxContentObjectHeader::SignedInfo::SetTimestamp (const Time &timestamp)
508{
509 m_timestamp = timestamp;
510}
511
512Time
513CcnxContentObjectHeader::SignedInfo::GetTimestamp () const
514{
515 return m_timestamp;
516}
517
518void
519CcnxContentObjectHeader::SignedInfo::SetContentType (CcnxContentObjectHeader::ContentType type)
520{
521 m_type = type;
522}
523
524CcnxContentObjectHeader::ContentType
525CcnxContentObjectHeader::SignedInfo::GetContentType () const
526{
527 return m_type;
528}
529
530void
531CcnxContentObjectHeader::SignedInfo::SetFreshness (const Time &freshness)
532{
533 m_freshness = freshness;
534}
535
536Time
537CcnxContentObjectHeader::SignedInfo::GetFreshness () const
538{
539 return m_freshness;
540}
541
542void
543CcnxContentObjectHeader::SignedInfo::SetKeyLocator (Ptr<const CcnxNameComponents> keyLocator)
544{
545 m_keyLocator = keyLocator;
546}
547
548Ptr<const CcnxNameComponents>
549CcnxContentObjectHeader::SignedInfo::GetKeyLocator () const
550{
551 return m_keyLocator;
552}
553
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700554} // namespace ns3