#include <stdio.h>
#include <string.h>
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
*/
#define SUNRPC_PMAPPORT ((uint16_t)111)
-#define SUNRPC_PMAPPROG ((uint32_t)100000)
-#define SUNRPC_PMAPVERS ((uint32_t)2)
-#define SUNRPC_PMAPVERS_PROTO ((uint32_t)2)
-#define SUNRPC_PMAPVERS_ORIG ((uint32_t)1)
#define SUNRPC_PMAPPROC_NULL ((uint32_t)0)
#define SUNRPC_PMAPPROC_SET ((uint32_t)1)
#define SUNRPC_PMAPPROC_UNSET ((uint32_t)2)
ND_PRINT(" %s", tok2str(proc2str, " proc #%u",
GET_BE_U_4(rp->rm_call.cb_proc)));
x = GET_BE_U_4(rp->rm_call.cb_rpcvers);
- if (x != 2)
+ if (x != SUNRPC_MSG_VERSION)
ND_PRINT(" [rpcver %u]", x);
switch (GET_BE_U_4(rp->rm_call.cb_proc)) {
ND_PRINT(".%u", GET_BE_U_4(rp->rm_call.cb_vers));
break;
}
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
static char *
return (buf);
#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
rp = getrpcbynumber(prog);
- if (rp == NULL)
-#endif
- (void) snprintf(buf, sizeof(buf), "#%u", prog);
-#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
- else
+ if (rp != NULL)
strlcpy(buf, rp->r_name, sizeof(buf));
+ else
#endif
+ (void) snprintf(buf, sizeof(buf), "#%u", prog);
+ lastprog = prog;
return (buf);
}
nd_uint32_t oa_len; /* length of opaque body */
/* zero or more bytes of body */
};
-
-#define SUNRPC_AUTH_NONE 0 /* no authentication */
-#define SUNRPC_AUTH_NULL 0 /* backward compatibility */
-#define SUNRPC_AUTH_UNIX 1 /* unix style (uid, gids) */
-#define SUNRPC_AUTH_SYS 1 /* forward compatibility */
-#define SUNRPC_AUTH_SHORT 2 /* short hand unix style */
-#define SUNRPC_AUTH_DES 3 /* des style (encrypted timestamps) */