diff -r 73bc9e55f9bd -r 1e48ff9185f1 src/internet/model/nsc-tcp-l4-protocol.cc --- a/src/internet/model/nsc-tcp-l4-protocol.cc Sun Nov 24 23:48:49 2013 +0100 +++ b/src/internet/model/nsc-tcp-l4-protocol.cc Wed Nov 20 20:15:02 2013 +0100 @@ -55,16 +55,45 @@ /* see http://www.iana.org/assignments/protocol-numbers */ const uint8_t NscTcpL4Protocol::PROT_NUMBER = 6; +/** + * \ingroup nsctcp + * \brief Nsc interface implementation class. + */ class NscInterfaceImpl : public ISendCallback, public IInterruptCallback { public: + /** + * Constructor + * \param prot the NSC TCP protocol + */ NscInterfaceImpl (Ptr prot); private: + /** + * \brief Invoked by NSCs 'ethernet driver' to re-inject a packet into ns-3. + * + * A packet is an octet soup consisting of an IP Header, TCP Header + * and user payload, if any + * + * \param data the data + * \param datalen the data length + */ virtual void send_callback (const void *data, int datalen); + /** + * \brief Called by the NSC stack whenever something of interest has happened + * + * Examples: when data arrives on a socket, a listen socket + * has a new connection pending, etc. + */ virtual void wakeup (); + /** + * \brief Called by the Linux stack RNG initialization + * + * Its also used by the cradle code to add a timestamp to + * printk/printf/debug output. + */ virtual void gettime (unsigned int *, unsigned int *); private: - Ptr m_prot; + Ptr m_prot; //!< the NSC TCP protocol }; NscInterfaceImpl::NscInterfaceImpl (Ptr prot) @@ -113,9 +142,16 @@ return tid; } +/** + * \brief External Random number generator + * + * \todo make it random... + * + * \returns a random number + */ int external_rand () { - return 1; /// \todo + return 1; } NscTcpL4Protocol::NscTcpL4Protocol () @@ -385,7 +421,7 @@ void NscTcpL4Protocol::wakeup () { - /// \todo + // \todo // this should schedule a timer to read from all tcp sockets now... this is // an indication that data might be waiting on the socket @@ -451,7 +487,7 @@ // IP address of the subnet but this was found to fail for // some use cases in /30 subnets. - /// \todo \bugid{1398} NSC's limitation to single-interface nodes + // \todo \bugid{1398} NSC's limitation to single-interface nodes m_nscStack->add_default_gateway (addrOss.str ().c_str ()); } }