2 * Copyright (C) 1995-1997, 1999 Jeffrey A. Uphoff
3 * Modified by Olaf Kirch, Dec. 1996.
14 * Paths and filenames.
16 #if defined(NFS_STATEDIR)
17 # define DEFAULT_DIR_BASE NFS_STATEDIR "/"
19 # define DEFAULT_DIR_BASE "/var/lib/nfs/"
22 #define DEFAULT_SM_DIR DEFAULT_DIR_BASE "sm"
23 #define DEFAULT_SM_BAK_DIR DEFAULT_DIR_BASE "sm.bak"
24 #define DEFAULT_SM_STAT_PATH DEFAULT_DIR_BASE "state"
26 /* Added to support run-time specification of state directory path.
27 * j_carlos_gomez@yahoo.com
30 extern char * DIR_BASE;
32 extern char * SM_BAK_DIR;
33 extern char * SM_STAT_PATH;
38 #define STAT_FAIL stat_fail
39 #define STAT_SUCC stat_succ
42 * Function prototypes.
44 extern void change_state(void);
45 extern void do_regist(u_long, void (*)());
46 extern void my_svc_run(void);
47 extern void notify_hosts(void);
48 extern void shuffle_dirs(void);
49 extern int process_notify_list(void);
50 extern int process_reply(FD_SET_TYPE *);
51 extern char * xstrdup(const char *);
52 extern void * xmalloc(size_t);
53 extern void xunlink (char *, char *, short int);
56 * Host status structure and macros.
58 stat_chge SM_stat_chge;
59 #define MY_NAME SM_stat_chge.mon_name
60 #define MY_STATE SM_stat_chge.state
63 * Some timeout values. (Timeout values are in whole seconds.)
65 #define CALLBACK_TIMEOUT 3 /* For client call-backs. */
66 #define NOTIFY_TIMEOUT 5 /* For status-change notifications. */
67 #define SELECT_TIMEOUT 10 /* Max select() timeout when work to do. */
68 #define MAX_TRIES 5 /* Max number of tries for any host. */
71 * Modes of operation - Lon
74 #define MODE_NODAEMON 1 /* No-daemon/foreground mode. */
75 #define MODE_LOG_STDERR 2 /* in foreground mode, log to stderr */
76 #define MODE_NOTIFY_ONLY 4 /* Send SM_NOTIFY to everyone monitored on
77 a single interface/alias */
78 /* LH - notify_only mode would be for notifying hosts on an IP alias
79 * that just came back up, for ex, when failing over a HA service to
83 * Program name and version pointers -- See statd.c for the reasoning
84 * as to why they're global.
86 extern char *name_p; /* program basename */
87 extern char *version_p; /* program version */
89 extern int re_notify; /* time to re-read notify list */