Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nfs-utils / utils / statd / statd.h
blob88ba2080d76e9fbfe2e56d9a0d18663de017f2eb
1 /*
2 * Copyright (C) 1995-1997, 1999 Jeffrey A. Uphoff
3 * Modified by Olaf Kirch, Dec. 1996.
5 * NSM for Linux.
6 */
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
12 #include "sm_inter.h"
13 #include "system.h"
14 #include "log.h"
17 * Paths and filenames.
19 #if defined(NFS_STATEDIR)
20 # define DEFAULT_DIR_BASE NFS_STATEDIR "/"
21 #else
22 # define DEFAULT_DIR_BASE "/var/lib/nfs/"
23 #endif
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;
34 extern char * SM_DIR;
35 extern char * SM_BAK_DIR;
36 extern char * SM_STAT_PATH;
39 * Status definitions.
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 statd_get_socket(void);
52 extern int process_notify_list(void);
53 extern int process_reply(FD_SET_TYPE *);
54 extern char * xstrdup(const char *);
55 extern void * xmalloc(size_t);
56 extern void xunlink (char *, char *);
57 extern void load_state(void);
60 * Host status structure and macros.
62 stat_chge SM_stat_chge;
63 #define MY_NAME SM_stat_chge.mon_name
64 #define MY_STATE SM_stat_chge.state
67 * Some timeout values. (Timeout values are in whole seconds.)
69 #define CALLBACK_TIMEOUT 3 /* For client call-backs. */
70 #define NOTIFY_TIMEOUT 5 /* For status-change notifications. */
71 #define SELECT_TIMEOUT 10 /* Max select() timeout when work to do. */
72 #define MAX_TRIES 5 /* Max number of tries for any host. */
75 * Modes of operation - Lon
77 extern int run_mode;
78 #define MODE_NODAEMON 1 /* No-daemon/foreground mode. */
79 #define MODE_LOG_STDERR 2 /* in foreground mode, log to stderr */
80 #define MODE_NOTIFY_ONLY 4 /* Send SM_NOTIFY to everyone monitored on
81 a single interface/alias */
82 /* LH - notify_only mode would be for notifying hosts on an IP alias
83 * that just came back up, for ex, when failing over a HA service to
84 * another host.... */
85 #define STATIC_HOSTNAME 8 /* Always use the hostname set by -n */
86 #define MODE_NO_NOTIFY 16 /* Don't notify peers of a reboot */
88 * Program name and version pointers -- See statd.c for the reasoning
89 * as to why they're global.
91 extern char *name_p; /* program basename */
92 extern const char *version_p; /* program version */