get rid of DefaultValue usage in internet-node
This commit is contained in:
124
src/node/tcp.cc
124
src/node/tcp.cc
@@ -18,58 +18,100 @@
|
||||
* Author: Raj Bhattacharjea <raj.b@gatech.edu>
|
||||
*/
|
||||
#include "tcp.h"
|
||||
#include "ns3/uinteger.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultSegSize
|
||||
("TcpDefaultSegmentSize",
|
||||
"Default TCP maximum segment size in bytes (may be adjusted based on MTU discovery)",
|
||||
536);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultAdvWin
|
||||
("TcpDefaultAdvertisedWindowSize",
|
||||
"Default TCP advertised window size (bytes)",
|
||||
0xffff);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultSSThresh
|
||||
("TcpDefaultSlowStartThreshold",
|
||||
"Default TCP slow start threshold (bytes)",
|
||||
0xffff);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultTxBuffer
|
||||
("TcpDefaultTxBufferSize",
|
||||
"Default TCP maximum transmit buffer size (bytes)",
|
||||
0xffffffffl);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultRxBuffer
|
||||
("TcpDefaultRxBufferSize",
|
||||
"Default TCP maximum receive buffer size (bytes)",
|
||||
0xffffffffl);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultInitialCWnd
|
||||
("TcpDefaultInitialCongestionWindowSize",
|
||||
"Default TCP initial congestion window size (segments)",
|
||||
1);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultConnTimeout
|
||||
("TcpDefaultConnTimeout",
|
||||
"Default TCP retransmission timeout when opening connection (seconds)",
|
||||
3);
|
||||
|
||||
NumericDefaultValue<uint32_t> Tcp::defaultConnCount
|
||||
("TcpDefaultConnCount",
|
||||
"Default number of connection attempts (SYN retransmissions) before returning failure",
|
||||
6);
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Tcp);
|
||||
|
||||
TypeId
|
||||
Tcp::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("Tcp")
|
||||
.SetParent<SocketFactory> ();
|
||||
.SetParent<SocketFactory> ()
|
||||
.AddAttribute ("TcpDefaultSegmentSize",
|
||||
"Default TCP maximum segment size in bytes (may be adjusted based on MTU discovery)",
|
||||
Uinteger (536),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultSegSize),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultAdvertisedWindowSize",
|
||||
"Default TCP advertised window size (bytes)",
|
||||
Uinteger (0xffff),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultAdvWin),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultSlowStartThreshold",
|
||||
"Default TCP slow start threshold (bytes)",
|
||||
Uinteger (0xffff),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultSsThresh),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultTxBufferSize",
|
||||
"Default TCP maximum transmit buffer size (bytes)",
|
||||
Uinteger (0xffffffffl),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultTxBuffer),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultRxBufferSize",
|
||||
"Default TCP maximum receive buffer size (bytes)",
|
||||
Uinteger (0xffffffffl),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultRxBuffer),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultInitialCongestionWindowSize",
|
||||
"Default TCP initial congestion window size (segments)",
|
||||
Uinteger (1),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultInitialCwnd),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultConnTimeout",
|
||||
"Default TCP retransmission timeout when opening connection (seconds)",
|
||||
Uinteger (3),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultConnTimeout),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("TcpDefaultConnCount",
|
||||
"Default number of connection attempts (SYN retransmissions) before returning failure",
|
||||
Uinteger (6),
|
||||
MakeUintegerAccessor (&Tcp::m_defaultConnCount),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
Tcp::GetDefaultSegSize (void) const
|
||||
{
|
||||
return m_defaultSegSize;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultAdvWin (void) const
|
||||
{
|
||||
return m_defaultAdvWin;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultSsThresh (void) const
|
||||
{
|
||||
return m_defaultSsThresh;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultTxBuffer (void) const
|
||||
{
|
||||
return m_defaultTxBuffer;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultRxBuffer (void) const
|
||||
{
|
||||
return m_defaultRxBuffer;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultInitialCwnd (void) const
|
||||
{
|
||||
return m_defaultInitialCwnd;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultConnTimeout (void) const
|
||||
{
|
||||
return m_defaultConnTimeout;
|
||||
}
|
||||
uint32_t
|
||||
Tcp::GetDefaultConnCount (void) const
|
||||
{
|
||||
return m_defaultConnCount;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#ifndef TCP_H
|
||||
#define TCP_H
|
||||
|
||||
#include "ns3/default-value.h"
|
||||
#include "socket-factory.h"
|
||||
|
||||
namespace ns3 {
|
||||
@@ -48,18 +47,26 @@ public:
|
||||
|
||||
virtual Ptr<Socket> CreateSocket (void) = 0;
|
||||
|
||||
public:
|
||||
static NumericDefaultValue<uint32_t> defaultSegSize;
|
||||
static NumericDefaultValue<uint32_t> defaultAdvWin;
|
||||
static NumericDefaultValue<uint32_t> defaultSSThresh;
|
||||
static NumericDefaultValue<uint32_t> defaultTxBuffer;
|
||||
static NumericDefaultValue<uint32_t> defaultRxBuffer;
|
||||
static NumericDefaultValue<uint32_t> defaultInitialCWnd;
|
||||
static NumericDefaultValue<uint32_t> defaultConnTimeout;
|
||||
static NumericDefaultValue<uint32_t> defaultConnCount;
|
||||
uint32_t GetDefaultSegSize (void) const;
|
||||
uint32_t GetDefaultAdvWin (void) const;
|
||||
uint32_t GetDefaultSsThresh (void) const;
|
||||
uint32_t GetDefaultTxBuffer (void) const;
|
||||
uint32_t GetDefaultRxBuffer (void) const;
|
||||
uint32_t GetDefaultInitialCwnd (void) const;
|
||||
uint32_t GetDefaultConnTimeout (void) const;
|
||||
uint32_t GetDefaultConnCount (void) const;
|
||||
private:
|
||||
uint32_t m_defaultSegSize;
|
||||
uint32_t m_defaultAdvWin;
|
||||
uint32_t m_defaultSsThresh;
|
||||
uint32_t m_defaultTxBuffer;
|
||||
uint32_t m_defaultRxBuffer;
|
||||
uint32_t m_defaultInitialCwnd;
|
||||
uint32_t m_defaultConnTimeout;
|
||||
uint32_t m_defaultConnCount;
|
||||
|
||||
};
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* UDP_H */
|
||||
#endif /* TCP_H */
|
||||
|
||||
Reference in New Issue
Block a user