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 #ifndef __sctp_stats_h
00028 #define __sctp_stats_h
00029
00030
00031
00032 #ifndef NO_SCTP_STATS
00033 #define USE_SCTP_STATS
00034 #endif
00035
00036 #ifndef USE_SCTP_STATS
00037
00038 #define INIT_SCTP_STATS() 0
00039 #define DESTROY_SCTP_STATS()
00040
00041 #define SCTP_STATS_ESTABLISHED()
00042 #define SCTP_STATS_CONNECT_FAILED()
00043 #define SCTP_STATS_LOCAL_REJECT()
00044 #define SCTP_STATS_REMOTE_SHUTDOWN()
00045 #define SCTP_STATS_ASSOC_SHUTDOWN()
00046 #define SCTP_STATS_COMM_LOST()
00047 #define SCTP_STATS_SENDQ_FULL()
00048 #define SCTP_STATS_SEND_FAILED()
00049 #define SCTP_STATS_SEND_FORCE_RETRY()
00050
00051 #else
00052
00053 #include "counters.h"
00054
00055 struct sctp_counters_h {
00056 counter_handle_t established;
00057 counter_handle_t connect_failed;
00058 counter_handle_t local_reject;
00059 counter_handle_t remote_shutdown;
00060 counter_handle_t assoc_shutdown;
00061 counter_handle_t comm_lost;
00062 counter_handle_t sendq_full;
00063 counter_handle_t send_failed;
00064 counter_handle_t send_force_retry;
00065 };
00066
00067 extern struct sctp_counters_h sctp_cnts_h;
00068
00069 int sctp_stats_init();
00070 void sctp_stats_destroy();
00071
00072 #define INIT_SCTP_STATS() sctp_stats_init()
00073
00074 #define DESTROY_SCTP_STATS() sctp_stats_destroy()
00075
00076
00080 #define SCTP_STATS_ESTABLISHED() \
00081 counter_inc(sctp_cnts_h.established)
00082
00086 #define SCTP_STATS_CONNECT_FAILED() \
00087 counter_inc(sctp_cnts_h.connect_failed)
00088
00090 #define SCTP_STATS_LOCAL_REJECT() \
00091 counter_inc(sctp_cnts_h.local_reject)
00092
00093
00097 #define SCTP_STATS_REMOTE_SHUTDOWN() \
00098 counter_inc(sctp_cnts_h.remote_shutdown)
00099
00100
00104 #define SCTP_STATS_ASSOC_SHUTDOWN() \
00105 counter_inc(sctp_cnts_h.assoc_shutdown)
00106
00107
00111 #define SCTP_STATS_COMM_LOST() \
00112 counter_inc(sctp_cnts_h.comm_lost)
00113
00114
00118 #define SCTP_STATS_SENDQ_FULL() \
00119 counter_inc(sctp_cnts_h.sendq_full)
00120
00121
00126 #define SCTP_STATS_SEND_FAILED() \
00127 counter_inc(sctp_cnts_h.send_failed)
00128
00132 #define SCTP_STATS_SEND_FORCE_RETRY() \
00133 counter_inc(sctp_cnts_h.send_force_retry)
00134
00135 #endif
00136
00137 #endif
00138
00139