Lines Matching refs:dp

55 static int print_int64(const u_int32_t *dp, int how);
177 static int print_int64(const u_int32_t *dp, int how)
182 TCHECK(dp[1]);
183 res = ((u_int64_t)ntohl(dp[0]) << 32) | (u_int64_t)ntohl(dp[1]);
202 TCHECK(dp[1]);
203 if (dp[0])
204 printf("0x%x%08x", (u_int32_t)ntohl(dp[0]),
205 (u_int32_t)ntohl(dp[1]));
207 printf("0x%x", (u_int32_t)ntohl(dp[1]));
220 parse_sattr3(const u_int32_t *dp, struct nfsv3_sattr *sa3)
222 TCHECK(dp[0]);
223 if ((sa3->sa_modeset = ntohl(*dp++))) {
224 TCHECK(dp[0]);
225 sa3->sa_mode = ntohl(*dp++);
228 TCHECK(dp[0]);
229 if ((sa3->sa_uidset = ntohl(*dp++))) {
230 TCHECK(dp[0]);
231 sa3->sa_uid = ntohl(*dp++);
234 TCHECK(dp[0]);
235 if ((sa3->sa_gidset = ntohl(*dp++))) {
236 TCHECK(dp[0]);
237 sa3->sa_gid = ntohl(*dp++);
240 TCHECK(dp[0]);
241 if ((sa3->sa_sizeset = ntohl(*dp++))) {
242 TCHECK(dp[0]);
243 sa3->sa_size = ntohl(*dp++);
246 TCHECK(dp[0]);
247 if ((sa3->sa_atimetype = ntohl(*dp++)) == NFSV3SATTRTIME_TOCLIENT) {
248 TCHECK(dp[1]);
249 sa3->sa_atime.nfsv3_sec = ntohl(*dp++);
250 sa3->sa_atime.nfsv3_nsec = ntohl(*dp++);
253 TCHECK(dp[0]);
254 if ((sa3->sa_mtimetype = ntohl(*dp++)) == NFSV3SATTRTIME_TOCLIENT) {
255 TCHECK(dp[1]);
256 sa3->sa_mtime.nfsv3_sec = ntohl(*dp++);
257 sa3->sa_mtime.nfsv3_nsec = ntohl(*dp++);
260 return dp;
309 const u_int32_t *dp;
315 dp = (u_int32_t *)&rp->rm_call.cb_cred;
316 TCHECK(dp[1]);
317 len = ntohl(dp[1]);
319 dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
320 TCHECK(dp[1]);
321 len = ntohl(dp[1]);
323 dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
324 TCHECK2(dp[0], 0);
325 return (dp);
337 parsefh(const u_int32_t *dp, int v3)
342 TCHECK(dp[0]);
343 len = (int)ntohl(*dp) / 4;
344 dp++;
348 if (TTEST2(*dp, len * sizeof(*dp))) {
349 nfs_printfh(dp, len);
350 return (dp + len);
361 parsefn(const u_int32_t *dp)
367 TCHECK(*dp);
370 len = *dp++;
373 TCHECK2(*dp, ((len + 3) & ~3));
375 cp = (u_char *)dp;
377 dp += ((len + 3) & ~3) / sizeof(*dp);
385 return (dp);
396 parsefhn(const u_int32_t *dp, int v3)
398 dp = parsefh(dp, v3);
399 if (dp == NULL)
402 return (parsefn(dp));
409 const u_int32_t *dp;
442 if ((dp = parsereq(rp, length)) != NULL &&
443 parsefh(dp, v3) != NULL)
449 if ((dp = parsereq(rp, length)) != NULL &&
450 parsefh(dp, v3) != NULL)
456 if ((dp = parsereq(rp, length)) != NULL &&
457 parsefhn(dp, v3) != NULL)
463 if ((dp = parsereq(rp, length)) != NULL &&
464 (dp = parsefh(dp, v3)) != NULL) {
465 TCHECK(dp[0]);
466 printf(" %04x", (u_int32_t)ntohl(dp[0]));
473 if ((dp = parsereq(rp, length)) != NULL &&
474 parsefh(dp, v3) != NULL)
480 if ((dp = parsereq(rp, length)) != NULL &&
481 (dp = parsefh(dp, v3)) != NULL) {
483 TCHECK(dp[2]);
485 (u_int32_t) ntohl(dp[2]));
486 print_int64(dp, UNSIGNED);
488 TCHECK(dp[1]);
490 (u_int32_t)ntohl(dp[1]),
491 (u_int32_t)ntohl(dp[0]));
499 if ((dp = parsereq(rp, length)) != NULL &&
500 (dp = parsefh(dp, v3)) != NULL) {
502 TCHECK(dp[4]);
504 (u_int32_t) ntohl(dp[4]));
505 print_int64(dp, UNSIGNED);
507 dp += 3;
508 TCHECK(dp[0]);
511 NULL, ntohl(*dp)));
514 TCHECK(dp[3]);
516 (u_int32_t)ntohl(dp[3]),
517 (u_int32_t)ntohl(dp[2]),
518 (u_int32_t)ntohl(dp[1]),
519 (u_int32_t)ntohl(dp[0]));
527 if ((dp = parsereq(rp, length)) != NULL &&
528 parsefhn(dp, v3) != NULL)
534 if ((dp = parsereq(rp, length)) != 0 && parsefhn(dp, v3) != 0)
540 if ((dp = parsereq(rp, length)) != 0 &&
541 (dp = parsefhn(dp, v3)) != 0) {
543 if (v3 && (dp = parse_sattr3(dp, &sa3)) == 0)
545 if (parsefn(dp) == 0)
555 if ((dp = parsereq(rp, length)) != 0 &&
556 (dp = parsefhn(dp, v3)) != 0) {
557 TCHECK(*dp);
558 type = (nfstype)ntohl(*dp++);
559 if ((dp = parse_sattr3(dp, &sa3)) == 0)
563 TCHECK(dp[1]);
565 (u_int32_t)ntohl(dp[0]),
566 (u_int32_t)ntohl(dp[1]));
567 dp += 2;
577 if ((dp = parsereq(rp, length)) != NULL &&
578 parsefhn(dp, v3) != NULL)
584 if ((dp = parsereq(rp, length)) != NULL &&
585 parsefhn(dp, v3) != NULL)
591 if ((dp = parsereq(rp, length)) != NULL &&
592 (dp = parsefhn(dp, v3)) != NULL) {
594 if (parsefhn(dp, v3) != NULL)
601 if ((dp = parsereq(rp, length)) != NULL &&
602 (dp = parsefh(dp, v3)) != NULL) {
604 if (parsefhn(dp, v3) != NULL)
611 if ((dp = parsereq(rp, length)) != NULL &&
612 (dp = parsefh(dp, v3)) != NULL) {
614 TCHECK(dp[4]);
620 (u_int32_t) ntohl(dp[4]));
621 print_int64(dp, SIGNED);
623 printf(" verf %08x%08x", dp[2],
624 dp[3]);
626 TCHECK(dp[1]);
632 (u_int32_t)ntohl(dp[1]),
633 (u_int32_t)ntohl(dp[0]));
641 if ((dp = parsereq(rp, length)) != NULL &&
642 (dp = parsefh(dp, v3)) != NULL) {
643 TCHECK(dp[4]);
648 printf(" %u bytes @ ", (u_int32_t) ntohl(dp[4]));
649 print_int64(dp, SIGNED);
651 TCHECK(dp[5]);
653 (u_int32_t) ntohl(dp[5]), dp[2], dp[3]);
661 if ((dp = parsereq(rp, length)) != NULL &&
662 parsefh(dp, v3) != NULL)
668 if ((dp = parsereq(rp, length)) != NULL &&
669 parsefh(dp, v3) != NULL)
675 if ((dp = parsereq(rp, length)) != NULL &&
676 parsefh(dp, v3) != NULL)
682 if ((dp = parsereq(rp, length)) != NULL &&
683 (dp = parsefh(dp, v3)) != NULL) {
684 TCHECK(dp[2]);
685 printf(" %u bytes @ ", (u_int32_t) ntohl(dp[2]));
686 print_int64(dp, UNSIGNED);
704 * file handle pointed to by dp.
711 nfs_printfh(const u_int32_t *dp, const u_int len)
717 Parse_fh((caddr_t *)dp, &fsid, &ino, NULL, &sfsname);
869 const u_int32_t *dp;
877 * dp = (u_int32_t *)&rp->rm_reply.rp_acpt.ar_verf
888 dp = ((const u_int32_t *)&rp->rm_reply) + 1;
889 TCHECK(dp[1]);
890 len = ntohl(dp[1]);
896 dp += (len + (2*sizeof(u_int32_t) + 3)) / sizeof(u_int32_t);
897 TCHECK2(dp[0], 0);
902 astat = ntohl(*(enum accept_stat *)dp);
939 TCHECK2(*dp, sizeof(astat));
940 return ((u_int32_t *) (sizeof(astat) + ((char *)dp)));
946 parsestatus(const u_int32_t *dp, int *er)
950 TCHECK(dp[0]);
952 errnum = ntohl(dp[0]);
961 return (dp + 1);
967 parsefattr(const u_int32_t *dp, int verbose, int v3)
971 fap = (const struct nfs_fattr *)dp;
1028 return ((const u_int32_t *)((unsigned char *)dp +
1035 parseattrstat(const u_int32_t *dp, int verbose, int v3)
1039 dp = parsestatus(dp, &er);
1040 if (dp == NULL)
1045 return (parsefattr(dp, verbose, v3) != NULL);
1049 parsediropres(const u_int32_t *dp)
1053 if (!(dp = parsestatus(dp, &er)))
1058 dp = parsefh(dp, 0);
1059 if (dp == NULL)
1062 return (parsefattr(dp, vflag, 0) != NULL);
1066 parselinkres(const u_int32_t *dp, int v3)
1070 dp = parsestatus(dp, &er);
1071 if (dp == NULL)
1075 if (v3 && !(dp = parse_post_op_attr(dp, vflag)))
1078 return (parsefn(dp) != NULL);
1082 parsestatfs(const u_int32_t *dp, int v3)
1087 dp = parsestatus(dp, &er);
1088 if (dp == NULL)
1099 if (!(dp = parse_post_op_attr(dp, vflag)))
1103 TCHECK2(*dp, (v3 ? NFSX_V3STATFS : NFSX_V2STATFS));
1105 sfsp = (const struct nfs_statfs *)dp;
1139 parserddires(const u_int32_t *dp)
1143 dp = parsestatus(dp, &er);
1144 if (dp == NULL)
1151 TCHECK(dp[2]);
1153 (u_int32_t)ntohl(dp[0]), (u_int32_t)ntohl(dp[1]));
1154 if (dp[2] != 0)
1163 parse_wcc_attr(const u_int32_t *dp)
1166 print_int64(dp, UNSIGNED);
1167 TCHECK(dp[5]);
1169 (u_int32_t)ntohl(dp[2]), (u_int32_t)ntohl(dp[3]),
1170 (u_int32_t)ntohl(dp[4]), (u_int32_t)ntohl(dp[5]));
1171 return (dp + 6);
1181 parse_pre_op_attr(const u_int32_t *dp, int verbose)
1183 TCHECK(dp[0]);
1184 if (!ntohl(dp[0]))
1185 return (dp + 1);
1186 dp++;
1187 TCHECK2(*dp, 24);
1189 return parse_wcc_attr(dp);
1192 return (dp + 6);
1202 parse_post_op_attr(const u_int32_t *dp, int verbose)
1204 TCHECK(dp[0]);
1205 if (!ntohl(dp[0]))
1206 return (dp + 1);
1207 dp++;
1209 return parsefattr(dp, verbose, 1);
1211 return (dp + (NFSX_V3FATTR / sizeof (u_int32_t)));
1217 parse_wcc_data(const u_int32_t *dp, int verbose)
1221 if (!(dp = parse_pre_op_attr(dp, verbose)))
1226 return parse_post_op_attr(dp, verbose);
1230 parsecreateopres(const u_int32_t *dp, int verbose)
1234 if (!(dp = parsestatus(dp, &er)))
1237 dp = parse_wcc_data(dp, verbose);
1239 TCHECK(dp[0]);
1240 if (!ntohl(dp[0]))
1241 return (dp + 1);
1242 dp++;
1243 if (!(dp = parsefh(dp, 1)))
1246 if (!(dp = parse_post_op_attr(dp, verbose)))
1250 dp = parse_wcc_data(dp, verbose);
1254 return (dp);
1260 parsewccres(const u_int32_t *dp, int verbose)
1264 if (!(dp = parsestatus(dp, &er)))
1266 return parse_wcc_data(dp, verbose) != 0;
1270 parsev3rddirres(const u_int32_t *dp, int verbose)
1274 if (!(dp = parsestatus(dp, &er)))
1278 if (!(dp = parse_post_op_attr(dp, verbose)))
1281 return dp;
1283 TCHECK(dp[1]);
1284 printf(" verf %08x%08x", dp[0], dp[1]);
1285 dp += 2;
1287 return dp;
1293 parsefsinfo(const u_int32_t *dp)
1298 if (!(dp = parsestatus(dp, &er)))
1302 if (!(dp = parse_post_op_attr(dp, vflag)))
1307 sfp = (struct nfsv3_fsinfo *)dp;
1330 parsepathconf(const u_int32_t *dp)
1335 if (!(dp = parsestatus(dp, &er)))
1339 if (!(dp = parse_post_op_attr(dp, vflag)))
1344 spp = (struct nfsv3_pathconf *)dp;
1362 const u_int32_t *dp;
1383 dp = parserep(rp, length);
1384 if (dp != NULL && parseattrstat(dp, !qflag, v3) != 0)
1390 if (!(dp = parserep(rp, length)))
1393 if (parsewccres(dp, vflag))
1396 if (parseattrstat(dp, !qflag, 0) != 0)
1403 if (!(dp = parserep(rp, length)))
1406 if (!(dp = parsestatus(dp, &er)))
1411 dp = parse_post_op_attr(dp, vflag);
1414 if (!(dp = parsefh(dp, v3)))
1416 if ((dp = parse_post_op_attr(dp, vflag)) &&
1419 dp = parse_post_op_attr(dp, vflag);
1422 if (dp)
1425 if (parsediropres(dp) != 0)
1432 if (!(dp = parserep(rp, length)))
1434 if (!(dp = parsestatus(dp, &er)))
1438 if (!(dp = parse_post_op_attr(dp, vflag)))
1441 TCHECK(dp[0]);
1442 printf(" c %04x", (u_int32_t)ntohl(dp[0]));
1448 dp = parserep(rp, length);
1449 if (dp != NULL && parselinkres(dp, v3) != 0)
1455 if (!(dp = parserep(rp, length)))
1458 if (!(dp = parsestatus(dp, &er)))
1460 if (!(dp = parse_post_op_attr(dp, vflag)))
1465 TCHECK(dp[1]);
1466 printf(" %u bytes", (u_int32_t) ntohl(dp[0]));
1467 if (ntohl(dp[1]))
1472 if (parseattrstat(dp, vflag, 0) != 0)
1479 if (!(dp = parserep(rp, length)))
1482 if (!(dp = parsestatus(dp, &er)))
1484 if (!(dp = parse_wcc_data(dp, vflag)))
1489 TCHECK(dp[0]);
1490 printf(" %u bytes", (u_int32_t) ntohl(dp[0]));
1492 TCHECK(dp[1]);
1495 NULL, ntohl(dp[1])));
1500 if (parseattrstat(dp, vflag, v3) != 0)
1507 if (!(dp = parserep(rp, length)))
1510 if (parsecreateopres(dp, vflag) != 0)
1513 if (parsediropres(dp) != 0)
1520 if (!(dp = parserep(rp, length)))
1523 if (parsecreateopres(dp, vflag) != 0)
1526 if (parsediropres(dp) != 0)
1533 if (!(dp = parserep(rp, length)))
1536 if (parsecreateopres(dp, vflag) != 0)
1539 if (parsestatus(dp, &er) != 0)
1546 if (!(dp = parserep(rp, length)))
1548 if (parsecreateopres(dp, vflag) != 0)
1554 if (!(dp = parserep(rp, length)))
1557 if (parsewccres(dp, vflag))
1560 if (parsestatus(dp, &er) != 0)
1567 if (!(dp = parserep(rp, length)))
1570 if (parsewccres(dp, vflag))
1573 if (parsestatus(dp, &er) != 0)
1580 if (!(dp = parserep(rp, length)))
1583 if (!(dp = parsestatus(dp, &er)))
1587 if (!(dp = parse_wcc_data(dp, vflag)))
1590 if (!(dp = parse_wcc_data(dp, vflag)))
1595 if (parsestatus(dp, &er) != 0)
1602 if (!(dp = parserep(rp, length)))
1605 if (!(dp = parsestatus(dp, &er)))
1609 if (!(dp = parse_post_op_attr(dp, vflag)))
1612 if (!(dp = parse_wcc_data(dp, vflag)))
1617 if (parsestatus(dp, &er) != 0)
1624 if (!(dp = parserep(rp, length)))
1627 if (parsev3rddirres(dp, vflag))
1630 if (parserddires(dp) != 0)
1637 if (!(dp = parserep(rp, length)))
1639 if (parsev3rddirres(dp, vflag))
1645 dp = parserep(rp, length);
1646 if (dp != NULL && parsestatfs(dp, v3) != 0)
1652 dp = parserep(rp, length);
1653 if (dp != NULL && parsefsinfo(dp) != 0)
1659 dp = parserep(rp, length);
1660 if (dp != NULL && parsepathconf(dp) != 0)
1666 dp = parserep(rp, length);
1667 if (dp != NULL && parsewccres(dp, vflag) != 0)