{'s', "selector", 0, snprint_pg_selector},
{'p', "pri", 0, snprint_pg_pri},
{'t', "dm_st", 0, snprint_pg_state},
+ {0, NULL, 0 , NULL}
};
+int
+snprint_wildcards (char * buff, int len)
+{
+ int i, fwd = 0;
+
+ fwd += snprintf(buff + fwd, len - fwd, "multipath format wildcards:\n");
+ for (i = 0; mpd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ mpd[i].wildcard, mpd[i].header);
+ fwd += snprintf(buff + fwd, len - fwd, "\npath format wildcards:\n");
+ for (i = 0; pd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ pd[i].wildcard, pd[i].header);
+ fwd += snprintf(buff + fwd, len - fwd, "\npathgroup format wildcards:\n");
+ for (i = 0; pgd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ pgd[i].wildcard, pgd[i].header);
+ return fwd;
+}
+
void
get_path_layout (vector pathvec, int header)
{
int snprint_blacklist (char *, int);
int snprint_blacklist_except (char *, int);
int snprint_blacklist_report (char *, int);
+int snprint_wildcards (char *, int);
int snprint_status (char *, int, struct vectors *);
int snprint_devices (char *, int, struct vectors *);
int snprint_hwtable (char *, int, vector);
r += add_key(keys, "blacklist", BLACKLIST, 0);
r += add_key(keys, "devices", DEVICES, 0);
r += add_key(keys, "format", FMT, 1);
+ r += add_key(keys, "wildcards", WILDCARDS, 0);
if (r) {
free_keys(keys);
add_handler(LIST+CONFIG, NULL);
add_handler(LIST+BLACKLIST, NULL);
add_handler(LIST+DEVICES, NULL);
+ add_handler(LIST+WILDCARDS, NULL);
add_handler(ADD+PATH, NULL);
add_handler(DEL+PATH, NULL);
add_handler(ADD+MAP, NULL);
__BLACKLIST,
__DEVICES,
__FMT,
+ __WILDCARDS,
};
#define LIST (1 << __LIST)
#define BLACKLIST (1 << __BLACKLIST)
#define DEVICES (1 << __DEVICES)
#define FMT (1 << __FMT)
+#define WILDCARDS (1 << __WILDCARDS)
#define INITIAL_REPLY_LEN 1000
}
int
+cli_list_wildcards (void * v, char ** reply, int * len, void * data)
+{
+ char * c;
+
+ *reply = MALLOC(INITIAL_REPLY_LEN);
+
+ if (!reply)
+ return 1;
+
+ c = *reply;
+ c += snprint_wildcards(c, INITIAL_REPLY_LEN);
+
+ *len = INITIAL_REPLY_LEN;
+ return 0;
+}
+
+int
show_status (char ** r, int *len, struct vectors * vecs)
{
char * c;
int cli_list_config (void * v, char ** reply, int * len, void * data);
int cli_list_blacklist (void * v, char ** reply, int * len, void * data);
int cli_list_devices (void * v, char ** reply, int * len, void * data);
+int cli_list_wildcards (void * v, char ** reply, int * len, void * data);
int cli_add_path (void * v, char ** reply, int * len, void * data);
int cli_del_path (void * v, char ** reply, int * len, void * data);
int cli_add_map (void * v, char ** reply, int * len, void * data);
set_handler_callback(LIST+CONFIG, cli_list_config);
set_handler_callback(LIST+BLACKLIST, cli_list_blacklist);
set_handler_callback(LIST+DEVICES, cli_list_devices);
+ set_handler_callback(LIST+WILDCARDS, cli_list_wildcards);
set_handler_callback(ADD+PATH, cli_add_path);
set_handler_callback(DEL+PATH, cli_del_path);
set_handler_callback(ADD+MAP, cli_add_map);