Adding more doxygen documentation
diff --git a/model/ccnx-content-object-header.h b/model/ccnx-content-object-header.h
index a7bad01..5040dba 100644
--- a/model/ccnx-content-object-header.h
+++ b/model/ccnx-content-object-header.h
@@ -68,18 +68,33 @@
*/
inline Signature ();
+ /**
+ * @brief Get digest algorithm
+ */
inline const std::string &
GetDigestAlgorithm () const;
+ /**
+ * @brief Set digest algorithm
+ */
inline void
SetDigestAlgorithm (const std::string &digestAlgorithm);
+ /**
+ * @brief Get signature bits
+ */
inline uint32_t
GetSignatureBits () const;
+ /**
+ * @brief Set signature bits
+ */
inline void
SetSignatureBits (uint32_t signatureBits);
+ /**
+ * @brief Default digest algorithm ("2.16.840.1.101.3.4.2.1")
+ */
static const std::string DefaultDigestAlgorithm; // = "2.16.840.1.101.3.4.2.1";
private:
@@ -93,6 +108,9 @@
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
+ /**
+ * @brief Options for the data packet Type
+ */
enum ContentType
{
DATA = 0x0C04C0, // default value. If ContentObject is type of DATA, then ContentType tag will be omitted
@@ -250,12 +268,12 @@
//////////////////////////////////////////////////////////////////
- static TypeId GetTypeId (void);
- virtual TypeId GetInstanceTypeId (void) const;
- virtual void Print (std::ostream &os) const;
- virtual uint32_t GetSerializedSize (void) const;
- virtual void Serialize (Buffer::Iterator start) const;
- virtual uint32_t Deserialize (Buffer::Iterator start);
+ static TypeId GetTypeId (void); ///< @brief Get TypeId
+ virtual TypeId GetInstanceTypeId (void) const; ///< @brief Get TypeId of the instance
+ virtual void Print (std::ostream &os) const; ///< @brief Print out information about the Header into the stream
+ virtual uint32_t GetSerializedSize (void) const; ///< @brief Get size necessary to serialize the Header
+ virtual void Serialize (Buffer::Iterator start) const; ///< @brief Serialize the Header
+ virtual uint32_t Deserialize (Buffer::Iterator start); ///< @brief Deserialize the Header
private:
Signature m_signature;
@@ -273,12 +291,12 @@
CcnxContentObjectTail ();
//////////////////////////////////////////////////////////////////
- static TypeId GetTypeId (void);
- virtual TypeId GetInstanceTypeId (void) const;
- virtual void Print (std::ostream &os) const;
- virtual uint32_t GetSerializedSize (void) const;
- virtual void Serialize (Buffer::Iterator start) const;
- virtual uint32_t Deserialize (Buffer::Iterator start);
+ static TypeId GetTypeId (void); ///< @brief Get TypeId
+ virtual TypeId GetInstanceTypeId (void) const; ///< @brief Get TypeId of the instance
+ virtual void Print (std::ostream &os) const; ///< @brief Print out information about Tail into the stream
+ virtual uint32_t GetSerializedSize (void) const; ///< @brief Get size necessary to serialize the Tail
+ virtual void Serialize (Buffer::Iterator start) const; ///< @brief Serialize the Tail
+ virtual uint32_t Deserialize (Buffer::Iterator start); ///< @brief Deserialize the Tail
};
@@ -337,6 +355,9 @@
return m_signedInfo;
}
+/**
+ * @brief Class for ContentObject parsing exception
+ */
class CcnxContentObjectHeaderException {};
} // namespace ns3
diff --git a/model/ccnx-content-store.h b/model/ccnx-content-store.h
index 9095223..6c0e876 100644
--- a/model/ccnx-content-store.h
+++ b/model/ccnx-content-store.h
@@ -121,6 +121,7 @@
*/
struct CcnxContentStoreContainer
{
+ /// @cond include_hidden
typedef
boost::multi_index::multi_index_container<
CcnxContentStoreEntry,
@@ -143,6 +144,7 @@
#endif
>
> type;
+ /// @endcond
};
/**
diff --git a/model/ccnx-face.h b/model/ccnx-face.h
index ad8ca80..8bae198 100644
--- a/model/ccnx-face.h
+++ b/model/ccnx-face.h
@@ -68,6 +68,9 @@
CcnxFace (Ptr<Node> node);
virtual ~CcnxFace();
+ /**
+ * @brief Get node to which this face is associated
+ */
Ptr<Node>
GetNode () const;
@@ -143,7 +146,11 @@
*/
virtual bool
IsUp () const;
-
+
+ /**
+ * @brief Print information about the face into the stream
+ * @param os stream to write information to
+ */
virtual std::ostream&
Print (std::ostream &os) const;
diff --git a/model/ccnx-fib.h b/model/ccnx-fib.h
index e9474d0..7c2c6af 100644
--- a/model/ccnx-fib.h
+++ b/model/ccnx-fib.h
@@ -50,6 +50,9 @@
class CcnxFibFaceMetric
{
public:
+ /**
+ * @brief Color codes for FIB face status
+ */
enum Status { NDN_FIB_GREEN = 1,
NDN_FIB_YELLOW = 2,
NDN_FIB_RED = 3 };
@@ -74,9 +77,15 @@
bool
operator< (const CcnxFibFaceMetric &fm) const { return *m_face < *fm.m_face; } // return identity of the face
+ /**
+ * @brief Comparison between CcnxFibFaceMetric and CcnxFace
+ */
bool
operator< (const Ptr<CcnxFace> &face) const { return *m_face < *face; }
+ /**
+ * @brief Return CcnxFace associated with CcnxFibFaceMetric
+ */
Ptr<CcnxFace>
GetFace () const { return m_face; }
@@ -115,6 +124,7 @@
*/
struct CcnxFibFaceMetricContainer
{
+ /// @cond include_hidden
typedef boost::multi_index::multi_index_container<
CcnxFibFaceMetric,
boost::multi_index::indexed_by<
@@ -140,6 +150,7 @@
>
>
> type;
+ /// @endcond
};
/**
@@ -150,7 +161,7 @@
class CcnxFibEntry // : public SimpleRefCount<CcnxFibEntry>
{
public:
- class NoFaces {};
+ class NoFaces {}; ///< @brief Exception class for the case when FIB entry is not found
/**
* \brief Constructor
@@ -233,6 +244,7 @@
*/
struct CcnxFibEntryContainer
{
+ /// @cond include_hidden
typedef boost::multi_index::multi_index_container<
CcnxFibEntry,
boost::multi_index::indexed_by<
@@ -249,6 +261,7 @@
>
>
> type;
+ /// @endcond
};
/**
@@ -269,7 +282,6 @@
* \brief Constructor
*/
CcnxFib ();
- // * \param node smart pointer to Ccnx stack associated with particular node
/**
* \brief Perform longest prefix match
@@ -363,12 +375,12 @@
GetCcnxFibEntry (uint32_t index);
public:
- CcnxFibEntryContainer::type m_fib;
+ CcnxFibEntryContainer::type m_fib; ///< @brief Internal container
protected:
// inherited from Object class
- virtual void NotifyNewAggregate ();
- virtual void DoDispose ();
+ virtual void NotifyNewAggregate (); ///< @brief Notify when object is aggregated
+ virtual void DoDispose (); ///< @brief Perform cleanup
private:
friend std::ostream& operator<< (std::ostream& os, const CcnxFib &fib);
diff --git a/model/ccnx-forwarding-strategy.h b/model/ccnx-forwarding-strategy.h
index ea9f692..07e6cf2 100644
--- a/model/ccnx-forwarding-strategy.h
+++ b/model/ccnx-forwarding-strategy.h
@@ -93,10 +93,11 @@
Ptr<CcnxInterestHeader> &header,
const Ptr<const Packet> &packet);
+ /// @brief Transmitted interests trace
TracedCallback<Ptr<const CcnxInterestHeader>, Ptr<const CcnxFace> > m_transmittedInterestsTrace;
protected:
- Ptr<CcnxPit> m_pit;
+ Ptr<CcnxPit> m_pit; ///< \brief Reference to PIT to which this forwarding strategy is associated
};
} //namespace ns3
diff --git a/model/ccnx-global-router.h b/model/ccnx-global-router.h
index 53c9d04..a35c08b 100644
--- a/model/ccnx-global-router.h
+++ b/model/ccnx-global-router.h
@@ -34,11 +34,23 @@
class CcnxFace;
class CcnxNameComponents;
+/**
+ * @brief Class representing global router interface for ndnSIM
+ */
class CcnxGlobalRouter : public Object
{
public:
+ /**
+ * @brief Graph edge
+ */
typedef boost::tuple< Ptr< CcnxGlobalRouter >, Ptr< CcnxFace >, Ptr< CcnxGlobalRouter > > Incidency;
+ /**
+ * @brief List of graph edges
+ */
typedef std::list< Incidency > IncidencyList;
+ /**
+ * @brief List of locally exported prefixes
+ */
typedef std::list< Ptr<CcnxNameComponents> > LocalPrefixList;
/**
@@ -49,33 +61,54 @@
static TypeId
GetTypeId ();
+ /**
+ * @brief Default constructor
+ */
CcnxGlobalRouter ();
+ /**
+ * @brief Get numeric ID of the node (internally assigned)
+ */
uint32_t
GetId () const;
-
+
+ /**
+ * @brief Helper function to get smart pointer to Ccnx object (basically, self)
+ */
Ptr<Ccnx>
GetCcnx () const;
-
+
+ /**
+ * @brief Add new locally exported prefix
+ * @param prefix Prefix
+ */
void
AddLocalPrefix (Ptr< CcnxNameComponents > prefix);
/**
- *
+ * @brief Add edge to the node
+ * @param face Face of the edge
+ * @param ccnx CcnxGlobalRouter of another node
*/
void
AddIncidency (Ptr< CcnxFace > face, Ptr< CcnxGlobalRouter > ccnx);
+ /**
+ * @brief Get list of edges that are connected to this node
+ */
IncidencyList &
GetIncidencies ();
+ /**
+ * @brief Get list of locally exported prefixes
+ */
const LocalPrefixList &
GetLocalPrefixes () const;
// ??
protected:
virtual void
- NotifyNewAggregate ();
+ NotifyNewAggregate (); ///< @brief Notify when the object is aggregated to another object (e.g., Node)
private:
uint32_t m_id;
diff --git a/model/ccnx-interest-header.h b/model/ccnx-interest-header.h
index 3e46541..8b1d5c4 100644
--- a/model/ccnx-interest-header.h
+++ b/model/ccnx-interest-header.h
@@ -115,17 +115,17 @@
**/
/**
- * NDN InterestHeader and routines to serialize/deserialize
-
- Simplifications:
- - Name: binary name components are not supported
- - MinSuffixComponents and MasSuffixComponents: if value is negative (default), will not be serialized
- - ChildSelector, AnswerOriginKind: 0 - false, 1 - true, -1 not set
- - Publisher* elements are not supported
- - Exclude: only simple name matching is supported (Bloom support has been deprecated in CCNx)
- - InterestLifetime: ?
- - Nonce: 32 bit random integer. If value is 0, will not be serialized
- */
+ * @brief NDN InterestHeader and routines to serialize/deserialize
+ *
+ * Simplifications:
+ * - Name: binary name components are not supported
+ * - MinSuffixComponents and MasSuffixComponents: if value is negative (default), will not be serialized
+ * - ChildSelector, AnswerOriginKind: 0 - false, 1 - true, -1 not set
+ * - Publisher* elements are not supported
+ * - Exclude: only simple name matching is supported (Bloom support has been deprecated in CCNx)
+ * - InterestLifetime: ?
+ * - Nonce: 32 bit random integer. If value is 0, will not be serialized
+ **/
class CcnxInterestHeader : public SimpleRefCount<CcnxInterestHeader,Header>
{
public:
@@ -314,8 +314,8 @@
GetNonce () const;
/**
- * \enum NACK Type
- * \brief Specifies the type of Interest packet
+ * @brief NACK Type
+ * Specifies the type of Interest packet
*/
enum
{
@@ -345,9 +345,9 @@
GetNack () const;
//////////////////////////////////////////////////////////////////
-
- static TypeId GetTypeId (void);
- virtual TypeId GetInstanceTypeId (void) const;
+
+ static TypeId GetTypeId (void); ///< @brief Get TypeId of the class
+ virtual TypeId GetInstanceTypeId (void) const; ///< @brief Get TypeId of the instance
/**
* \brief Print Interest packet
@@ -388,7 +388,7 @@
};
/**
- * \brief Exception class for CcnxInterestHeader
+ * @brief Class for Interest parsing exception
*/
class CcnxInterestHeaderException {};
diff --git a/model/ccnx-l3-protocol.h b/model/ccnx-l3-protocol.h
index c790c8e..157703c 100644
--- a/model/ccnx-l3-protocol.h
+++ b/model/ccnx-l3-protocol.h
@@ -168,7 +168,7 @@
const Ptr<const Packet> &packet);
protected:
- virtual void DoDispose (void);
+ virtual void DoDispose (void); ///< @brief Do cleanup
/**
* This function will notify other components connected to the node that a new stack member is now connected
diff --git a/model/ccnx-name-components-hash-helper.h b/model/ccnx-name-components-hash-helper.h
index 779f7f1..45e9f0e 100644
--- a/model/ccnx-name-components-hash-helper.h
+++ b/model/ccnx-name-components-hash-helper.h
@@ -39,6 +39,9 @@
*/
struct CcnxPrefixHash : public std::unary_function<CcnxNameComponents, std::size_t>
{
+ /**
+ * @brief Compute hash of the name prefix
+ */
std::size_t
operator() (const CcnxNameComponents &prefix) const
{
diff --git a/model/ccnx-name-components.h b/model/ccnx-name-components.h
index c4bc8a8..7f62851 100644
--- a/model/ccnx-name-components.h
+++ b/model/ccnx-name-components.h
@@ -83,6 +83,9 @@
const std::list<std::string> &
GetComponents () const;
+ /**
+ * @brief Helper call to get the last component of the name
+ */
std::string
GetLastComponent () const;
diff --git a/model/ccnx-net-device-face.h b/model/ccnx-net-device-face.h
index a83ed70..0fdefea 100644
--- a/model/ccnx-net-device-face.h
+++ b/model/ccnx-net-device-face.h
@@ -68,6 +68,9 @@
SendImpl (Ptr<Packet> p);
public:
+ /**
+ * @brief Print out name of the CcnxFace to the stream
+ */
virtual std::ostream&
Print (std::ostream &os) const;
////////////////////////////////////////////////////////////////////
diff --git a/model/ccnx-pit-entry-incoming-face.h b/model/ccnx-pit-entry-incoming-face.h
index 80f7e09..61cb4e6 100644
--- a/model/ccnx-pit-entry-incoming-face.h
+++ b/model/ccnx-pit-entry-incoming-face.h
@@ -46,7 +46,14 @@
*/
CcnxPitEntryIncomingFace (Ptr<CcnxFace> face);
+ /**
+ * @brief Compare two CcnxPitEntryIncomingFace
+ */
bool operator== (const CcnxPitEntryIncomingFace &dst) { return *m_face==*(dst.m_face); }
+
+ /**
+ * @brief Compare CcnxPitEntryIncomingFace with CcnxFace
+ */
bool operator== (Ptr<CcnxFace> face) { return *m_face==*face; }
/**
diff --git a/model/ccnx-pit-entry-outgoing-face.h b/model/ccnx-pit-entry-outgoing-face.h
index c0fe80f..fbd13c5 100644
--- a/model/ccnx-pit-entry-outgoing-face.h
+++ b/model/ccnx-pit-entry-outgoing-face.h
@@ -42,6 +42,10 @@
bool m_waitingInVain; ///< \brief when flag is set, we do not expect data for this interest, only a small hope that it will happen
public:
+ /**
+ * @brief Constructor to create CcnxPitEntryOutgoingFace
+ * \param face face of the outgoing interest
+ */
CcnxPitEntryOutgoingFace (Ptr<CcnxFace> face);
/**
@@ -50,7 +54,14 @@
void
UpdateOnRetransmit ();
+ /**
+ * @brief Compare to CcnxPitEntryOutgoingFace
+ */
bool operator== (const CcnxPitEntryOutgoingFace &dst) { return *m_face==*dst.m_face; }
+
+ /**
+ * @brief Compare CcnxPitEntryOutgoingFace with CcnxFace
+ */
bool operator== (Ptr<CcnxFace> face) { return *m_face==*face; }
/**
diff --git a/model/ccnx-pit-entry.h b/model/ccnx-pit-entry.h
index 9bf2768..6c69f99 100644
--- a/model/ccnx-pit-entry.h
+++ b/model/ccnx-pit-entry.h
@@ -59,6 +59,7 @@
*/
struct CcnxPitEntryIncomingFaceContainer
{
+ /// @cond include_hidden
typedef boost::multi_index::multi_index_container<
CcnxPitEntryIncomingFace,
boost::multi_index::indexed_by<
@@ -69,6 +70,7 @@
>
>
> type;
+ /// @endcond
};
/**
@@ -80,6 +82,7 @@
*/
struct CcnxPitEntryOutgoingFaceContainer
{
+ /// @cond include_hidden
typedef boost::multi_index::multi_index_container<
CcnxPitEntryOutgoingFace,
boost::multi_index::indexed_by<
@@ -94,6 +97,7 @@
>
>
> type;
+ /// @endcond
};
@@ -122,7 +126,10 @@
*/
void
UpdateLifetime (const Time &offsetTime);
-
+
+ /**
+ * @brief Get prefix of the PIT entry
+ */
const CcnxNameComponents &
GetPrefix () const
{ return *m_prefix; }
@@ -223,7 +230,7 @@
bool
AreAllOutgoingInVain () const;
- /*
+ /**
* @brief Similar to AreAllOutgoingInVain, but ignores `face`
* \see AreAllOutgoingInVain
**/
diff --git a/model/ccnx-pit.h b/model/ccnx-pit.h
index e80f697..84b1685 100644
--- a/model/ccnx-pit.h
+++ b/model/ccnx-pit.h
@@ -73,6 +73,7 @@
*/
struct CcnxPitEntryContainer
{
+ /// @cond include_hidden
typedef
boost::multi_index::multi_index_container<
CcnxPitEntry,
@@ -90,6 +91,7 @@
>
>
> type;
+ /// @endcond
};
////////////////////////////////////////////////////////////////////////
@@ -139,7 +141,10 @@
*/
boost::tuple<const CcnxPitEntry&, bool, bool>
Lookup (const CcnxInterestHeader &header);
-
+
+ /**
+ * @brief Get pruning timeout for PIT entries (configuration parameter)
+ */
Time GetPitEntryPruningTimeout () const
{
return m_PitEntryPruningTimout;
@@ -152,8 +157,8 @@
protected:
// inherited from Object class
- virtual void NotifyNewAggregate ();
- virtual void DoDispose ();
+ virtual void NotifyNewAggregate (); ///< @brief Even when object is aggregated to another Object
+ virtual void DoDispose (); ///< @brief Do cleanup
private:
/** \brief Remove expired records from PIT */
@@ -193,6 +198,9 @@
std::ostream& operator<< (std::ostream& os, const CcnxPit &pit);
+/**
+ * @brief Class for exception when PIT entry is not found
+ */
class CcnxPitEntryNotFound {};
} // namespace ns3
diff --git a/model/ccnx.h b/model/ccnx.h
index e72ddec..4dc3cea 100644
--- a/model/ccnx.h
+++ b/model/ccnx.h
@@ -181,25 +181,25 @@
// transmittedInterestTrace is inside ForwardingStrategy
TracedCallback<Ptr<const CcnxInterestHeader>,
- Ptr<const CcnxFace> > m_inInterests;
+ Ptr<const CcnxFace> > m_inInterests; ///< @brief trace of incoming Interests
TracedCallback<Ptr<const CcnxInterestHeader>,
DropReason,
- Ptr<const CcnxFace> > m_dropInterests;
+ Ptr<const CcnxFace> > m_dropInterests; ///< @brief trace of dropped Interests
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
TracedCallback<Ptr<const CcnxInterestHeader>,
- Ptr<const CcnxFace> > m_outNacks;
+ Ptr<const CcnxFace> > m_outNacks; ///< @brief trace of outgoing NACKs
TracedCallback<Ptr<const CcnxInterestHeader>,
- Ptr<const CcnxFace> > m_inNacks;
+ Ptr<const CcnxFace> > m_inNacks; ///< @brief trace of incoming NACKs
TracedCallback<Ptr<const CcnxInterestHeader>,
DropReason,
- Ptr<const CcnxFace> > m_dropNacks;
+ Ptr<const CcnxFace> > m_dropNacks; ///< @brief trace of dropped NACKs
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
@@ -207,14 +207,14 @@
TracedCallback<Ptr<const CcnxContentObjectHeader>, Ptr<const Packet>,
bool /*from cache*/,
- Ptr<const CcnxFace> > m_outData;
+ Ptr<const CcnxFace> > m_outData; ///< @brief trace of outgoing Data
TracedCallback<Ptr<const CcnxContentObjectHeader>, Ptr<const Packet>,
- Ptr<const CcnxFace> > m_inData;
+ Ptr<const CcnxFace> > m_inData; ///< @brief trace of incoming Data
TracedCallback<Ptr<const CcnxContentObjectHeader>, Ptr<const Packet>,
DropReason,
- Ptr<const CcnxFace> > m_dropData;
+ Ptr<const CcnxFace> > m_dropData; ///< @brief trace of dropped Data
};
} // namespace ns3