blob: 9e1f5ef617a04823e230c6415b89205a23b616ba [file] [log] [blame]
Alexander Afanasyev4aac5572012-08-09 10:49:55 -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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#ifndef _NDN_DECODING_HELPER_H_
22#define _NDN_DECODING_HELPER_H_
23
24#include <cstring>
25#include "ns3/buffer.h"
26
27namespace ns3 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070028namespace ndn {
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070029
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070030class InterestHeader;
31class ContentObjectHeader;
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070032
33/**
34 * \brief Helper class to decode ccnb formatted Ndn message
35 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070036class DecodingHelper
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070037{
38public:
39 /**
40 * \brief Deserialize Buffer::Iterator to NdnInterestHeader
41 * @param start Buffer containing serialized Ndn message
42 * @param interest Pointer to the NdnInterestHeader to hold deserialized value
43 * @return Number of bytes used for deserialization
44 */
45 static size_t
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070046 Deserialize (Buffer::Iterator start, InterestHeader &interest);
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070047
48 /**
49 * \brief Deserialize Buffer::Iterator to NdnContentObjectHeader
50 * @param start Buffer containing serialized Ndn message
51 * @param contentObject Pointer to the NdnContentObjectHeader to hold deserialized value
52 * @return Number of bytes used for deserialization
53 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070054 // static size_t
55 // Deserialize (Buffer::Iterator start, ContentObjectHeader &contentObject);
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070056};
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070057
58} // namespace ndn
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070059} // namespace ns3
60
61#endif // _NDN_DECODING_HELPER_H_