File: globals.c

package info (click to toggle)
389-ds-base 2.3.1%2Bdfsg1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 37,536 kB
  • sloc: ansic: 306,972; python: 96,937; cpp: 10,257; perl: 2,854; makefile: 2,046; sh: 925; yacc: 806; xml: 379; lex: 366; javascript: 148; java: 50
file content (82 lines) | stat: -rw-r--r-- 2,094 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/** BEGIN COPYRIGHT BLOCK
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2005 Red Hat, Inc.
 * All rights reserved.
 *
 * License: GPL (version 3 or any later version).
 * See LICENSE for details.
 * END COPYRIGHT BLOCK **/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

/*
 *  Copyright (c) 1996 Regents of the University of Michigan.
 *  All rights reserved.
 *
 *  SLAPD globals.c -- SLAPD library global variables
 */

#include "ldap.h"
#include <sslproto.h> /* cipher suite names */

#undef OFF
#undef LITTLE_ENDIAN

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "slap.h"
#include "fe.h"

int should_detach = 0;
time_t starttime;
PRThread *listener_tid;
Slapi_PBlock *repl_pb = NULL;

/*
 * global variables that need mutex protection
 */
Slapi_Counter *num_conns;
Slapi_Counter *max_threads_count;
Slapi_Counter *conns_in_maxthreads;
Connection_Table *the_connection_table = NULL;

char *pid_file = "/dev/null";
char *start_pid_file = NULL;

char *attr_dataversion = ATTR_DATAVERSION;

extern void set_dll_entry_points(slapdEntryPoints *sep);
void
set_entry_points()
{
    slapdEntryPoints *sep;

    sep = (slapdEntryPoints *)slapi_ch_malloc(sizeof(slapdEntryPoints));
    sep->sep_ps_wakeup_all = (caddr_t)ps_wakeup_all;
    sep->sep_ps_service = (caddr_t)ps_service_persistent_searches;
    sep->sep_disconnect_server = (caddr_t)disconnect_server;
    sep->sep_slapd_ssl_init = (caddr_t)slapd_ssl_init;
    sep->sep_slapd_ssl_init2 = (caddr_t)slapd_ssl_init2;
    set_dll_entry_points(sep);

    /* To apply the nsslapd-counters config value properly,
       these values are initialized here after config file is read */
    if (config_get_slapi_counters()) {
        max_threads_count = slapi_counter_new();
        conns_in_maxthreads = slapi_counter_new();
    } else {
        max_threads_count = NULL;
        conns_in_maxthreads = NULL;
    }
}