[Ns-bugs] [Bug 129] New: class Tcp inappropriately exports default values as part of its public API

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Fri Jan 25 16:07:48 PST 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=129

           Summary: class Tcp inappropriately exports default values as part
                    of its public API
           Product: ns-3
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: internet-node
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: tomh at tomh.org


Suggestion by Mathieu:


> in tcp.h:
> 
> class Tcp
> {
> public:
>   Tcp (void);
>   Ptr<Socket> CreateSocket (...);
> 
>   void SetDefaultSeqSize (uint32_t seqSize);
>   ...
> protected:
>   // make it available only to subclasses
>   uint32_t GetDefaultSeqSize (void);
>   ...
> private:
>   // hide the member.
>   uint32_t m_defaultSeqSize;
> };
> 
> in tcp.cc:
> 
> static NumericDefaultValue<uint32_t> g_defaultSegSize = ...;
> 
> Tcp::Tcp (void)
>   : m_defaultSeqSize (g_defaultSeqSize)
> {}
> 
> void 
> Tcp::SetDefaultSeqSize (uint32_t seqSize)
> {
>   m_defaultSeqSize = seqSize;
> }
> uint32_t 
> Tcp::GetDefaultSeqSize (void)
> {
>   return m_defaultSeqSize;
> }


I support this in principle, but the above suggestion needs a little massaging:
 TcpSocket is not a subclass of Tcp


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list