Bug 129 - class Tcp inappropriately exports default values as part of its public API
class Tcp inappropriately exports default values as part of its public API
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
pre-release
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-25 19:07 UTC by Tom Henderson
Modified: 2008-07-01 13:32 UTC (History)
0 users

See Also:


Attachments
untested patch to fix this API (8.13 KB, patch)
2008-02-15 02:30 UTC, Tom Henderson
Details | Diff
patch tested against all tcp examples (9.58 KB, patch)
2008-02-15 10:10 UTC, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.