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 #ifndef __P_NET_H__
00031 #define __P_NET_H__
00032
00033
00034
00035 enum Net_Stats
00036 {
00037 net_handler_run_stat,
00038 net_read_bytes_stat,
00039 net_write_bytes_stat,
00040 net_connections_currently_open_stat,
00041 net_accepts_currently_open_stat,
00042 net_calls_to_readfromnet_stat,
00043 net_calls_to_readfromnet_afterpoll_stat,
00044 net_calls_to_read_stat,
00045 net_calls_to_read_nodata_stat,
00046 net_calls_to_writetonet_stat,
00047 net_calls_to_writetonet_afterpoll_stat,
00048 net_calls_to_write_stat,
00049 net_calls_to_write_nodata_stat,
00050 socks_connections_successful_stat,
00051 socks_connections_unsuccessful_stat,
00052 socks_connections_currently_open_stat,
00053 inactivity_cop_lock_acquire_failure_stat,
00054 Net_Stat_Count
00055 };
00056
00057 struct RecRawStatBlock;
00058 extern RecRawStatBlock *net_rsb;
00059 #define SSL_HANDSHAKE_WANT_READ 6
00060 #define SSL_HANDSHAKE_WANT_WRITE 7
00061 #define SSL_HANDSHAKE_WANT_ACCEPT 8
00062 #define SSL_HANDSHAKE_WANT_CONNECT 9
00063
00064 #define NET_DEBUG_COUNT_DYN_STAT(_x, _y) \
00065 RecIncrRawStatCount(net_rsb, mutex->thread_holding, (int)_x, _y)
00066
00067 #define NET_INCREMENT_DYN_STAT(_x) \
00068 RecIncrRawStatSum(net_rsb, mutex->thread_holding, (int)_x, 1)
00069
00070 #define NET_DECREMENT_DYN_STAT(_x) \
00071 RecIncrRawStatSum(net_rsb, mutex->thread_holding, (int)_x, -1)
00072
00073 #define NET_SUM_DYN_STAT(_x, _r) \
00074 RecIncrRawStatSum(net_rsb, mutex->thread_holding, (int)_x, _r)
00075
00076 #define NET_READ_DYN_SUM(_x, _sum) RecGetRawStatSum(net_rsb, (int)_x, &_sum)
00077
00078 #define NET_READ_DYN_STAT(_x, _count, _sum) do {\
00079 RecGetRawStatSum(net_rsb, (int)_x, &_sum); \
00080 RecGetRawStatCount(net_rsb, (int)_x, &_count); \
00081 } while (0)
00082
00083 #define NET_CLEAR_DYN_STAT(x) \
00084 do { \
00085 RecSetRawStatSum(net_rsb, x, 0); \
00086 RecSetRawStatCount(net_rsb, x, 0); \
00087 } while (0);
00088
00089
00090 #define NET_SUM_GLOBAL_DYN_STAT(_x, _r) RecIncrGlobalRawStatSum(net_rsb, (_x), (_r))
00091 #define NET_READ_GLOBAL_DYN_SUM(_x, _sum) RecGetGlobalRawStatSum(net_rsb, _x, &_sum)
00092
00093 #include "libts.h"
00094 #include "P_EventSystem.h"
00095 #include "I_Net.h"
00096 #include "P_NetVConnection.h"
00097 #include "P_UnixNet.h"
00098 #include "P_UnixNetProcessor.h"
00099 #include "P_NetAccept.h"
00100 #include "P_UnixNetVConnection.h"
00101 #include "P_UnixPollDescriptor.h"
00102 #include "P_Socks.h"
00103 #include "P_CompletionUtil.h"
00104 #include "P_NetVCTest.h"
00105 #include "P_LibBulkIO.h"
00106
00107 #include "P_SSLNetVConnection.h"
00108 #include "P_SSLNetProcessor.h"
00109 #include "P_SSLNetAccept.h"
00110 #include "P_SSLCertLookup.h"
00111
00112 #undef NET_SYSTEM_MODULE_VERSION
00113 #define NET_SYSTEM_MODULE_VERSION makeModuleVersion( \
00114 NET_SYSTEM_MODULE_MAJOR_VERSION, \
00115 NET_SYSTEM_MODULE_MINOR_VERSION, \
00116 PRIVATE_MODULE_HEADER)
00117
00118
00119 #ifndef DEBUG
00120 #define NetDebug if (0) dummy_debug
00121 #else
00122 #define NetDebug Debug
00123 #endif
00124
00125
00126
00127 static size_t const CLIENT_CONNECTION_FIRST_READ_BUFFER_SIZE_INDEX = BUFFER_SIZE_INDEX_4K;
00128
00129 #endif