Go to the documentation of this file.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
00034 #include "tls_hooks.h"
00035 #include "tls_hooks_init.h"
00036 #include "globals.h"
00037
00038 #ifdef TLS_HOOKS
00039
00040 struct tls_hooks tls_hook= {0, 0, 0, 0, 0 ,0 ,0};
00041
00042 static int tls_hooks_loaded=0;
00043
00044 int register_tls_hooks(struct tls_hooks* h)
00045 {
00046 if (!tls_disable){
00047 tls_hook=*h;
00048 tls_hooks_loaded++;
00049 return 0;
00050 }
00051 return -1;
00052 }
00053
00054
00055 int tls_init(struct socket_info* si)
00056 {
00057 if (tls_hook.init_si)
00058 return tls_hook.init_si(si);
00059 return -1;
00060 }
00061
00062 int tls_has_init_si()
00063 {
00064 return (tls_hook.init_si!=0);
00065 }
00066
00067 int init_tls()
00068 {
00069 if (tls_hook.init)
00070 return tls_hook.init();
00071 return 0;
00072 }
00073
00074 void destroy_tls()
00075 {
00076 if (tls_hook.destroy)
00077 tls_hook.destroy();
00078 }
00079
00080 int tls_loaded()
00081 {
00082 return tls_hooks_loaded;
00083 }
00084
00085 #endif