2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * translate between inode numbers and contents.
13 #include <afsconfig.h>
14 #include <afs/param.h>
18 #include <sys/types.h>
19 #include "util/afsutil.h"
24 printf("Usage: nino <-i ino> | <-c uniq tag vno> | <-a ino_base64>\n");
28 void do_contents(int ac, char **av);
29 void do_ino(int ac, char **av);
30 void do_inobase64(int ac, char **av);
33 main(int ac, char **av)
38 if (!strcmp("-c", av[1]))
40 else if (!strcmp("-i", av[1]))
42 else if (!strcmp("-a", av[1]))
49 do_contents(int ac, char **av)
52 int64_t vno, tag, uniq;
57 printf("Bad argument count for -c option.\n");
61 vno = (int64_t) atoi(av[4]);
63 tag = (int64_t) atoi(av[3]);
65 uniq = (int64_t) atoi(av[2]);
70 int64_to_flipbase64(str, ino);
72 printf("ino=%Lu, base64=%s\n", ino, str);
77 do_ino(int ac, char **av)
86 printf("Bad argument count for -i option.\n");
91 sscanf(av[2], "%qu", &ino);
92 printf("%Lu %Lu %Lu\n", ino, ino1, ino2);
97 int64_to_flipbase64(str, ino);
98 printf("ino=%Lu, vno=%d, tag=%u, uniq=%u, base64=%s\n", ino, vno,
99 (int)((ino >> 26) & 0x7), (int)((ino >> 32) & 0xffffffff), str);
104 do_inobase64(int ac, char **av)
113 printf("Bad argument count for -a option.\n");
117 ino = flipbase64_to_int64(av[2]);
120 if (vno == 0x3ffffff)
122 printf("ino=%Lu, vno=%d, tag=%u, uniq=%u\n", ino, vno,
123 (int)((ino >> 26) & 0x7), (int)((ino >> 32) & 0xffffffff));