X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.h;h=5a6e2899c98f8e6fd41e22db171bb0e7318680b0;hp=77a179a3f9aa0c0a8eea5416e6f20cfb2bc6a419;hb=572efae32f6fb311dff0e065d0d1dd527db60d0c;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 diff --git a/utils/statd/statd.h b/utils/statd/statd.h index 77a179a..5a6e289 100644 --- a/utils/statd/statd.h +++ b/utils/statd/statd.h @@ -5,7 +5,10 @@ * NSM for Linux. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif + #include "sm_inter.h" #include "system.h" #include "log.h" @@ -14,13 +17,23 @@ * Paths and filenames. */ #if defined(NFS_STATEDIR) -# define DIR_BASE NFS_STATEDIR "/" +# define DEFAULT_DIR_BASE NFS_STATEDIR "/" #else -# define DIR_BASE "/var/lib/nfs/" +# define DEFAULT_DIR_BASE "/var/lib/nfs/" #endif -#define SM_DIR DIR_BASE "sm" -#define SM_BAK_DIR DIR_BASE "sm.bak" -#define SM_STAT_PATH DIR_BASE "state" + +#define DEFAULT_SM_DIR DEFAULT_DIR_BASE "sm" +#define DEFAULT_SM_BAK_DIR DEFAULT_DIR_BASE "sm.bak" +#define DEFAULT_SM_STAT_PATH DEFAULT_DIR_BASE "state" + +/* Added to support run-time specification of state directory path. + * j_carlos_gomez@yahoo.com + */ + +extern char * DIR_BASE; +extern char * SM_DIR; +extern char * SM_BAK_DIR; +extern char * SM_STAT_PATH; /* * Status definitions. @@ -32,15 +45,16 @@ * Function prototypes. */ extern void change_state(void); -extern void do_regist(u_long, void (*)()); extern void my_svc_run(void); extern void notify_hosts(void); extern void shuffle_dirs(void); +extern int statd_get_socket(void); extern int process_notify_list(void); extern int process_reply(FD_SET_TYPE *); extern char * xstrdup(const char *); extern void * xmalloc(size_t); extern void xunlink (char *, char *, short int); +extern void load_state(void); /* * Host status structure and macros. @@ -56,3 +70,24 @@ stat_chge SM_stat_chge; #define NOTIFY_TIMEOUT 5 /* For status-change notifications. */ #define SELECT_TIMEOUT 10 /* Max select() timeout when work to do. */ #define MAX_TRIES 5 /* Max number of tries for any host. */ + +/* + * Modes of operation - Lon + */ +extern int run_mode; +#define MODE_NODAEMON 1 /* No-daemon/foreground mode. */ +#define MODE_LOG_STDERR 2 /* in foreground mode, log to stderr */ +#define MODE_NOTIFY_ONLY 4 /* Send SM_NOTIFY to everyone monitored on + a single interface/alias */ +/* LH - notify_only mode would be for notifying hosts on an IP alias + * that just came back up, for ex, when failing over a HA service to + * another host.... */ +#define STATIC_HOSTNAME 8 /* Always use the hostname set by -n */ +#define MODE_NO_NOTIFY 16 /* Don't notify peers of a reboot */ +/* + * Program name and version pointers -- See statd.c for the reasoning + * as to why they're global. + */ +extern char *name_p; /* program basename */ +extern const char *version_p; /* program version */ +