blob: 2d71733c1dde2b488af7ec7538ebe8182f1c2e4a [file] [log] [blame]
//
// ndn_contentpacket.cpp
// Abstraction
//
// Copyright 2011 UCLA. All rights reserved.
//
#include "ndn_contentpacket.h"
namespace ns3
{
namespace NDNabstraction
{
ContentPacket::ContentPacket(const struct ccn_charbuf *Name,const void *data,size_t size)
: Packet()
{
ccn_charbuf *output = ccn_charbuf_create();
int result = ccn_encode_ContentObject(output,Name,data,size);
if(result>=0)
{
Ptr<Packet> p = Create<Packet> (output->buf, (uint32_t)output->length);
this->AddAtEnd (p);
}
}
}
}