blob: 65a84f5eb129bd43febf1c338a721ed4dd9bdc30 [file] [log] [blame]
Alexander Afanasyev8b379052011-08-21 16:58:20 -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 _CCNB_PARSER_DTAG_H_
22#define _CCNB_PARSER_DTAG_H_
23
24#include "ccnb-parser-base-tag.h"
25
26namespace ns3 {
27namespace CcnbParser {
28
29/**
30 * \ingroup ccnx-ccnb
31 * \brief Class to represent DTAG ccnb-encoded node
32 *
33 * \see http://www.ccnx.org/releases/latest/doc/technical/BinaryEncoding.html
34 */
35class Dtag : public BaseTag
36{
37public:
38 /**
39 * \brief Constructor that actually parsed ccnb-encoded DTAG block
40 *
41 * \param start buffer iterator pointing to the first nesting block or closing tag
42 * \param dtag dictionary code of DTAG (extracted from the value field)
43 *
44 * DTAG parsing is slightly hacked to provide memory optimization
45 * for NS-3 simulations. Parsing will be stopped after encountering
46 * <Content> dtag. Actual content (including virtual payload) will
47 * be stored in Packet buffer
48 *
49 * \see http://www.ccnx.org/releases/latest/doc/technical/BinaryEncoding.html
50 */
51 Dtag (Buffer::Iterator &start, uint32_t dtag);
52
53 virtual void accept( Visitor &v ) { v.visit( *this ); }
54 virtual void accept( GJVoidVisitor &v, boost::any param ) { v.visit( *this, param ); }
55 virtual boost::any accept( GJNoArguVisitor &v ) { return v.visit( *this ); }
56 virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
57
58 uint32_t m_dtag; ///< \brief Dictionary code for DTAG
59};
60
61}
62}
63
64#endif // _CCNB_PARSER_DTAG_H_