2 * Copyright (C) 1995-1997, 1999 Jeffrey A. Uphoff
3 * Modified by Olaf Kirch, Dec. 1996.
17 * Paths and filenames.
19 #if defined(NFS_STATEDIR)
20 # define DEFAULT_DIR_BASE NFS_STATEDIR "/"
22 # define DEFAULT_DIR_BASE "/var/lib/nfs/"
25 #define DEFAULT_SM_DIR DEFAULT_DIR_BASE "sm"
26 #define DEFAULT_SM_BAK_DIR DEFAULT_DIR_BASE "sm.bak"
27 #define DEFAULT_SM_STAT_PATH DEFAULT_DIR_BASE "state"
29 /* Added to support run-time specification of state directory path.
30 * j_carlos_gomez@yahoo.com
33 extern char * DIR_BASE;
35 extern char * SM_BAK_DIR;
36 extern char * SM_STAT_PATH;
41 #define STAT_FAIL stat_fail
42 #define STAT_SUCC stat_succ
45 * Function prototypes.
47 extern void change_state(void);
48 extern void my_svc_run(void);
49 extern void notify_hosts(void);
50 extern void shuffle_dirs(void);
51 extern int process_notify_list(void);
52 extern int process_reply(FD_SET_TYPE *);
53 extern char * xstrdup(const char *);
54 extern void * xmalloc(size_t);
55 extern void xunlink (char *, char *, short int);
56 extern void load_state(void);
59 * Host status structure and macros.
61 stat_chge SM_stat_chge;
62 #define MY_NAME SM_stat_chge.mon_name
63 #define MY_STATE SM_stat_chge.state
66 * Some timeout values. (Timeout values are in whole seconds.)
68 #define CALLBACK_TIMEOUT 3 /* For client call-backs. */
69 #define NOTIFY_TIMEOUT 5 /* For status-change notifications. */
70 #define SELECT_TIMEOUT 10 /* Max select() timeout when work to do. */
71 #define MAX_TRIES 5 /* Max number of tries for any host. */
74 * Modes of operation - Lon
77 #define MODE_NODAEMON 1 /* No-daemon/foreground mode. */
78 #define MODE_LOG_STDERR 2 /* in foreground mode, log to stderr */
79 #define MODE_NOTIFY_ONLY 4 /* Send SM_NOTIFY to everyone monitored on
80 a single interface/alias */
81 /* LH - notify_only mode would be for notifying hosts on an IP alias
82 * that just came back up, for ex, when failing over a HA service to
84 #define STATIC_HOSTNAME 8 /* Always use the hostname set by -n */
85 #define MODE_NO_NOTIFY 16 /* Don't notify peers of a reboot */
87 * Program name and version pointers -- See statd.c for the reasoning
88 * as to why they're global.
90 extern char *name_p; /* program basename */
91 extern const char *version_p; /* program version */