00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
00018
00025 #ifndef GLOBUS_I_GSI_SYSTEM_CONFIG_H
00026 #define GLOBUS_I_GSI_SYSTEM_CONFIG_H
00027
00028 #include "globus_common.h"
00029 #include "globus_i_gsi_sysconfig_config.h"
00030 #include "globus_gsi_system_config_constants.h"
00031 #include "globus_gsi_system_config.h"
00032
00033 #define _GSSL(s) globus_common_i18n_get_string(\
00034 GLOBUS_GSI_SYSCONFIG_MODULE,\
00035 s)
00036
00037
00038
00039 extern int globus_i_gsi_sysconfig_debug_level;
00040 extern FILE * globus_i_gsi_sysconfig_debug_fstream;
00041
00042 #ifdef BUILD_DEBUG
00043
00044 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG(_LEVEL_) \
00045 (globus_i_gsi_sysconfig_debug_level >= (_LEVEL_))
00046
00047 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) \
00048 { \
00049 if (GLOBUS_I_GSI_SYSCONFIG_DEBUG(_LEVEL_)) \
00050 { \
00051 globus_libc_fprintf _MESSAGE_; \
00052 } \
00053 }
00054
00055 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) \
00056 { \
00057 if (GLOBUS_I_GSI_SYSCONFIG_DEBUG(_LEVEL_)) \
00058 { \
00059 char * _tmp_str_ = \
00060 globus_common_create_nstring _MESSAGE_; \
00061 globus_libc_fprintf(globus_i_gsi_sysconfig_debug_fstream, \
00062 _tmp_str_); \
00063 globus_libc_free(_tmp_str_); \
00064 } \
00065 }
00066
00067 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_PRINT(_LEVEL_, _MESSAGE_) \
00068 { \
00069 if (GLOBUS_I_GSI_SYSCONFIG_DEBUG(_LEVEL_)) \
00070 { \
00071 globus_libc_fprintf(globus_i_gsi_sysconfig_debug_fstream, \
00072 _MESSAGE_); \
00073 } \
00074 }
00075
00076 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_PRINT_OBJECT(_LEVEL_, _OBJ_NAME_, _OBJ_) \
00077 { \
00078 if (GLOBUS_I_GSI_SYSCONFIG_DEBUG(_LEVEL_)) \
00079 { \
00080 _OBJ_NAME_##_print_fp(globus_i_gsi_sysconfig_debug_fstream, \
00081 _OBJ_); \
00082 } \
00083 }
00084
00085 #else
00086
00087 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) {}
00088 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) {}
00089 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_PRINT(_LEVEL_, _MESSAGE_) {}
00090 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_PRINT_OBJECT(_LEVEL_, \
00091 _OBJ_NAME_, _OBJ_) {}
00092
00093 #endif
00094
00095 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER \
00096 GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF( \
00097 1, (globus_i_gsi_sysconfig_debug_fstream, \
00098 "%s entering\n", __func__))
00099
00100 #define GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT \
00101 GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF( \
00102 2, (globus_i_gsi_sysconfig_debug_fstream, \
00103 "%s exiting\n", __func__))
00104
00105
00106
00107 #define GLOBUS_GSI_SYSCONFIG_OPENSSL_ERROR_RESULT(_RESULT_, \
00108 _ERRORTYPE_, \
00109 _ERRSTR_) \
00110 { \
00111 char * _tmp_str_ = \
00112 globus_common_create_string _ERRSTR_; \
00113 _RESULT_ = globus_i_gsi_sysconfig_openssl_error_result(_ERRORTYPE_, \
00114 __FILE__, \
00115 __func__, \
00116 __LINE__, \
00117 _tmp_str_, \
00118 NULL); \
00119 globus_libc_free(_tmp_str_); \
00120 }
00121
00122 #define GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(_RESULT_, _ERRORTYPE_, _ERRSTR_) \
00123 { \
00124 char * _tmp_str_ = \
00125 globus_common_create_string _ERRSTR_; \
00126 _RESULT_ = globus_i_gsi_sysconfig_error_result(_ERRORTYPE_, \
00127 __FILE__, \
00128 __func__, \
00129 __LINE__, \
00130 _tmp_str_, \
00131 NULL); \
00132 globus_libc_free(_tmp_str_); \
00133 }
00134
00135 #define GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(_TOP_RESULT_, _ERRORTYPE_) \
00136 _TOP_RESULT_ = globus_i_gsi_sysconfig_error_chain_result(_TOP_RESULT_, \
00137 _ERRORTYPE_, \
00138 __FILE__, \
00139 __func__, \
00140 __LINE__, \
00141 NULL, \
00142 NULL)
00143
00144 #define GLOBUS_GSI_SYSCONFIG_OPENSSL_LONG_ERROR_RESULT(_RESULT_, \
00145 _ERRORTYPE_, \
00146 _ERRSTR_, \
00147 _LONG_DESC_) \
00148 { \
00149 char * _tmp_str_ = \
00150 globus_common_create_string _ERRSTR_; \
00151 _RESULT_ = globus_i_gsi_sysconfig_openssl_error_result(_ERRORTYPE_, \
00152 __FILE__, \
00153 __func__, \
00154 __LINE__, \
00155 _tmp_str_, \
00156 _LONG_DESC_); \
00157 globus_libc_free(_tmp_str_); \
00158 }
00159
00160 #define GLOBUS_GSI_SYSCONFIG_LONG_ERROR_RESULT(_RESULT_, \
00161 _ERRORTYPE_, \
00162 _ERRSTR_, \
00163 _LONG_DESC_) \
00164 { \
00165 char * _tmp_str_ = \
00166 globus_common_create_string _ERRSTR_; \
00167 _RESULT_ = globus_i_gsi_sysconfig_error_result(_ERRORTYPE_, \
00168 __FILE__, \
00169 __func__, \
00170 __LINE__, \
00171 _tmp_str_, \
00172 _LONG_DESC_); \
00173 globus_libc_free(_tmp_str_); \
00174 }
00175
00176 #define GLOBUS_GSI_SYSCONFIG_LONG_ERROR_CHAIN_RESULT(_TOP_RESULT_, \
00177 _ERRORTYPE_, \
00178 _LONG_DESC_) \
00179 _TOP_RESULT_ = globus_i_gsi_sysconfig_error_chain_result(_TOP_RESULT_, \
00180 _ERRORTYPE_, \
00181 __FILE__, \
00182 __func__, \
00183 __LINE__, \
00184 NULL, \
00185 _LONG_DESC_)
00186
00187 #define GLOBUS_GSI_SYSCONFIG_FILE_DOES_NOT_EXIST(_RESULT) \
00188 (globus_error_match(globus_error_peek(_RESULT), \
00189 GLOBUS_GSI_SYSCONFIG_MODULE, \
00190 GLOBUS_GSI_SYSCONFIG_ERROR_FILE_DOES_NOT_EXIST) == \
00191 GLOBUS_TRUE)
00192
00193 #define GLOBUS_GSI_SYSCONFIG_FILE_HAS_BAD_PERMISSIONS(_RESULT) \
00194 (globus_error_match(globus_error_peek(_RESULT), \
00195 GLOBUS_GSI_SYSCONFIG_MODULE, \
00196 GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS) == \
00197 GLOBUS_TRUE)
00198
00199 #define GLOBUS_GSI_SYSCONFIG_FILE_ZERO_LENGTH(_RESULT) \
00200 (globus_error_match(globus_error_peek(_RESULT), \
00201 GLOBUS_GSI_SYSCONFIG_MODULE, \
00202 GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH) == \
00203 GLOBUS_TRUE)
00204
00205 extern char * globus_l_gsi_sysconfig_error_strings[];
00206 extern char * globus_l_gsi_sysconfig_status_strings[];
00207
00208 globus_result_t
00209 globus_i_gsi_sysconfig_create_cert_dir_string(
00210 char ** cert_dir,
00211 char ** cert_dir_value,
00212 const char * format,
00213 ...);
00214
00215 globus_result_t
00216 globus_i_gsi_sysconfig_create_cert_string(
00217 char ** cert_string,
00218 char ** cert_string_value,
00219 const char * format,
00220 ...);
00221
00222 globus_result_t
00223 globus_i_gsi_sysconfig_create_key_string(
00224 char ** key_string,
00225 char ** key_string_value,
00226 const char * format,
00227 ...);
00228
00229 globus_result_t
00230 globus_i_gsi_sysconfig_error_chain_result(
00231 globus_result_t chain_result,
00232 int error_type,
00233 const char * filename,
00234 const char * function_name,
00235 int line_number,
00236 const char * short_desc,
00237 const char * long_desc);
00238
00239 globus_result_t
00240 globus_i_gsi_sysconfig_error_result(
00241 int error_type,
00242 const char * filename,
00243 const char * function_name,
00244 int line_number,
00245 const char * short_desc,
00246 const char * long_desc);
00247
00248 globus_result_t
00249 globus_i_gsi_sysconfig_openssl_error_result(
00250 int error_type,
00251 const char * filename,
00252 const char * function_name,
00253 int line_number,
00254 const char * short_desc,
00255 const char * long_desc);
00256
00257
00258 #endif
00259
00260 #endif