void
nfsreply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length,
- register const u_char *bp2)
+ const u_char *bp, u_int length,
+ const u_char *bp2)
{
- register const struct sunrpc_msg *rp;
+ const struct sunrpc_msg *rp;
char srcid[20], dstid[20]; /*fits 32bit*/
nfserr = 0; /* assume no error */
void
nfsreply_noaddr_print(netdissect_options *ndo,
- register const u_char *bp, u_int length,
- register const u_char *bp2)
+ const u_char *bp, u_int length,
+ const u_char *bp2)
{
- register const struct sunrpc_msg *rp;
+ const struct sunrpc_msg *rp;
uint32_t proc, vers, reply_stat;
enum sunrpc_reject_stat rstat;
uint32_t rlow;
*/
static const uint32_t *
parsereq(netdissect_options *ndo,
- register const struct sunrpc_msg *rp, register u_int length)
+ const struct sunrpc_msg *rp, u_int length)
{
- register const uint32_t *dp;
- register u_int len;
+ const uint32_t *dp;
+ u_int len;
/*
* find the start of the req data (if we captured it)
len = EXTRACT_BE_U_4(dp + 1);
if (len < length) {
dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
- ND_TCHECK2(dp[0], 0);
+ ND_TCHECK_LEN(dp, 0);
return (dp);
}
}
*/
static const uint32_t *
parsefh(netdissect_options *ndo,
- register const uint32_t *dp, int v3)
+ const uint32_t *dp, int v3)
{
u_int len;
} else
len = NFSX_V2FH / 4;
- if (ND_TTEST2(*dp, len * sizeof(*dp))) {
+ if (ND_TTEST_LEN(dp, len * sizeof(*dp))) {
nfs_printfh(ndo, dp, len);
return (dp + len);
}
*/
static const uint32_t *
parsefn(netdissect_options *ndo,
- register const uint32_t *dp)
+ const uint32_t *dp)
{
- register uint32_t len;
- register const u_char *cp;
+ uint32_t len;
+ const u_char *cp;
/* Bail if we don't have the string length */
ND_TCHECK(*dp);
- /* Fetch string length; convert to host order */
- len = *dp++;
- NTOHL(len);
+ /* Fetch big-endian string length */
+ len = EXTRACT_BE_U_4(dp);
+ dp++;
- ND_TCHECK2(*dp, ((len + 3) & ~3));
+ ND_TCHECK_LEN(dp, ((len + 3) & ~3));
cp = (const u_char *)dp;
/* Update 32-bit pointer (NFS filenames padded to 32-bit boundaries) */
*/
static const uint32_t *
parsefhn(netdissect_options *ndo,
- register const uint32_t *dp, int v3)
+ const uint32_t *dp, int v3)
{
dp = parsefh(ndo, dp, v3);
if (dp == NULL)
void
nfsreq_noaddr_print(netdissect_options *ndo,
- register const u_char *bp, u_int length,
- register const u_char *bp2)
+ const u_char *bp, u_int length,
+ const u_char *bp2)
{
- register const struct sunrpc_msg *rp;
- register const uint32_t *dp;
+ const struct sunrpc_msg *rp;
+ const uint32_t *dp;
nfs_type type;
int v3;
uint32_t proc;
EXTRACT_BE_U_4(dp + 4),
EXTRACT_BE_U_8(dp)));
if (ndo->ndo_vflag)
- ND_PRINT((ndo, " verf %08x%08x", dp[2], dp[3]));
+ ND_PRINT((ndo, " verf %08x%08x",
+ EXTRACT_BE_U_4(dp + 2),
+ EXTRACT_BE_U_4(dp + 3)));
} else {
ND_TCHECK(dp[1]);
/*
if (ndo->ndo_vflag) {
ND_TCHECK(dp[5]);
ND_PRINT((ndo, " max %u verf %08x%08x",
- EXTRACT_BE_U_4(dp + 5), dp[2], dp[3]));
+ EXTRACT_BE_U_4(dp + 5),
+ EXTRACT_BE_U_4(dp + 2),
+ EXTRACT_BE_U_4(dp + 3)));
}
return;
}
*/
static void
nfs_printfh(netdissect_options *ndo,
- register const uint32_t *dp, const u_int len)
+ const uint32_t *dp, const u_int len)
{
my_fsid fsid;
uint32_t ino;
ND_PRINT((ndo, " fh["));
for (i=0; i<len; i++) {
- ND_PRINT((ndo, "%s%x", sep, dp[i]));
+ ND_PRINT((ndo, "%s%x", sep, EXTRACT_BE_U_4(dp + i)));
sep = ":";
}
ND_PRINT((ndo, "]"));
*/
static const uint32_t *
parserep(netdissect_options *ndo,
- register const struct sunrpc_msg *rp, register u_int length)
+ const struct sunrpc_msg *rp, u_int length)
{
- register const uint32_t *dp;
+ const uint32_t *dp;
u_int len;
enum sunrpc_accept_stat astat;
return (NULL);
}
/* successful return */
- ND_TCHECK2(*dp, sizeof(astat));
+ ND_TCHECK_LEN(dp, sizeof(astat));
return ((const uint32_t *) (sizeof(astat) + ((const char *)dp)));
trunc:
return (0);
return (0);
}
- ND_TCHECK2(*dp, (v3 ? NFSX_V3STATFS : NFSX_V2STATFS));
+ ND_TCHECK_LEN(dp, (v3 ? NFSX_V3STATFS : NFSX_V2STATFS));
sfsp = (const struct nfs_statfs *)dp;
ND_TCHECK(dp[2]);
ND_PRINT((ndo, " offset 0x%x size %d ",
EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)));
- if (dp[2] != 0)
+ if (EXTRACT_BE_U_4(dp + 2) != 0)
ND_PRINT((ndo, " eof"));
return (1);
if (!EXTRACT_BE_U_4(dp))
return (dp + 1);
dp++;
- ND_TCHECK2(*dp, 24);
+ ND_TCHECK_LEN(dp, 24);
if (verbose > 1) {
return parse_wcc_attr(ndo, dp);
} else {
return dp;
if (ndo->ndo_vflag) {
ND_TCHECK(dp[1]);
- ND_PRINT((ndo, " verf %08x%08x", dp[0], dp[1]));
+ ND_PRINT((ndo, " verf %08x%08x",
+ EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)));
dp += 2;
}
return dp;
interp_reply(netdissect_options *ndo,
const struct sunrpc_msg *rp, uint32_t proc, uint32_t vers, int length)
{
- register const uint32_t *dp;
- register int v3;
+ const uint32_t *dp;
+ int v3;
int er;
v3 = (vers == NFS_VER3);