]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/statd/statd.h
statd: Introduce statd version of matchhostname()
[nfs-utils.git] / utils / statd / statd.h
1 /* 
2  * Copyright (C) 1995-1997, 1999 Jeffrey A. Uphoff
3  * Modified by Olaf Kirch, Dec. 1996.
4  *
5  * NSM for Linux.
6  */
7
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11
12 #include "sm_inter.h"
13 #include "system.h"
14 #include "xlog.h"
15
16 /*
17  * Status definitions.
18  */
19 #define STAT_FAIL       stat_fail
20 #define STAT_SUCC       stat_succ
21
22 /*
23  * Function prototypes.
24  */
25 extern _Bool    statd_matchhostname(const char *hostname1, const char *hostname2);
26
27 extern void     my_svc_run(void);
28 extern void     notify_hosts(void);
29 extern void     shuffle_dirs(void);
30 extern int      statd_get_socket(void);
31 extern int      process_notify_list(void);
32 extern int      process_reply(FD_SET_TYPE *);
33 extern char *   xstrdup(const char *);
34 extern void *   xmalloc(size_t);
35 extern void     load_state(void);
36
37 /*
38  * Host status structure and macros.
39  */
40 stat_chge               SM_stat_chge;
41 #define MY_NAME         SM_stat_chge.mon_name
42 #define MY_STATE        SM_stat_chge.state
43
44 /*
45  * Some timeout values.  (Timeout values are in whole seconds.)
46  */
47 #define CALLBACK_TIMEOUT         3 /* For client call-backs. */
48 #define NOTIFY_TIMEOUT           5 /* For status-change notifications. */
49 #define SELECT_TIMEOUT          10 /* Max select() timeout when work to do. */
50 #define MAX_TRIES                5 /* Max number of tries for any host. */
51
52 /*
53  * Modes of operation - Lon
54  */
55 extern int run_mode;
56 #define MODE_NODAEMON 1         /* No-daemon/foreground mode. */
57 #define MODE_LOG_STDERR 2       /* in foreground mode, log to stderr */
58 #define MODE_NOTIFY_ONLY 4      /* Send SM_NOTIFY to everyone monitored on
59                                    a single interface/alias */
60 /* LH - notify_only mode would be for notifying hosts on an IP alias
61  * that just came back up, for ex, when failing over a HA service to
62  * another host.... */
63 #define STATIC_HOSTNAME 8       /* Always use the hostname set by -n */
64 #define MODE_NO_NOTIFY  16      /* Don't notify peers of a reboot */