X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/abc8c2d61c65757011d9d32abb01cd1e51232f3a..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-rx.c?ds=sidebyside diff --git a/print-rx.c b/print-rx.c index 7dfa3ddb..3641a4c7 100644 --- a/print-rx.c +++ b/print-rx.c @@ -35,12 +35,9 @@ * Ken Hornstein */ -#ifdef HAVE_CONFIG_H #include -#endif #include -#include #include #include "netdissect-stdinc.h" @@ -442,17 +439,17 @@ static const char *voltype[] = { "read-write", "read-only", "backup" }; static const struct tok afs_fs_errors[] = { { 101, "salvage volume" }, - { 102, "no such vnode" }, - { 103, "no such volume" }, - { 104, "volume exist" }, - { 105, "no service" }, - { 106, "volume offline" }, - { 107, "voline online" }, - { 108, "diskfull" }, - { 109, "diskquota exceeded" }, - { 110, "volume busy" }, - { 111, "volume moved" }, - { 112, "AFS IO error" }, + { 102, "no such vnode" }, + { 103, "no such volume" }, + { 104, "volume exist" }, + { 105, "no service" }, + { 106, "volume offline" }, + { 107, "voline online" }, + { 108, "diskfull" }, + { 109, "diskquota exceeded" }, + { 110, "volume busy" }, + { 111, "volume moved" }, + { 112, "AFS IO error" }, { 0xffffff9c, "restarting fileserver" }, /* -100, sic! */ { 0, NULL } }; @@ -500,7 +497,7 @@ static int rx_cache_find(netdissect_options *, const struct rx_header *, static void fs_print(netdissect_options *, const u_char *, u_int); static void fs_reply_print(netdissect_options *, const u_char *, u_int, uint32_t); -static void acl_print(netdissect_options *, u_char *, u_char *); +static void acl_print(netdissect_options *, u_char *, const u_char *); static void cb_print(netdissect_options *, const u_char *, u_int); static void cb_reply_print(netdissect_options *, const u_char *, u_int, uint32_t); static void prot_print(netdissect_options *, const u_char *, u_int); @@ -766,7 +763,6 @@ rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh, } #define STROUT(MAX) { uint32_t _i; \ - ND_TCHECK_LEN(bp, sizeof(uint32_t)); \ _i = GET_BE_U_4(bp); \ if (_i > (MAX)) \ goto trunc; \ @@ -791,18 +787,17 @@ rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh, } #define UINT64OUT() { uint64_t _i; \ - ND_TCHECK_LEN(bp, sizeof(uint64_t)); \ _i = GET_BE_U_8(bp); \ bp += sizeof(uint64_t); \ ND_PRINT(" %" PRIu64, _i); \ } -#define DATEOUT() { time_t _t; struct tm *tm; char str[256]; \ +#define DATEOUT() { time_t _t; char str[256]; \ _t = (time_t) GET_BE_S_4(bp); \ bp += sizeof(int32_t); \ - tm = localtime(&_t); \ - strftime(str, 256, "%Y/%m/%d %H:%M:%S", tm); \ - ND_PRINT(" %s", str); \ + ND_PRINT(" %s", \ + nd_format_time(str, sizeof(str), \ + "%Y-%m-%d %H:%M:%S", localtime(&_t))); \ } #define STOREATTROUT() { uint32_t mask, _i; \ @@ -1143,11 +1138,12 @@ trunc: * representing a logical OR of all the ACL permission bits */ +#define XSTRINGIFY(x) #x #define NUMSTRINGIFY(x) XSTRINGIFY(x) static void acl_print(netdissect_options *ndo, - u_char *s, u_char *end) + u_char *s, const u_char *end) { int pos, neg, acl; int n, i;