Imported Upstream version 0.8.9
[platform/upstream/multipath-tools.git] / multipathd / main.h
1 #ifndef MAIN_H
2 #define MAIN_H
3
4 #define MAPGCINT 5
5
6 enum daemon_status {
7         DAEMON_INIT = 0,
8         DAEMON_START,
9         DAEMON_CONFIGURE,
10         DAEMON_IDLE,
11         DAEMON_RUNNING,
12         DAEMON_SHUTDOWN,
13         DAEMON_STATUS_SIZE,
14 };
15
16 enum remove_path_result {
17         REMOVE_PATH_FAILURE = 0x0, /* path could not be removed. It is still
18                                     * part of the kernel map, but its state
19                                     * is set to INIT_REMOVED, and it will be
20                                     * removed at the next possible occasion */
21         REMOVE_PATH_SUCCESS = 0x1, /* path was removed */
22         REMOVE_PATH_DELAY = 0x2, /* path is set to be removed later. it
23                                   * currently still exists and is part of the
24                                   * kernel map */
25         REMOVE_PATH_MAP_ERROR = 0x5, /* map was removed because of error. value
26                                       * includes REMOVE_PATH_SUCCESS bit
27                                       * because the path was also removed */
28 };
29
30 extern pid_t daemon_pid;
31 extern int uxsock_timeout;
32
33 void exit_daemon(void);
34 const char * daemon_status(void);
35 enum daemon_status wait_for_state_change_if(enum daemon_status oldstate,
36                                             unsigned long ms);
37 void schedule_reconfigure(enum force_reload_types requested_type);
38 int need_to_delay_reconfig (struct vectors *);
39 int ev_add_path (struct path *, struct vectors *, int);
40 int ev_remove_path (struct path *, struct vectors *, int);
41 int ev_add_map (char *, const char *, struct vectors *);
42 int ev_remove_map (char *, char *, int, struct vectors *);
43 int flush_map(struct multipath *, struct vectors *, int);
44
45 void handle_signals(bool);
46 int __setup_multipath (struct vectors * vecs, struct multipath * mpp,
47                        int reset);
48 #define setup_multipath(vecs, mpp) __setup_multipath(vecs, mpp, 1)
49 int update_multipath (struct vectors *vecs, char *mapname, int reset);
50 int reload_and_sync_map(struct multipath *mpp, struct vectors *vecs,
51                         int refresh);
52
53 void handle_path_wwid_change(struct path *pp, struct vectors *vecs);
54 bool check_path_wwid_change(struct path *pp);
55 int finish_path_init(struct path *pp, struct vectors * vecs);
56 #endif /* MAIN_H */