globals.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. /*
  13. * Copyright (c) 1996 Regents of the University of Michigan.
  14. * All rights reserved.
  15. *
  16. * SLAPD globals.c -- SLAPD library global variables
  17. */
  18. #include "ldap.h"
  19. #include <sslproto.h> /* cipher suite names */
  20. #undef OFF
  21. #undef LITTLE_ENDIAN
  22. #include <stdio.h>
  23. #include <string.h>
  24. #include <sys/types.h>
  25. #include <time.h>
  26. #include <stdarg.h>
  27. #include <stdlib.h>
  28. #include <sys/time.h>
  29. #include <sys/socket.h>
  30. #include <netinet/in.h>
  31. #include <arpa/inet.h>
  32. #include <netdb.h>
  33. #include "slap.h"
  34. #include "fe.h"
  35. int should_detach = 1;
  36. time_t starttime;
  37. PRThread *listener_tid;
  38. Slapi_PBlock *repl_pb = NULL;
  39. /*
  40. * global variables that need mutex protection
  41. */
  42. Slapi_Counter *ops_initiated;
  43. Slapi_Counter *ops_completed;
  44. Slapi_Counter *num_conns;
  45. Slapi_Counter *max_threads_count;
  46. Slapi_Counter *conns_in_maxthreads;
  47. Connection_Table *the_connection_table = NULL;
  48. char *pid_file = "/dev/null";
  49. char *start_pid_file = "/dev/null";
  50. char *attr_dataversion = ATTR_DATAVERSION;
  51. extern void set_dll_entry_points( slapdEntryPoints *sep );
  52. void
  53. set_entry_points()
  54. {
  55. slapdEntryPoints *sep;
  56. sep = (slapdEntryPoints *) slapi_ch_malloc( sizeof( slapdEntryPoints ));
  57. sep->sep_ps_wakeup_all = (caddr_t)ps_wakeup_all;
  58. sep->sep_ps_service = (caddr_t)ps_service_persistent_searches;
  59. sep->sep_disconnect_server = (caddr_t)disconnect_server;
  60. sep->sep_slapd_ssl_init = (caddr_t)slapd_ssl_init;
  61. sep->sep_slapd_ssl_init2 = (caddr_t)slapd_ssl_init2;
  62. set_dll_entry_points( sep );
  63. /* To apply the nsslapd-counters config value properly,
  64. these values are initialized here after config file is read */
  65. if (config_get_slapi_counters()) {
  66. ops_initiated = slapi_counter_new();
  67. ops_completed = slapi_counter_new();
  68. max_threads_count = slapi_counter_new();
  69. conns_in_maxthreads = slapi_counter_new();
  70. g_set_num_entries_sent( slapi_counter_new() );
  71. g_set_num_bytes_sent( slapi_counter_new() );
  72. } else {
  73. ops_initiated = NULL;
  74. ops_completed = NULL;
  75. max_threads_count = NULL;
  76. conns_in_maxthreads = NULL;
  77. g_set_num_entries_sent( NULL );
  78. g_set_num_bytes_sent( NULL );
  79. }
  80. }