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