00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef ns_sctpDebug_h
00044 #define ns_sctpDebug_h
00045
00046 void sctpDebugEmptyPrintf (char const *format, ...);
00047
00048 #if(DEBUG)
00049
00050
00051
00052 #define __dbg_command 0x00000001
00053 #define __dbg_Reset 0x00000001
00054 #define __dbg_OptionReset 0x00000001
00055 #define __dbg_ControlChunkReservation 0x00000001
00056
00057 #define __dbg_recv 0x00000002
00058
00059 #define __dbg_sendmsg 0x00000004
00060
00061 #define __dbg_GenChunk 0x00000008
00062
00063 #define __dbg_GetNextDataChunkSize 0x00000010
00064 #define __dbg_GenOneDataChunk 0x00000010
00065 #define __dbg_GenMultipleDataChunks 0x00000010
00066 #define __dbg_BundleControlChunks 0x00000010
00067
00068 #define __dbg_GetHighestOutstandingTsn 0x00000020
00069 #define __dbg_FastRtx 0x00000020
00070 #define __dbg_StartT3RtxTimer 0x00000020
00071 #define __dbg_StopT3RtxTimer 0x00000020
00072 #define __dbg_Timeout 0x00000020
00073 #define __dbg_TimeoutRtx 0x00000020
00074 #define __dbg_T1InitTimerExpiration 0x00000020
00075 #define __dbg_T1CookieTimerExpiration 0x00000020
00076 #define __dbg_SackGenTimerExpiration 0x00000020
00077 #define __dbg_MarkChunkForRtx 0x00000020
00078 #define __dbg_AnyMarkedChunks 0x00000020
00079 #define __dbg_RtxMarkedChunks 0x00000020
00080
00081 #define __dbg_AddToSendBuffer 0x00000040
00082
00083 #define __dbg_RttUpdate 0x00000080
00084
00085 #define __dbg_SendBufferDequeueUpTo 0x00000100
00086
00087 #define __dbg_AdjustCwnd 0x00000200
00088
00089 #define __dbg_UpdateHighestTsn 0x00000400
00090 #define __dbg_IsDuplicateChunk 0x00000400
00091 #define __dbg_InsertDuplicateTsn 0x00000400
00092
00093 #define __dbg_UpdateCumAck 0x00000800
00094 #define __dbg_UpdateRecvTsnBlocks 0x00000800
00095
00096 #define __dbg_AdvancePeerAckPoint 0x00001000
00097 #define __dbg_ProcessForwardTsnChunk 0x00001000
00098
00099 #define __dbg_ProcessInitChunk 0x00002000
00100 #define __dbg_ProcessInitAckChunk 0x00002000
00101
00102 #define __dbg_ProcessDataChunk 0x00004000
00103 #define __dbg_ProcessGapAckBlocks 0x00004000
00104 #define __dbg_ProcessSackChunk 0x00004000
00105
00106 #define __dbg_ProcessChunk 0x00008000
00107 #define __dbg_ProcessOptionChunk 0x00008000
00108
00109 #define __dbg_NextChunk 0x00010000
00110
00111 #define __dbg_SetSource 0x00020000
00112 #define __dbg_SetDestination 0x00020000
00113 #define __dbg_SendPacket 0x00020000
00114 #define __dbg_TotalOutstanding 0x00020000
00115 #define __dbg_SendMuch 0x00020000
00116
00117 #define __dbg_PassToUpperLayer 0x00040000
00118
00119 #define __dbg_InsertInStreamBuffer 0x00080000
00120 #define __dbg_PassToStream 0x00080000
00121 #define __dbg_UpdateAllStreams 0x00080000
00122
00123 #define __dbg_AddInterface 0x00100000
00124 #define __dbg_AddDestination 0x00100000
00125 #define __dbg_SetPrimary 0x00100000
00126 #define __dbg_ForceSource 0x00100000
00127
00128 #define __dbg_GetNextDest 0x00200000
00129
00130 #define __dbg_CwndDegradeTimerExpiration 0x00400000
00131 #define __dbg_CalcHeartbeatTime 0x00400000
00132 #define __dbg_SendHeartbeat 0x00400000
00133 #define __dbg_HeartbeatGenTimerExpiration 0x00400000
00134 #define __dbg_ProcessHeartbeatAckChunk 0x00400000
00135
00136 #define __dbg_Close 0x00800000
00137
00138
00139
00140 #define __dbg_ProcessTimestampChunk 0x01000000
00141
00142
00143
00144 #define __dbg_RouteCacheFlushTimerExpiration 0x02000000
00145 #define __dbg_RouteCalcDelayTimerExpiration 0x02000000
00146
00147
00148
00149 #define __dbg_SelectRtxDest 0x04000000
00150
00151
00152
00153 #define __dbg_DumpSendBuffer 0x80000000
00154
00155
00156
00157 #define __dbg_SelectFromPFDests 0x10000000
00158
00159
00160
00161
00162
00163
00164
00165 #define DBG_I(funcName) \
00166 if(fhpDebugFile != NULL) \
00167 if (uiDebugMask & __dbg_##funcName) \
00168 {fprintf(fhpDebugFile, "[%s] <I> \n", #funcName);}
00169
00170
00171
00172
00173
00174
00175
00176 #define DBG_PL(funcName, format) \
00177 if(fhpDebugFile != NULL) \
00178 if (uiDebugMask & __dbg_##funcName) \
00179 fprintf(fhpDebugFile, "[%s] " format "\n", #funcName
00180 #define DBG_PR )
00181
00182
00183
00184
00185
00186
00187
00188
00189 #define DBG_F(funcName, debugFuncCall) \
00190 if(fhpDebugFile != NULL) \
00191 if (uiDebugMask & __dbg_##funcName) \
00192 debugFuncCall
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 #define DBG_IF(funcName) \
00203 if(fhpDebugFile != NULL) \
00204 if (uiDebugMask & __dbg_##funcName)
00205
00206
00207
00208
00209
00210 #define DBG_X(funcName) \
00211 if(fhpDebugFile != NULL) \
00212 if (uiDebugMask & __dbg_##funcName) \
00213 {fprintf(fhpDebugFile, "[%s] <X> \n", #funcName);}
00214
00215 #define DBG_FOPEN() \
00216 if(fhpDebugFile == NULL) \
00217 { \
00218 if(iDebugFileIndex >= 0) \
00219 { \
00220 char cpFileName[256]; \
00221 sprintf(cpFileName, "debug.SctpAgent.%d", iDebugFileIndex); \
00222 fhpDebugFile = fopen(cpFileName, "w"); \
00223 } \
00224 else \
00225 fhpDebugFile = stdout; \
00226 }
00227
00228 #else
00229
00230 #define DBG_I(bitmask) { }
00231
00232
00233
00234
00235 #define DBG_PL(funcName, format) if(0) sctpDebugEmptyPrintf (""
00236 #define DBG_PR )
00237
00238 #define DBG_F(funcName, debugFuncCall) { }
00239
00240 #define DBG_IF(funcName) if(0)
00241
00242 #define DBG_X(funcName) { }
00243
00244 #define DBG_FOPEN() { }
00245
00246 #endif
00247 #endif