]> git.sur5r.net Git - openldap/blob - servers/slurpd/globals.h
Happy new year! (belated)
[openldap] / servers / slurpd / globals.h
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1998-2008 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15 /* Portions Copyright (c) 1996 Regents of the University of Michigan.
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms are permitted
19  * provided that this notice is preserved and that due credit is given
20  * to the University of Michigan at Ann Arbor. The name of the University
21  * may not be used to endorse or promote products derived from this
22  * software without specific prior written permission. This software
23  * is provided ``as is'' without express or implied warranty.
24  */
25 /* ACKNOWLEDGEMENTS:
26  * This work was originally developed by the University of Michigan
27  * (as part of U-MICH LDAP).
28  */
29
30 #ifndef SLURPD_GLOBALS_H
31 #define SLURPD_GLOBALS_H 1
32
33 /*
34  * globals.h - definition of structure holding global data.
35  */
36
37 #include "slurp.h"
38
39 LDAP_BEGIN_DECL
40
41 typedef struct globals {
42     /* Thread ID for file manager thread */
43     ldap_pvt_thread_t fm_tid;
44     /* pipe/socket used to wake manager from signal handler */
45     int wake_sds[2];
46     /* The name of the slapd config file (which is also our config file) */
47     char *slapd_configfile;
48     /* How long the master slurpd sleeps when there's no work to do */
49     int no_work_interval;
50     /* We keep running until slurpd_shutdown is nonzero.  HUP signal set this */
51     sig_atomic_t slurpd_shutdown;
52     /* Number of replicas we're servicing */
53     int num_replicas;
54     /* Array of pointers to replica info */
55     Ri **replicas;
56     /* Directory where our replica files are written/read */
57     char *slurpd_rdir;
58     /* Name of slurpd status file (timestamp of last replog */
59     char slurpd_status_file[ MAXPATHLEN ];
60     /* Name of the replication log slapd is writing (and we are reading) */
61     char slapd_replogfile[ MAXPATHLEN ];
62     /* Name of local copy of replogfile we maintain */
63     char slurpd_replogfile[ MAXPATHLEN ];
64     /* Non-zero if we were given a replog file to process on command-line */
65     int one_shot_mode;
66     /* Non-zero if we should not detach the process */
67     int no_detach;
68     /* Name of program */
69     char *myname;
70     /* NT service name */
71     char *serverName;
72     /* Current offset into slurpd replica logfile */
73     off_t srpos;
74     /* mutex to serialize access to reject file */
75     ldap_pvt_thread_mutex_t rej_mutex;
76     /* pointer to status struct */
77     St  *st;
78     /* Pointer to replication queue */
79     Rq *rq;
80 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
81     /* Default name of kerberos srvtab file */
82     char *default_srvtab;
83 #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
84     /* Non-zero if we shall print the version */
85     int version;
86 } Globals;
87
88
89 extern Globals *sglob;
90
91 LDAP_END_DECL
92
93 #endif /* SLURPD_GLOBALS_H */