summaryrefslogtreecommitdiffstats
path: root/ldap/include/ntwatchdog.h
blob: 7c652b2d188c454c79860ddab3cc712b42865792 (plain)
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
/** BEGIN COPYRIGHT BLOCK
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2005 Red Hat, Inc.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/
/******************************************************
 *
 *
 *  ntwatchdog.h - Defs for NT Watchdog Service.
 *
 ******************************************************/

#if defined( _WIN32 )

#if !defined( _NTWATCHDOG_H_ )
#define	_NTWATCHDOG_H_

#define FILE_PATHSEP '/'

#define SLAPD_ROOT             "SLAPD_ROOT"   // environment variable holding server root path
#define MORTALITY_KEY          "MortalityTimeSecs"
#define MINRAMFREE_KEY         "MinRamFree"
#define MINRAMTOTAL_KEY        "MinRamTotal"
#define MINRAMPERSERVER_KEY    "MinRamPerServer"
#define DEFAULT_MORTALITY_TIME  60              // seconds after startup up until server will NOT be restarted
#define DEFAULT_KILL_TIME       600             // seconds to wait for httpd.exe to shutdown
#define DEFAULT_CRON_TIME       60              // seconds to wait before rechecking cron.conf
#define DEFAULT_RESTART_TIME    10              // seconds to wait before restarting server
#define DEFAULT_MINRAMFREE      0               // KB free physical memory remaining
#define DEFAULT_MINRAMTOTAL     (30 * 1024)     // KB free physical memory installed
#define DEFAULT_MINRAMPERSERVER (15 * 1024)     // KB free physical memory per server

#define MSG_RESOURCES         "Not enough physical memory to start server."

// offsets for extra window bytes, used in Set/GetWindowLong()
#define GWL_PROCESS_HANDLE  (sizeof(LONG) * 0)
#define GWL_PASSWORD_ADDR   (sizeof(LONG) * 1)
#define GWL_PASSWORD_LENGTH (sizeof(LONG) * 2)

#define MAX_LINE      512
#define MAX_PASSWORD  256
#define MAX_TOKENNAME 50

typedef struct PK11_PIN
{
	char TokenName[MAX_TOKENNAME];
	int  TokenLength;
	char Password[MAX_PASSWORD];
	int  PasswordLength;
}PK11_PIN;

#define CLOSEHANDLE(X) \
{ \
	if(X) \
	{ \
		CloseHandle(X); \
		X = 0; \
	} \
}

// in ntcron.c
LPTHREAD_START_ROUTINE CRON_ThreadProc(HANDLE hevWatchDogExit);

// in watchdog.c
BOOL WD_SysLog(WORD fwEventType, DWORD IDEvent, char *szData);

#endif /* _NTWATCHDOG_H_ */
#endif /* _WIN32 */