documentation
diff --git a/helper/ccnx-consumer-helper.cc b/helper/ccnx-consumer-helper.cc
index f6fcb7c..d41de22 100644
--- a/helper/ccnx-consumer-helper.cc
+++ b/helper/ccnx-consumer-helper.cc
@@ -31,51 +31,50 @@
CcnxConsumerHelper::CcnxConsumerHelper (const std::string &prefix)
{
- m_factory.SetTypeId ("ns3::CcnxConsumer");
+ m_factory.SetTypeId ("ns3::CcnxConsumer");
- CcnxNameComponentsValue prefixValue;
- prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
- m_factory.Set ("InterestName", prefixValue);
+ CcnxNameComponentsValue prefixValue;
+ prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
+ m_factory.Set ("InterestName", prefixValue);
}
void
CcnxConsumerHelper::SetAttribute (std::string name, const AttributeValue &value)
{
- m_factory.Set (name, value);
+ m_factory.Set (name, value);
}
ApplicationContainer
CcnxConsumerHelper::Install (Ptr<Node> node)
{
- return ApplicationContainer (InstallPriv (node));
+ return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
CcnxConsumerHelper::Install (std::string nodeName)
{
- Ptr<Node> node = Names::Find<Node> (nodeName);
- return ApplicationContainer (InstallPriv (node));
+ Ptr<Node> node = Names::Find<Node> (nodeName);
+ return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
CcnxConsumerHelper::Install (NodeContainer c)
{
- ApplicationContainer apps;
- for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
+ ApplicationContainer apps;
+ for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
- apps.Add (InstallPriv (*i));
+ apps.Add (InstallPriv (*i));
}
- return apps;
+ return apps;
}
Ptr<Application>
CcnxConsumerHelper::InstallPriv (Ptr<Node> node)
{
- Ptr<CcnxConsumer> app = m_factory.Create<CcnxConsumer> ();
- node->AddApplication (app);
+ Ptr<CcnxConsumer> app = m_factory.Create<CcnxConsumer> ();
+ node->AddApplication (app);
- return app;
+ return app;
}
-
}
diff --git a/helper/ccnx-decoding-helper.cc b/helper/ccnx-decoding-helper.cc
index 4d4695c..ee3f084 100644
--- a/helper/ccnx-decoding-helper.cc
+++ b/helper/ccnx-decoding-helper.cc
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Author:
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "ccnx-decoding-helper.h"
diff --git a/helper/ccnx-decoding-helper.h b/helper/ccnx-decoding-helper.h
index 8ebfcc5..015b7ff 100644
--- a/helper/ccnx-decoding-helper.h
+++ b/helper/ccnx-decoding-helper.h
@@ -35,15 +35,24 @@
class CcnxDecodingHelper
{
public:
+ /**
+ * \brief Deserialize Buffer::Iterator to CcnxInterestHeader
+ * @param start Buffer containing serialized CCNx message
+ * @param interest Pointer to the CcnxInterestHeader to hold deserialized value
+ * @return Number of bytes used for deserialization
+ */
static size_t
Deserialize (Buffer::Iterator start, CcnxInterestHeader &interest);
+ /**
+ * \brief Deserialize Buffer::Iterator to CcnxContentObjectHeader
+ * @param start Buffer containing serialized CCNx message
+ * @param contentObject Pointer to the CcnxContentObjectHeader to hold deserialized value
+ * @return Number of bytes used for deserialization
+ */
static size_t
Deserialize (Buffer::Iterator start, CcnxContentObjectHeader &contentObject);
-
-private:
};
-
} // namespace ns3
#endif // _CCNX_DECODING_HELPER_H_
diff --git a/helper/ccnx-encoding-helper.cc b/helper/ccnx-encoding-helper.cc
index 15757fc..e63c67c 100644
--- a/helper/ccnx-encoding-helper.cc
+++ b/helper/ccnx-encoding-helper.cc
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Author:
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "ccnx-encoding-helper.h"
diff --git a/helper/ccnx-encoding-helper.h b/helper/ccnx-encoding-helper.h
index acce922..e4fe45d 100644
--- a/helper/ccnx-encoding-helper.h
+++ b/helper/ccnx-encoding-helper.h
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Author:
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef _CCNX_ENCODING_HELPER_H_
@@ -36,15 +36,26 @@
class CcnxContentObjectHeader;
/**
- * Helper to encode/decode ccnb formatted CCNx message
+ * \brief Helper to encode/decode ccnb formatted CCNx message
*
*/
class CcnxEncodingHelper
{
public:
+ /**
+ * \brief Serialize CcnxInterestHeader to Buffer::Iterator
+ * @param start Buffer to store serialized CcnxInterestHeader
+ * @param interest Pointer to CcnxInterestHeader to be serialized
+ * @return length of serialized CcnxInterestHeader
+ */
static size_t
Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest);
+ /**
+ * \brief Compute the size of serialized CcnxInterestHeader
+ * @param interest Pointer to CcnxInterestHeader
+ * @return length
+ */
static size_t
GetSerializedSize (const CcnxInterestHeader &interest);
diff --git a/helper/ccnx-producer-helper.cc b/helper/ccnx-producer-helper.cc
index 2bf369b..ec44aca 100644
--- a/helper/ccnx-producer-helper.cc
+++ b/helper/ccnx-producer-helper.cc
@@ -32,89 +32,54 @@
CcnxProducerHelper::CcnxProducerHelper (const std::string &prefix, uint32_t virtualPayloadSize)
{
- m_factory.SetTypeId ("ns3::CcnxProducer");
+ m_factory.SetTypeId ("ns3::CcnxProducer");
- CcnxNameComponentsValue prefixValue;
- prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
- m_factory.Set ("Prefix", prefixValue);
+ CcnxNameComponentsValue prefixValue;
+ prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
+ m_factory.Set ("Prefix", prefixValue);
- m_factory.Set ("PayloadSize", UintegerValue (virtualPayloadSize));
+ m_factory.Set ("PayloadSize", UintegerValue (virtualPayloadSize));
}
void
CcnxProducerHelper::SetAttribute (std::string name, const AttributeValue &value)
{
- m_factory.Set (name, value);
+ m_factory.Set (name, value);
}
ApplicationContainer
CcnxProducerHelper::Install (Ptr<Node> node)
{
- NS_LOG_FUNCTION(this);
- return ApplicationContainer (InstallPriv (node));
+ NS_LOG_FUNCTION(this);
+ return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
CcnxProducerHelper::Install (std::string nodeName)
{
- Ptr<Node> node = Names::Find<Node> (nodeName);
- return ApplicationContainer (InstallPriv (node));
+ Ptr<Node> node = Names::Find<Node> (nodeName);
+ return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
CcnxProducerHelper::Install (NodeContainer c)
{
- ApplicationContainer apps;
- for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
+ ApplicationContainer apps;
+ for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
- apps.Add (InstallPriv (*i));
+ apps.Add (InstallPriv (*i));
}
- return apps;
+ return apps;
}
-
- /*CcnxStackHelper::CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId)
- {
- ObjectFactory factory;
- factory.SetTypeId (typeId);
- Ptr<Object> protocol = factory.Create <Object> ();
- node->AggregateObject (protocol);
- }*/
+
Ptr<Application>
CcnxProducerHelper::InstallPriv (Ptr<Node> node)
{
- NS_LOG_INFO ("InstallPriv started");
- Ptr<CcnxProducer> app = m_factory.Create<CcnxProducer> ();
- node->AddApplication (app);
-
- /*Ptr<CcnxLocalFace> localFace = Create<CcnxLocalFace> ();
- localFace->SetNode(node);
+ NS_LOG_INFO ("InstallPriv started");
+ Ptr<CcnxProducer> app = m_factory.Create<CcnxProducer> ();
+ node->AddApplication (app);
- //CreateAndAggregateObjectFromTypeId (node, "ns3::CcnxL3Protocol");
- ObjectFactory factory;
- factory.SetTypeId("ns3::CcnxL3Protocol");
- Ptr<Object> protocol = factory.Create<Object> ();
- node->AggregateObject(protocol);
-
- Ptr<Ccnx> ccnx = node->GetObject<Ccnx> ();
-
- if (ccnx == NULL)
- {
- NS_FATAL_ERROR ("CcnxProducerHelper::InstallPriv (): Getting Ccnx "
- "a CcnxStack must be installed on the node");
- return 0;
- }
-
- // m_factory.Set ("Face", PointerValue (localFace));
- m_factory.Set ("Ccnx", PointerValue (ccnx));
- Ptr<CcnxProducer> app = m_factory.Create<CcnxProducer> ();
-
- //app->m_ccnx->m_contentStore->SetMaxSize(app->GetStoreCapacity());
- localFace->RegisterProtocolHandler (MakeCallback (&CcnxProducer::HandlePacket, app));
- localFace->SetUp();
-
- node->AddApplication (app);*/
-
- return app;
+ return app;
}
}
diff --git a/helper/ccnx-producer-helper.h b/helper/ccnx-producer-helper.h
index 31f76da..eaa3665 100644
--- a/helper/ccnx-producer-helper.h
+++ b/helper/ccnx-producer-helper.h
@@ -39,60 +39,59 @@
class CcnxProducerHelper
{
public:
-/**
-* Create an CcnxProducerHelper to make it easier to work with CcnxProducer applications
-*
-*/
-CcnxProducerHelper (const std::string &prefix, uint32_t virtualPayloadSize);
+ /**
+ * Create an CcnxProducerHelper to make it easier to work with CcnxProducer applications
+ *
+ */
+ CcnxProducerHelper (const std::string &prefix, uint32_t virtualPayloadSize);
-/**
-* Helper function used to set the underlying application attributes.
-*
-* \param name the name of the application attribute to set
-* \param value the value of the application attribute to set
-*/
-void SetAttribute (std::string name, const AttributeValue &value);
+ /**
+ * Helper function used to set the underlying application attributes.
+ *
+ * \param name the name of the application attribute to set
+ * \param value the value of the application attribute to set
+ */
+ void SetAttribute (std::string name, const AttributeValue &value);
-/**
-* Install an ns3::CcnxProducer on each node of the input container
-* configured with all the attributes set with SetAttribute.
-*
-* \param c NodeContainer of the set of nodes on which an CcnxProducer
-* will be installed.
-* \returns Container of Ptr to the applications installed.
-*/
-ApplicationContainer Install (NodeContainer c);
+ /**
+ * Install an ns3::CcnxProducer on each node of the input container
+ * configured with all the attributes set with SetAttribute.
+ *
+ * \param c NodeContainer of the set of nodes on which an CcnxProducer
+ * will be installed.
+ * \returns Container of Ptr to the applications installed.
+ */
+ ApplicationContainer Install (NodeContainer c);
-/**
-* Install an ns3::CcnxProducer on the node configured with all the
-* attributes set with SetAttribute.
-*
-* \param node The node on which an CcnxProducer will be installed.
-* \returns Container of Ptr to the applications installed.
-*/
-ApplicationContainer Install (Ptr<Node> node);
+ /**
+ * Install an ns3::CcnxProducer on the node configured with all the
+ * attributes set with SetAttribute.
+ *
+ * \param node The node on which an CcnxProducer will be installed.
+ * \returns Container of Ptr to the applications installed.
+ */
+ ApplicationContainer Install (Ptr<Node> node);
-/**
-* Install an ns3::CcnxProducer on the node configured with all the
-* attributes set with SetAttribute.
-*
-* \param nodeName The node on which an CcnxProducer will be installed.
-* \returns Container of Ptr to the applications installed.
-*/
-ApplicationContainer Install (std::string nodeName);
+ /**
+ * Install an ns3::CcnxProducer on the node configured with all the
+ * attributes set with SetAttribute.
+ *
+ * \param nodeName The node on which an CcnxProducer will be installed.
+ * \returns Container of Ptr to the applications installed.
+ */
+ ApplicationContainer Install (std::string nodeName);
private:
-/**
-* \internal
-* Install an ns3::CcnxProducer on the node configured with all the
-* attributes set with SetAttribute.
-*
-* \param node The node on which an CcnxProducer will be installed.
-* \returns Ptr to the application installed.
-*/
-Ptr<Application> InstallPriv (Ptr<Node> node);
-ObjectFactory m_factory;
-
+ /**
+ * \internal
+ * Install an ns3::CcnxProducer on the node configured with all the
+ * attributes set with SetAttribute.
+ *
+ * \param node The node on which an CcnxProducer will be installed.
+ * \returns Ptr to the application installed.
+ */
+ Ptr<Application> InstallPriv (Ptr<Node> node);
+ ObjectFactory m_factory;
};
}