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 #ifndef LD_SESSION_H
00034 #define LD_SESSION_H
00035
00036 #include <ldap.h>
00037
00038 #include "iniparser.h"
00039
00040
00041 struct ld_session {
00042 char name[256];
00043 LDAP* handle;
00044 char* host_name;
00045 int version;
00046 int server_search_timeout;
00047 struct timeval client_search_timeout;
00048 struct timeval client_bind_timeout;
00049 struct timeval network_timeout;
00050 char* bind_dn;
00051 char* bind_pwd;
00052 int calculate_ha1;
00053 struct ld_session* next;
00054 };
00055
00056 #define CFG_N_LDAP_HOST "ldap_server_url"
00057 #define CFG_N_LDAP_VERSION "ldap_version"
00058 #define CFG_N_LDAP_SERVER_SEARCH_TIMEOUT "ldap_server_search_timeout"
00059 #define CFG_N_LDAP_CLIENT_SEARCH_TIMEOUT "ldap_client_search_timeout"
00060 #define CFG_N_LDAP_CLIENT_BIND_TIMEOUT "ldap_client_bind_timeout"
00061 #define CFG_N_LDAP_NETWORK_TIMEOUT "ldap_network_timeout"
00062 #define CFG_N_LDAP_BIND_DN "ldap_bind_dn"
00063 #define CFG_N_LDAP_BIND_PWD "ldap_bind_password"
00064 #define CFG_N_CALCULATE_HA1 "calculate_ha1"
00065
00066
00067 #define CFG_DEF_HOST_NAME ""
00068 #define CFG_DEF_LDAP_SERVER_URL NULL
00069 #define CFG_DEF_LDAP_VERSION 3
00070 #define CFG_DEF_LDAP_CLIENT_BIND_TIMEOUT 1000
00071 #define CFG_DEF_LDAP_CLIENT_SEARCH_TIMEOUT 5000
00072 #define CFG_DEF_LDAP_NETWORK_TIMEOUT 1000
00073 #define CFG_DEF_LDAP_BIND_DN ""
00074 #define CFG_DEF_LDAP_BIND_PWD ""
00075 #define CFG_DEF_CALCULATE_HA1 1
00076
00077 #define CFG_LDAP_CLIENT_SEARCH_TIMEOUT_MIN 2000
00078
00079 extern int add_ld_session(char* _name, LDAP* _ldh, dictionary* _d);
00080 extern struct ld_session* get_ld_session(char* _name);
00081 extern int free_ld_sessions(void);
00082
00083 extern char* get_ini_key_name(char* _section, char* _key);
00084
00085 #endif
00086