|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
|
2 /* |
|
3 * Copyright (c) 2007 Georgia Tech Research Corporation |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License version 2 as |
|
7 * published by the Free Software Foundation; |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program; if not, write to the Free Software |
|
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 * |
|
18 * Author: Raj Bhattacharjea <raj.b@gatech.edu> |
|
19 */ |
|
20 #ifndef TCP_SOCKET_FACTORY_H |
|
21 #define TCP_SOCKET_FACTORY_H |
|
22 |
|
23 #include "socket-factory.h" |
|
24 |
|
25 namespace ns3 { |
|
26 |
|
27 class Socket; |
|
28 |
|
29 /** |
|
30 * \brief API to create TCP socket instances |
|
31 * |
|
32 * This abstract class defines the API for TCP sockets. |
|
33 * This class also holds the global default variables used to |
|
34 * initialize newly created sockets, such as values that are |
|
35 * set through the sysctl or proc interfaces in Linux. |
|
36 |
|
37 * All TCP socket factory implementations must provide an implementation |
|
38 * of CreateSocket |
|
39 * below, and should make use of the default values configured below. |
|
40 * |
|
41 * \see TcpSocketFactoryImpl |
|
42 * |
|
43 */ |
|
44 class TcpSocketFactory : public SocketFactory |
|
45 { |
|
46 public: |
|
47 static TypeId GetTypeId (void); |
|
48 |
|
49 virtual Ptr<Socket> CreateSocket (void) = 0; |
|
50 |
|
51 uint32_t GetDefaultSegSize (void) const; |
|
52 uint32_t GetDefaultAdvWin (void) const; |
|
53 uint32_t GetDefaultSsThresh (void) const; |
|
54 uint32_t GetDefaultTxBuffer (void) const; |
|
55 uint32_t GetDefaultRxBuffer (void) const; |
|
56 uint32_t GetDefaultInitialCwnd (void) const; |
|
57 uint32_t GetDefaultConnTimeout (void) const; |
|
58 uint32_t GetDefaultConnCount (void) const; |
|
59 double GetDefaultDelAckTimeout (void) const; |
|
60 uint32_t GetDefaultDelAckCount (void) const; |
|
61 |
|
62 private: |
|
63 uint32_t m_defaultSegSize; |
|
64 uint32_t m_defaultAdvWin; |
|
65 uint32_t m_defaultSsThresh; |
|
66 uint32_t m_defaultTxBuffer; |
|
67 uint32_t m_defaultRxBuffer; |
|
68 uint32_t m_defaultInitialCwnd; |
|
69 uint32_t m_defaultConnTimeout; |
|
70 uint32_t m_defaultConnCount; |
|
71 double m_defaultDelAckTimeout; |
|
72 uint32_t m_defaultDelAckCount; |
|
73 |
|
74 }; |
|
75 |
|
76 } // namespace ns3 |
|
77 |
|
78 #endif /* TCP_SOCKET_FACTORY_H */ |