Changeset 2101 for Whitix/branches/netchannel/user/sdk/network/tcp/tcp.h
- Timestamp:
- 06/16/10 15:11:16 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/netchannel/user/sdk/network/tcp/tcp.h
r2099 r2101 8 8 #include <net/ipv4.h> 9 9 #include <net/tcp.h> 10 11 #include "../stats/stats.h" 10 12 11 13 #define CHAN_TYPE_TCP 3 … … 20 22 ulong droppedPackets, droppedBytes; 21 23 ulong retxBytesSent, retxPacketsSent; 22 ulong wrongSumPackets, wrongSumBytes;24 ulong minWin, maxWin; 23 25 24 26 /* (Mainly) protocol */ … … 65 67 struct UserTimer retxTimer; 66 68 int retxTimerHnd; 67 int rto ;69 int rto, rtt, mdev; 68 70 69 71 /* Sequence numbers. */ … … 111 113 112 114 /* Events */ 113 struct AsyncCtx * remWinChanged;115 struct AsyncCtx *remWinChanged, *retxTimerOut, *localWinChanged, *droppedPkts; 114 116 }; 117 118 extern int _netDebug; 119 120 #ifndef DEBUG_TCP 121 #define DEBUG_TCP 0x1 122 #endif 115 123 116 124 //#define TCP_DEBUG_Y 117 125 118 126 #ifdef TCP_DEBUG_Y 119 #define TCP_DEBUG(args) do { printf("[TCP]: %d: %s: ", SysGetCurrentThreadId(), __func__); printf args; printf(" (%s:%d)\n", __FILE__, __LINE__);} while (0)127 #define TCP_DEBUG(args) do { if (_netDebug & DEBUG_TCP) { printf("[TCP]: %d: %s: ", SysGetCurrentThreadId(), __func__); printf args; printf(" (%s:%d)\n", __FILE__, __LINE__); } } while (0) 120 128 #else 121 129 #define TCP_DEBUG(args) … … 132 140 { 133 141 return ((struct Ipv4EndPoint*)(&socket->channel->src))->port; 142 } 143 144 static inline ulong TcpDestAddress(struct TcpSocket* socket) 145 { 146 return ((struct Ipv4EndPoint*)(&socket->channel->dest))->address; 134 147 } 135 148 … … 156 169 #define TCP_AGAIN -2 157 170 171 /* Buffer flags */ 172 #define TCP_FLAG_RETX 0x01 173 158 174 #endif
