[build] minor compilation issues
[platform/upstream/multipath-tools.git] / libmultipath / config.h
1 #ifndef _CONFIG_H
2 #define _CONFIG_H
3
4 enum devtypes {
5         DEV_NONE,
6         DEV_DEVT,
7         DEV_DEVNODE,
8         DEV_DEVMAP
9 };
10
11 struct hwentry {
12         char * vendor;
13         char * product;
14         char * getuid;
15         char * getprio;
16         char * features;
17         char * hwhandler;
18         char * selector;
19         char * checker_name;
20
21         int pgpolicy;
22         int pgfailback;
23         int rr_weight;
24         int no_path_retry;
25         int minio;
26         struct checker * checker;
27         char * bl_product;
28 };
29
30 struct mpentry {
31         char * wwid;
32         char * alias;
33         char * getuid;
34         char * selector;
35
36         int pgpolicy;
37         int pgfailback;
38         int rr_weight;
39         int no_path_retry;
40         int minio;
41 };
42
43 struct config {
44         int verbosity;
45         int dry_run;
46         int list;
47         int pgpolicy_flag;
48         int with_sysfs;
49         int pgpolicy;
50         struct checker * checker;
51         enum devtypes dev_type;
52         int minio;
53         int checkint;
54         int max_checkint;
55         int pgfailback;
56         int remove;
57         int rr_weight;
58         int no_path_retry;
59         int user_friendly_names;
60
61         char * dev;
62         char * udev_dir;
63         char * selector;
64         char * getuid;
65         char * getprio;
66         char * features;
67         char * hwhandler;
68         char * bindings_file;
69
70         vector mptable;
71         vector hwtable;
72
73         vector blist_devnode;
74         vector blist_wwid;
75         vector blist_device;
76 };
77
78 struct config * conf;
79
80 struct hwentry * find_hwe (vector hwtable, char * vendor, char * product);
81 struct mpentry * find_mpe (char * wwid);
82 char * get_mpe_wwid (char * alias);
83
84 struct mpentry * alloc_mpe (void);
85
86 void free_hwe (struct hwentry * hwe);
87 void free_hwtable (vector hwtable);
88 void free_mpe (struct mpentry * mpe);
89 void free_mptable (vector mptable);
90
91 int store_hwe (vector hwtable, struct hwentry *);
92
93 int load_config (char * file);
94 struct config * alloc_config (void);
95 void free_config (struct config * conf);
96
97 #endif