option to multipath to not modify the bindinfs file
[platform/upstream/multipath-tools.git] / libmultipath / config.h
1 #ifndef _CONFIG_H
2 #define _CONFIG_H
3
4 #include <sys/types.h>
5 #include <stdint.h>
6
7 #define ORIGIN_DEFAULT 0
8 #define ORIGIN_CONFIG  1
9
10 enum devtypes {
11         DEV_NONE,
12         DEV_DEVT,
13         DEV_DEVNODE,
14         DEV_DEVMAP
15 };
16
17 struct hwentry {
18         char * vendor;
19         char * product;
20         char * revision;
21         char * getuid;
22         char * features;
23         char * hwhandler;
24         char * selector;
25         char * checker_name;
26         char * prio_name;
27         char * prio_args;
28         char * alias_prefix;
29
30         int pgpolicy;
31         int pgfailback;
32         int rr_weight;
33         int no_path_retry;
34         int minio;
35         int pg_timeout;
36         int flush_on_last_del;
37         int fast_io_fail;
38         unsigned int dev_loss;
39         char * bl_product;
40 };
41
42 struct mpentry {
43         char * wwid;
44         char * alias;
45         char * getuid;
46         char * selector;
47
48         int pgpolicy;
49         int pgfailback;
50         int rr_weight;
51         int no_path_retry;
52         int minio;
53         int pg_timeout;
54         int flush_on_last_del;
55         int attribute_flags;
56         uid_t uid;
57         gid_t gid;
58         mode_t mode;
59 };
60
61 struct config {
62         int verbosity;
63         int dry_run;
64         int list;
65         int pgpolicy_flag;
66         int with_sysfs;
67         int pgpolicy;
68         enum devtypes dev_type;
69         int minio;
70         int checkint;
71         int max_checkint;
72         int pgfailback;
73         int remove;
74         int rr_weight;
75         int no_path_retry;
76         int user_friendly_names;
77         int bindings_read_only;
78         int pg_timeout;
79         int max_fds;
80         int force_reload;
81         int queue_without_daemon;
82         int daemon;
83         int flush_on_last_del;
84         int attribute_flags;
85         int fast_io_fail;
86         unsigned int dev_loss;
87         uid_t uid;
88         gid_t gid;
89         mode_t mode;
90         uint32_t cookie;
91
92         char * dev;
93         char * sysfs_dir;
94         char * udev_dir;
95         char * multipath_dir;
96         char * selector;
97         char * getuid;
98         char * features;
99         char * hwhandler;
100         char * bindings_file;
101         char * prio_name;
102         char * prio_args;
103         char * checker_name;
104         char * alias_prefix;
105
106         vector keywords;
107         vector mptable;
108         vector hwtable;
109
110         vector blist_devnode;
111         vector blist_wwid;
112         vector blist_device;
113         vector elist_devnode;
114         vector elist_wwid;
115         vector elist_device;
116 };
117
118 struct config * conf;
119
120 struct hwentry * find_hwe (vector hwtable, char * vendor, char * product, char *revision);
121 struct mpentry * find_mpe (char * wwid);
122 char * get_mpe_wwid (char * alias);
123
124 struct hwentry * alloc_hwe (void);
125 struct mpentry * alloc_mpe (void);
126
127 void free_hwe (struct hwentry * hwe);
128 void free_hwtable (vector hwtable);
129 void free_mpe (struct mpentry * mpe);
130 void free_mptable (vector mptable);
131
132 int store_hwe (vector hwtable, struct hwentry *);
133
134 int load_config (char * file);
135 struct config * alloc_config (void);
136 void free_config (struct config * conf);
137
138 #endif