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