|
|
4ae388 |
---
|
|
|
4ae388 |
multipathd/cli.c | 22 +++++++++++-----------
|
|
|
4ae388 |
multipathd/cli.h | 20 +++++++++++---------
|
|
|
4ae388 |
2 files changed, 22 insertions(+), 20 deletions(-)
|
|
|
4ae388 |
|
|
|
4ae388 |
Index: multipath-tools-130222/multipathd/cli.c
|
|
|
4ae388 |
===================================================================
|
|
|
4ae388 |
--- multipath-tools-130222.orig/multipathd/cli.c
|
|
|
4ae388 |
+++ multipath-tools-130222/multipathd/cli.c
|
|
|
4ae388 |
@@ -26,7 +26,7 @@ alloc_handler (void)
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
static int
|
|
|
4ae388 |
-add_key (vector vec, char * str, unsigned long code, int has_param)
|
|
|
4ae388 |
+add_key (vector vec, char * str, uint64_t code, int has_param)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
struct key * kw;
|
|
|
4ae388 |
|
|
|
4ae388 |
@@ -57,7 +57,7 @@ out:
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
int
|
|
|
4ae388 |
-add_handler (unsigned long fp, int (*fn)(void *, char **, int *, void *))
|
|
|
4ae388 |
+add_handler (uint64_t fp, int (*fn)(void *, char **, int *, void *))
|
|
|
4ae388 |
{
|
|
|
4ae388 |
struct handler * h;
|
|
|
4ae388 |
|
|
|
4ae388 |
@@ -79,7 +79,7 @@ add_handler (unsigned long fp, int (*fn)
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
static struct handler *
|
|
|
4ae388 |
-find_handler (unsigned long fp)
|
|
|
4ae388 |
+find_handler (uint64_t fp)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
int i;
|
|
|
4ae388 |
struct handler *h;
|
|
|
4ae388 |
@@ -92,7 +92,7 @@ find_handler (unsigned long fp)
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
int
|
|
|
4ae388 |
-set_handler_callback (unsigned long fp, int (*fn)(void *, char **, int *, void *))
|
|
|
4ae388 |
+set_handler_callback (uint64_t fp, int (*fn)(void *, char **, int *, void *))
|
|
|
4ae388 |
{
|
|
|
4ae388 |
struct handler * h = find_handler(fp);
|
|
|
4ae388 |
|
|
|
4ae388 |
@@ -293,11 +293,11 @@ out:
|
|
|
4ae388 |
return r;
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
-static unsigned long
|
|
|
4ae388 |
+static uint64_t
|
|
|
4ae388 |
fingerprint(vector vec)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
int i;
|
|
|
4ae388 |
- unsigned long fp = 0;
|
|
|
4ae388 |
+ uint64_t fp = 0;
|
|
|
4ae388 |
struct key * kw;
|
|
|
4ae388 |
|
|
|
4ae388 |
if (!vec)
|
|
|
4ae388 |
@@ -343,7 +343,7 @@ static int
|
|
|
4ae388 |
do_genhelp(char *reply, int maxlen) {
|
|
|
4ae388 |
int len = 0;
|
|
|
4ae388 |
int i, j;
|
|
|
4ae388 |
- unsigned long fp;
|
|
|
4ae388 |
+ uint64_t fp;
|
|
|
4ae388 |
struct handler * h;
|
|
|
4ae388 |
struct key * kw;
|
|
|
4ae388 |
|
|
|
4ae388 |
@@ -442,7 +442,7 @@ parse_cmd (char * cmd, char ** reply, in
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
char *
|
|
|
4ae388 |
-get_keyparam (vector v, unsigned long code)
|
|
|
4ae388 |
+get_keyparam (vector v, uint64_t code)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
struct key * kw;
|
|
|
4ae388 |
int i;
|
|
|
4ae388 |
@@ -515,7 +515,7 @@ void cli_exit(void)
|
|
|
4ae388 |
}
|
|
|
4ae388 |
|
|
|
4ae388 |
static int
|
|
|
4ae388 |
-key_match_fingerprint (struct key * kw, unsigned long fp)
|
|
|
4ae388 |
+key_match_fingerprint (struct key * kw, uint64_t fp)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
if (!fp)
|
|
|
4ae388 |
return 0;
|
|
|
4ae388 |
@@ -530,7 +530,7 @@ char *
|
|
|
4ae388 |
key_generator (const char * str, int state)
|
|
|
4ae388 |
{
|
|
|
4ae388 |
static int index, len, has_param;
|
|
|
4ae388 |
- static unsigned long rlfp;
|
|
|
4ae388 |
+ static uint64_t rlfp;
|
|
|
4ae388 |
struct key * kw;
|
|
|
4ae388 |
int i;
|
|
|
4ae388 |
struct handler *h;
|
|
|
4ae388 |
@@ -600,7 +600,7 @@ key_generator (const char * str, int sta
|
|
|
4ae388 |
* nfp is the candidate fingerprint we try to
|
|
|
4ae388 |
* validate against all known command fingerprints.
|
|
|
4ae388 |
*/
|
|
|
4ae388 |
- unsigned long nfp = rlfp | kw->code;
|
|
|
4ae388 |
+ uint64_t nfp = rlfp | kw->code;
|
|
|
4ae388 |
vector_foreach_slot(handlers, h, i) {
|
|
|
4ae388 |
if (!rlfp || ((h->fingerprint & nfp) == nfp)) {
|
|
|
4ae388 |
/*
|
|
|
4ae388 |
Index: multipath-tools-130222/multipathd/cli.h
|
|
|
4ae388 |
===================================================================
|
|
|
4ae388 |
--- multipath-tools-130222.orig/multipathd/cli.h
|
|
|
4ae388 |
+++ multipath-tools-130222/multipathd/cli.h
|
|
|
4ae388 |
@@ -1,3 +1,5 @@
|
|
|
4ae388 |
+#include <stdint.h>
|
|
|
4ae388 |
+
|
|
|
4ae388 |
enum {
|
|
|
4ae388 |
__LIST,
|
|
|
4ae388 |
__ADD,
|
|
|
4ae388 |
@@ -68,10 +70,10 @@ enum {
|
|
|
4ae388 |
#define WILDCARDS (1 << __WILDCARDS)
|
|
|
4ae388 |
#define QUIT (1 << __QUIT)
|
|
|
4ae388 |
#define SHUTDOWN (1 << __SHUTDOWN)
|
|
|
4ae388 |
-#define GETPRSTATUS (1UL << __GETPRSTATUS)
|
|
|
4ae388 |
-#define SETPRSTATUS (1UL << __SETPRSTATUS)
|
|
|
4ae388 |
-#define UNSETPRSTATUS (1UL << __UNSETPRSTATUS)
|
|
|
4ae388 |
-#define FMT (1UL << __FMT)
|
|
|
4ae388 |
+#define GETPRSTATUS (1ULL << __GETPRSTATUS)
|
|
|
4ae388 |
+#define SETPRSTATUS (1ULL << __SETPRSTATUS)
|
|
|
4ae388 |
+#define UNSETPRSTATUS (1ULL << __UNSETPRSTATUS)
|
|
|
4ae388 |
+#define FMT (1ULL << __FMT)
|
|
|
4ae388 |
|
|
|
4ae388 |
#define INITIAL_REPLY_LEN 1200
|
|
|
4ae388 |
|
|
|
4ae388 |
@@ -92,21 +94,21 @@ enum {
|
|
|
4ae388 |
struct key {
|
|
|
4ae388 |
char * str;
|
|
|
4ae388 |
char * param;
|
|
|
4ae388 |
- unsigned long code;
|
|
|
4ae388 |
+ uint64_t code;
|
|
|
4ae388 |
int has_param;
|
|
|
4ae388 |
};
|
|
|
4ae388 |
|
|
|
4ae388 |
struct handler {
|
|
|
4ae388 |
- unsigned long fingerprint;
|
|
|
4ae388 |
+ uint64_t fingerprint;
|
|
|
4ae388 |
int (*fn)(void *, char **, int *, void *);
|
|
|
4ae388 |
};
|
|
|
4ae388 |
|
|
|
4ae388 |
int alloc_handlers (void);
|
|
|
4ae388 |
-int add_handler (unsigned long fp, int (*fn)(void *, char **, int *, void *));
|
|
|
4ae388 |
-int set_handler_callback (unsigned long fp, int (*fn)(void *, char **, int *, void *));
|
|
|
4ae388 |
+int add_handler (uint64_t fp, int (*fn)(void *, char **, int *, void *));
|
|
|
4ae388 |
+int set_handler_callback (uint64_t fp, int (*fn)(void *, char **, int *, void *));
|
|
|
4ae388 |
int parse_cmd (char * cmd, char ** reply, int * len, void *);
|
|
|
4ae388 |
int load_keys (void);
|
|
|
4ae388 |
-char * get_keyparam (vector v, unsigned long code);
|
|
|
4ae388 |
+char * get_keyparam (vector v, uint64_t code);
|
|
|
4ae388 |
void free_keys (vector vec);
|
|
|
4ae388 |
void free_handlers (void);
|
|
|
4ae388 |
int cli_init (void);
|