Bug 129

Summary: class Tcp inappropriately exports default values as part of its public API
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: internetAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: untested patch to fix this API
patch tested against all tcp examples

Description Tom Henderson 2008-01-25 19:07:47 UTC
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
Comment 1 Tom Henderson 2008-02-11 00:12:51 UTC
Move the getters fromm protected to public.  OK to commit?
Comment 2 Tom Henderson 2008-02-15 02:30:33 UTC
Created attachment 110 [details]
untested patch to fix this API
Comment 3 Tom Henderson 2008-02-15 10:10:05 UTC
Created attachment 111 [details]
patch tested against all tcp examples
Comment 4 Rajib Bhattacharjea 2008-04-02 15:14:08 UTC
The ns-3-param merge fixed this.