1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright (c) 1999 by Sun Microsystems, Inc. 24 * All rights reserved. 25 */ 26 27 #include <nfs/nfs.h> 28 #include <nfs/nfs_log.h> 29 30 static bool_t xdr_timestruc32_t(XDR *, timestruc32_t *); 31 static bool_t xdr_nfs2_timeval(XDR *, nfs2_timeval *); 32 static bool_t xdr_ftype3(XDR *, ftype3 *); 33 static bool_t xdr_stable_how(XDR *, stable_how *); 34 static bool_t xdr_createmode3(XDR *, createmode3 *); 35 static bool_t xdr_size3(XDR *, size3 *); 36 static bool_t xdr_count3(XDR *, count3 *); 37 static bool_t xdr_set_size3(XDR *, set_size3 *); 38 static bool_t xdr_offset3(XDR *, offset3 *); 39 static bool_t xdr_post_op_fh3(XDR *, post_op_fh3 *); 40 static bool_t xdr_nfsreadargs(XDR *, struct nfsreadargs *); 41 static bool_t xdr_nfslog_record_header(XDR *, nfslog_record_header *); 42 static bool_t xdr_nfslog_drok(XDR *, nfslog_drok *); 43 static bool_t xdr_nfslog_rrok(XDR *, nfslog_rrok *); 44 static bool_t xdr_nfslog_sattr(XDR *, nfslog_sattr *); 45 static bool_t xdr_nfslog_rdok(XDR *, nfslog_rdok *); 46 static bool_t xdr_nfslog_createhow3(XDR *, nfslog_createhow3 *); 47 static bool_t xdr_nfslog_CREATE3resok(XDR *, nfslog_CREATE3resok *); 48 static bool_t xdr_nfslog_READ3resok(XDR *, nfslog_READ3resok *); 49 static bool_t xdr_nfslog_WRITE3resok(XDR *, nfslog_WRITE3resok *); 50 static bool_t xdr_nfslog_entryplus3(XDR *, nfslog_entryplus3 *); 51 static bool_t xdr_nfslog_dirlistplus3(XDR *, nfslog_dirlistplus3 *); 52 static bool_t xdr_nfslog_READDIRPLUS3resok(XDR *, nfslog_READDIRPLUS3resok *); 53 54 static bool_t 55 xdr_timestruc32_t(XDR *xdrs, timestruc32_t *objp) 56 { 57 if (!xdr_int(xdrs, &objp->tv_sec)) 58 return (FALSE); 59 if (!xdr_int(xdrs, &objp->tv_nsec)) 60 return (FALSE); 61 return (TRUE); 62 } 63 64 static bool_t 65 xdr_nfs2_timeval(XDR *xdrs, nfs2_timeval *objp) 66 { 67 if (!xdr_u_int(xdrs, &objp->tv_sec)) 68 return (FALSE); 69 if (!xdr_u_int(xdrs, &objp->tv_usec)) 70 return (FALSE); 71 return (TRUE); 72 } 73 74 bool_t 75 xdr_nfsstat(XDR *xdrs, nfsstat *objp) 76 { 77 if (!xdr_enum(xdrs, (enum_t *)objp)) 78 return (FALSE); 79 return (TRUE); 80 } 81 82 bool_t 83 xdr_uint64(XDR *xdrs, uint64 *objp) 84 { 85 return (xdr_u_longlong_t(xdrs, objp)); 86 } 87 88 bool_t 89 xdr_uint32(XDR *xdrs, uint32 *objp) 90 { 91 return (xdr_u_int(xdrs, objp)); 92 } 93 94 static bool_t 95 xdr_ftype3(XDR *xdrs, ftype3 *objp) 96 { 97 return (xdr_enum(xdrs, (enum_t *)objp)); 98 } 99 100 static bool_t 101 xdr_stable_how(XDR *xdrs, stable_how *objp) 102 { 103 return (xdr_enum(xdrs, (enum_t *)objp)); 104 } 105 106 static bool_t 107 xdr_createmode3(XDR *xdrs, createmode3 *objp) 108 { 109 return (xdr_enum(xdrs, (enum_t *)objp)); 110 } 111 112 static bool_t 113 xdr_size3(XDR *xdrs, size3 *objp) 114 { 115 return (xdr_uint64(xdrs, objp)); 116 } 117 118 static bool_t 119 xdr_count3(XDR *xdrs, count3 *objp) 120 { 121 return (xdr_uint32(xdrs, objp)); 122 } 123 124 static bool_t 125 xdr_set_size3(XDR *xdrs, set_size3 *objp) 126 { 127 if (!xdr_bool(xdrs, &objp->set_it)) 128 return (FALSE); 129 switch (objp->set_it) { 130 case TRUE: 131 if (!xdr_size3(xdrs, &objp->size)) 132 return (FALSE); 133 break; 134 } 135 return (TRUE); 136 } 137 138 static bool_t 139 xdr_offset3(XDR *xdrs, offset3 *objp) 140 { 141 return (xdr_uint64(xdrs, objp)); 142 } 143 144 bool_t 145 xdr_fhandle(XDR *xdrs, fhandle_t *fh) 146 { 147 if (xdrs->x_op == XDR_FREE) 148 return (TRUE); 149 150 return (xdr_opaque(xdrs, (caddr_t)fh, NFS_FHSIZE)); 151 } 152 153 154 bool_t 155 xdr_nfs_fh3(XDR *xdrs, nfs_fh3 *objp) 156 { 157 if (!xdr_u_int(xdrs, &objp->fh3_length)) 158 return (FALSE); 159 160 if (objp->fh3_length > NFS3_FHSIZE) 161 return (FALSE); 162 163 if (xdrs->x_op == XDR_DECODE || xdrs->x_op == XDR_ENCODE) 164 return (xdr_opaque(xdrs, objp->fh3_u.data, objp->fh3_length)); 165 166 if (xdrs->x_op == XDR_FREE) 167 return (TRUE); 168 169 return (FALSE); 170 } 171 172 static bool_t 173 xdr_post_op_fh3(XDR *xdrs, post_op_fh3 *objp) 174 { 175 if (!xdr_bool(xdrs, &objp->handle_follows)) 176 return (FALSE); 177 switch (objp->handle_follows) { 178 case TRUE: 179 if (!xdr_nfs_fh3(xdrs, &objp->handle)) 180 return (FALSE); 181 break; 182 case FALSE: 183 break; 184 default: 185 return (FALSE); 186 } 187 return (TRUE); 188 } 189 190 bool_t 191 xdr_nfsstat3(XDR *xdrs, nfsstat3 *objp) 192 { 193 return (xdr_enum(xdrs, (enum_t *)objp)); 194 } 195 196 static bool_t 197 xdr_nfsreadargs(XDR *xdrs, struct nfsreadargs *ra) 198 { 199 if (xdr_fhandle(xdrs, &ra->ra_fhandle) && 200 xdr_u_int(xdrs, &ra->ra_offset) && 201 xdr_u_int(xdrs, &ra->ra_count) && 202 xdr_u_int(xdrs, &ra->ra_totcount)) { 203 return (TRUE); 204 } 205 return (FALSE); 206 } 207 208 209 bool_t 210 xdr_nfslog_buffer_header(XDR *xdrs, nfslog_buffer_header *objp) 211 { 212 if (!xdr_u_int(xdrs, &objp->bh_length)) 213 return (FALSE); 214 if (!xdr_rpcvers(xdrs, &objp->bh_version)) 215 return (FALSE); 216 if (objp->bh_version > 1) { 217 if (!xdr_u_longlong_t(xdrs, &objp->bh_offset)) 218 return (FALSE); 219 if (!xdr_u_int(xdrs, &objp->bh_flags)) 220 return (FALSE); 221 } else { 222 uint_t bh_offset; 223 224 if (!xdr_u_int(xdrs, &objp->bh_flags)) 225 return (FALSE); 226 if (xdrs->x_op == XDR_ENCODE) 227 bh_offset = (uint_t)objp->bh_offset; 228 if (!xdr_u_int(xdrs, &bh_offset)) 229 return (FALSE); 230 if (xdrs->x_op == XDR_DECODE) 231 objp->bh_offset = (u_offset_t)bh_offset; 232 } 233 if (!xdr_timestruc32_t(xdrs, &objp->bh_timestamp)) 234 return (FALSE); 235 return (TRUE); 236 } 237 238 static bool_t 239 xdr_nfslog_record_header(XDR *xdrs, nfslog_record_header *objp) 240 { 241 if (!xdr_u_int(xdrs, &objp->rh_reclen)) 242 return (FALSE); 243 if (!xdr_u_int(xdrs, &objp->rh_rec_id)) 244 return (FALSE); 245 if (!xdr_rpcprog(xdrs, &objp->rh_prognum)) 246 return (FALSE); 247 if (!xdr_rpcproc(xdrs, &objp->rh_procnum)) 248 return (FALSE); 249 if (!xdr_rpcvers(xdrs, &objp->rh_version)) 250 return (FALSE); 251 if (!xdr_u_int(xdrs, &objp->rh_auth_flavor)) 252 return (FALSE); 253 if (!xdr_timestruc32_t(xdrs, &objp->rh_timestamp)) 254 return (FALSE); 255 if (!xdr_uid_t(xdrs, &objp->rh_uid)) 256 return (FALSE); 257 if (!xdr_gid_t(xdrs, &objp->rh_gid)) 258 return (FALSE); 259 return (TRUE); 260 } 261 262 bool_t 263 xdr_nfslog_request_record(XDR *xdrs, nfslog_request_record *objp) 264 { 265 if (!xdr_nfslog_record_header(xdrs, &objp->re_header)) 266 return (FALSE); 267 if (!xdr_string(xdrs, &objp->re_principal_name, ~0)) 268 return (FALSE); 269 if (!xdr_string(xdrs, &objp->re_netid, ~0)) 270 return (FALSE); 271 if (!xdr_string(xdrs, &objp->re_tag, ~0)) 272 return (FALSE); 273 if (!xdr_netbuf(xdrs, &objp->re_ipaddr)) 274 return (FALSE); 275 return (TRUE); 276 } 277 278 bool_t 279 xdr_nfslog_sharefsargs(XDR *xdrs, nfslog_sharefsargs *objp) 280 { 281 if (!xdr_int(xdrs, &objp->sh_flags)) 282 return (FALSE); 283 if (!xdr_u_int(xdrs, &objp->sh_anon)) 284 return (FALSE); 285 if (!xdr_string(xdrs, &objp->sh_path, ~0)) 286 return (FALSE); 287 if (!xdr_fhandle(xdrs, &objp->sh_fh_buf)) 288 return (FALSE); 289 return (TRUE); 290 } 291 292 bool_t 293 xdr_nfslog_sharefsres(XDR *xdrs, nfslog_sharefsres *objp) 294 { 295 if (!xdr_nfsstat(xdrs, objp)) 296 return (FALSE); 297 return (TRUE); 298 } 299 300 bool_t 301 xdr_nfslog_getfhargs(XDR *xdrs, nfslog_getfhargs *objp) 302 { 303 if (!xdr_fhandle(xdrs, &objp->gfh_fh_buf)) 304 return (FALSE); 305 if (!xdr_string(xdrs, &objp->gfh_path, ~0)) 306 return (FALSE); 307 return (TRUE); 308 } 309 310 bool_t 311 xdr_nfslog_diropargs(XDR *xdrs, nfslog_diropargs *objp) 312 { 313 if (!xdr_fhandle(xdrs, &objp->da_fhandle)) 314 return (FALSE); 315 if (!xdr_string(xdrs, &objp->da_name, ~0)) 316 return (FALSE); 317 return (TRUE); 318 } 319 320 static bool_t 321 xdr_nfslog_drok(XDR *xdrs, nfslog_drok *objp) 322 { 323 if (!xdr_fhandle(xdrs, &objp->drok_fhandle)) 324 return (FALSE); 325 return (TRUE); 326 } 327 328 bool_t 329 xdr_nfslog_diropres(XDR *xdrs, nfslog_diropres *objp) 330 { 331 if (!xdr_nfsstat(xdrs, &objp->dr_status)) 332 return (FALSE); 333 switch (objp->dr_status) { 334 case NFS_OK: 335 if (!xdr_nfslog_drok(xdrs, &objp->nfslog_diropres_u.dr_ok)) 336 return (FALSE); 337 break; 338 } 339 return (TRUE); 340 } 341 342 bool_t 343 xdr_nfslog_nfsreadargs(XDR *xdrs, nfslog_nfsreadargs *objp) 344 { 345 if (!xdr_nfsreadargs(xdrs, objp)) 346 return (FALSE); 347 return (TRUE); 348 } 349 350 static bool_t 351 xdr_nfslog_rrok(XDR *xdrs, nfslog_rrok *objp) 352 { 353 if (!xdr_u_int(xdrs, &objp->filesize)) 354 return (FALSE); 355 if (!xdr_u_int(xdrs, &objp->rrok_count)) 356 return (FALSE); 357 return (TRUE); 358 } 359 360 bool_t 361 xdr_nfslog_rdresult(XDR *xdrs, nfslog_rdresult *objp) 362 { 363 if (!xdr_nfsstat(xdrs, &objp->r_status)) 364 return (FALSE); 365 switch (objp->r_status) { 366 case NFS_OK: 367 if (!xdr_nfslog_rrok(xdrs, &objp->nfslog_rdresult_u.r_ok)) 368 return (FALSE); 369 break; 370 } 371 return (TRUE); 372 } 373 374 bool_t 375 xdr_nfslog_writeargs(XDR *xdrs, nfslog_writeargs *objp) 376 { 377 if (!xdr_fhandle(xdrs, &objp->waargs_fhandle)) 378 return (FALSE); 379 if (!xdr_u_int(xdrs, &objp->waargs_begoff)) 380 return (FALSE); 381 if (!xdr_u_int(xdrs, &objp->waargs_offset)) 382 return (FALSE); 383 if (!xdr_u_int(xdrs, &objp->waargs_totcount)) 384 return (FALSE); 385 if (!xdr_u_int(xdrs, &objp->waargs_count)) 386 return (FALSE); 387 return (TRUE); 388 } 389 390 bool_t 391 xdr_nfslog_writeresult(XDR *xdrs, nfslog_writeresult *objp) 392 { 393 if (!xdr_nfsstat(xdrs, &objp->wr_status)) 394 return (FALSE); 395 switch (objp->wr_status) { 396 case NFS_OK: 397 if (!xdr_u_int(xdrs, &objp->nfslog_writeresult_u.wr_size)) 398 return (FALSE); 399 break; 400 } 401 return (TRUE); 402 } 403 404 static bool_t 405 xdr_nfslog_sattr(XDR *xdrs, nfslog_sattr *objp) 406 { 407 if (!xdr_u_int(xdrs, &objp->sa_mode)) 408 return (FALSE); 409 if (!xdr_u_int(xdrs, &objp->sa_uid)) 410 return (FALSE); 411 if (!xdr_u_int(xdrs, &objp->sa_gid)) 412 return (FALSE); 413 if (!xdr_u_int(xdrs, &objp->sa_size)) 414 return (FALSE); 415 if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_atime)) 416 return (FALSE); 417 if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_mtime)) 418 return (FALSE); 419 return (TRUE); 420 } 421 422 bool_t 423 xdr_nfslog_createargs(XDR *xdrs, nfslog_createargs *objp) 424 { 425 if (!xdr_nfslog_sattr(xdrs, &objp->ca_sa)) 426 return (FALSE); 427 if (!xdr_nfslog_diropargs(xdrs, &objp->ca_da)) 428 return (FALSE); 429 return (TRUE); 430 } 431 432 bool_t 433 xdr_nfslog_setattrargs(XDR *xdrs, nfslog_setattrargs *objp) 434 { 435 if (!xdr_fhandle(xdrs, &objp->saa_fh)) 436 return (FALSE); 437 if (!xdr_nfslog_sattr(xdrs, &objp->saa_sa)) 438 return (FALSE); 439 return (TRUE); 440 } 441 442 bool_t 443 xdr_nfslog_rdlnres(XDR *xdrs, nfslog_rdlnres *objp) 444 { 445 if (!xdr_nfsstat(xdrs, &objp->rl_status)) 446 return (FALSE); 447 switch (objp->rl_status) { 448 case NFS_OK: 449 if (!xdr_string(xdrs, &objp->nfslog_rdlnres_u.rl_ok, ~0)) 450 return (FALSE); 451 break; 452 } 453 return (TRUE); 454 } 455 456 bool_t 457 xdr_nfslog_rnmargs(XDR *xdrs, nfslog_rnmargs *objp) 458 { 459 if (!xdr_nfslog_diropargs(xdrs, &objp->rna_from)) 460 return (FALSE); 461 if (!xdr_nfslog_diropargs(xdrs, &objp->rna_to)) 462 return (FALSE); 463 return (TRUE); 464 } 465 466 bool_t 467 xdr_nfslog_linkargs(XDR *xdrs, nfslog_linkargs *objp) 468 { 469 if (!xdr_fhandle(xdrs, &objp->la_from)) 470 return (FALSE); 471 if (!xdr_nfslog_diropargs(xdrs, &objp->la_to)) 472 return (FALSE); 473 return (TRUE); 474 } 475 476 bool_t 477 xdr_nfslog_symlinkargs(XDR *xdrs, nfslog_symlinkargs *objp) 478 { 479 if (!xdr_nfslog_diropargs(xdrs, &objp->sla_from)) 480 return (FALSE); 481 if (!xdr_string(xdrs, &objp->sla_tnm, ~0)) 482 return (FALSE); 483 if (!xdr_nfslog_sattr(xdrs, &objp->sla_sa)) 484 return (FALSE); 485 return (TRUE); 486 } 487 488 bool_t 489 xdr_nfslog_rddirargs(XDR *xdrs, nfslog_rddirargs *objp) 490 { 491 if (!xdr_fhandle(xdrs, &objp->rda_fh)) 492 return (FALSE); 493 if (!xdr_u_int(xdrs, &objp->rda_offset)) 494 return (FALSE); 495 if (!xdr_u_int(xdrs, &objp->rda_count)) 496 return (FALSE); 497 return (TRUE); 498 } 499 500 static bool_t 501 xdr_nfslog_rdok(XDR *xdrs, nfslog_rdok *objp) 502 { 503 if (!xdr_u_int(xdrs, &objp->rdok_offset)) 504 return (FALSE); 505 if (!xdr_u_int(xdrs, &objp->rdok_size)) 506 return (FALSE); 507 if (!xdr_bool(xdrs, &objp->rdok_eof)) 508 return (FALSE); 509 return (TRUE); 510 } 511 512 bool_t 513 xdr_nfslog_rddirres(XDR *xdrs, nfslog_rddirres *objp) 514 { 515 if (!xdr_nfsstat(xdrs, &objp->rd_status)) 516 return (FALSE); 517 switch (objp->rd_status) { 518 case NFS_OK: 519 if (!xdr_nfslog_rdok(xdrs, &objp->nfslog_rddirres_u.rd_ok)) 520 return (FALSE); 521 break; 522 } 523 return (TRUE); 524 } 525 526 bool_t 527 xdr_nfslog_diropargs3(XDR *xdrs, nfslog_diropargs3 *objp) 528 { 529 if (!xdr_nfs_fh3(xdrs, &objp->dir)) 530 return (FALSE); 531 if (!xdr_string(xdrs, &objp->name, ~0)) 532 return (FALSE); 533 return (TRUE); 534 } 535 536 bool_t 537 xdr_nfslog_LOOKUP3res(XDR *xdrs, nfslog_LOOKUP3res *objp) 538 { 539 if (!xdr_nfsstat3(xdrs, &objp->status)) 540 return (FALSE); 541 switch (objp->status) { 542 case NFS3_OK: 543 if (!xdr_nfs_fh3(xdrs, &objp->nfslog_LOOKUP3res_u.object)) 544 return (FALSE); 545 break; 546 } 547 return (TRUE); 548 } 549 550 static bool_t 551 xdr_nfslog_createhow3(XDR *xdrs, nfslog_createhow3 *objp) 552 { 553 if (!xdr_createmode3(xdrs, &objp->mode)) 554 return (FALSE); 555 switch (objp->mode) { 556 case UNCHECKED: 557 case GUARDED: 558 if (!xdr_set_size3(xdrs, &objp->nfslog_createhow3_u.size)) 559 return (FALSE); 560 break; 561 case EXCLUSIVE: 562 break; 563 default: 564 return (FALSE); 565 } 566 return (TRUE); 567 } 568 569 bool_t 570 xdr_nfslog_CREATE3args(XDR *xdrs, nfslog_CREATE3args *objp) 571 { 572 if (!xdr_nfslog_diropargs3(xdrs, &objp->where)) 573 return (FALSE); 574 if (!xdr_nfslog_createhow3(xdrs, &objp->how)) 575 return (FALSE); 576 return (TRUE); 577 } 578 579 static bool_t 580 xdr_nfslog_CREATE3resok(XDR *xdrs, nfslog_CREATE3resok *objp) 581 { 582 if (!xdr_post_op_fh3(xdrs, &objp->obj)) 583 return (FALSE); 584 return (TRUE); 585 } 586 587 bool_t 588 xdr_nfslog_CREATE3res(XDR *xdrs, nfslog_CREATE3res *objp) 589 { 590 if (!xdr_nfsstat3(xdrs, &objp->status)) 591 return (FALSE); 592 switch (objp->status) { 593 case NFS3_OK: 594 if (!xdr_nfslog_CREATE3resok( 595 xdrs, &objp->nfslog_CREATE3res_u.ok)) 596 return (FALSE); 597 break; 598 } 599 return (TRUE); 600 } 601 602 bool_t 603 xdr_nfslog_SETATTR3args(XDR *xdrs, nfslog_SETATTR3args *objp) 604 { 605 if (!xdr_nfs_fh3(xdrs, &objp->object)) 606 return (FALSE); 607 if (!xdr_set_size3(xdrs, &objp->size)) 608 return (FALSE); 609 return (TRUE); 610 } 611 612 bool_t 613 xdr_nfslog_READLINK3res(XDR *xdrs, nfslog_READLINK3res *objp) 614 { 615 if (!xdr_nfsstat3(xdrs, &objp->status)) 616 return (FALSE); 617 switch (objp->status) { 618 case NFS3_OK: 619 if (!xdr_string(xdrs, &objp->nfslog_READLINK3res_u.data, ~0)) 620 return (FALSE); 621 break; 622 } 623 return (TRUE); 624 } 625 626 bool_t 627 xdr_nfslog_READ3args(XDR *xdrs, nfslog_READ3args *objp) 628 { 629 if (!xdr_nfs_fh3(xdrs, &objp->file)) 630 return (FALSE); 631 if (!xdr_offset3(xdrs, &objp->offset)) 632 return (FALSE); 633 if (!xdr_count3(xdrs, &objp->count)) 634 return (FALSE); 635 return (TRUE); 636 } 637 638 static bool_t 639 xdr_nfslog_READ3resok(XDR *xdrs, nfslog_READ3resok *objp) 640 { 641 if (!xdr_size3(xdrs, &objp->filesize)) 642 return (FALSE); 643 if (!xdr_count3(xdrs, &objp->count)) 644 return (FALSE); 645 if (!xdr_bool(xdrs, &objp->eof)) 646 return (FALSE); 647 if (!xdr_u_int(xdrs, &objp->size)) 648 return (FALSE); 649 return (TRUE); 650 } 651 652 bool_t 653 xdr_nfslog_READ3res(XDR *xdrs, nfslog_READ3res *objp) 654 { 655 if (!xdr_nfsstat3(xdrs, &objp->status)) 656 return (FALSE); 657 switch (objp->status) { 658 case NFS3_OK: 659 if (!xdr_nfslog_READ3resok(xdrs, &objp->nfslog_READ3res_u.ok)) 660 return (FALSE); 661 break; 662 } 663 return (TRUE); 664 } 665 666 bool_t 667 xdr_nfslog_WRITE3args(XDR *xdrs, nfslog_WRITE3args *objp) 668 { 669 if (!xdr_nfs_fh3(xdrs, &objp->file)) 670 return (FALSE); 671 if (!xdr_offset3(xdrs, &objp->offset)) 672 return (FALSE); 673 if (!xdr_count3(xdrs, &objp->count)) 674 return (FALSE); 675 if (!xdr_stable_how(xdrs, &objp->stable)) 676 return (FALSE); 677 return (TRUE); 678 } 679 680 static bool_t 681 xdr_nfslog_WRITE3resok(XDR *xdrs, nfslog_WRITE3resok *objp) 682 { 683 if (!xdr_size3(xdrs, &objp->filesize)) 684 return (FALSE); 685 if (!xdr_count3(xdrs, &objp->count)) 686 return (FALSE); 687 if (!xdr_stable_how(xdrs, &objp->committed)) 688 return (FALSE); 689 return (TRUE); 690 } 691 692 bool_t 693 xdr_nfslog_WRITE3res(XDR *xdrs, nfslog_WRITE3res *objp) 694 { 695 if (!xdr_nfsstat3(xdrs, &objp->status)) 696 return (FALSE); 697 switch (objp->status) { 698 case NFS3_OK: 699 if (!xdr_nfslog_WRITE3resok(xdrs, &objp->nfslog_WRITE3res_u.ok)) 700 return (FALSE); 701 break; 702 } 703 return (TRUE); 704 } 705 706 bool_t 707 xdr_nfslog_MKDIR3args(XDR *xdrs, nfslog_MKDIR3args *objp) 708 { 709 if (!xdr_nfslog_diropargs3(xdrs, &objp->where)) 710 return (FALSE); 711 return (TRUE); 712 } 713 714 bool_t 715 xdr_nfslog_MKDIR3res(XDR *xdrs, nfslog_MKDIR3res *objp) 716 { 717 if (!xdr_nfsstat3(xdrs, &objp->status)) 718 return (FALSE); 719 switch (objp->status) { 720 case NFS3_OK: 721 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKDIR3res_u.obj)) 722 return (FALSE); 723 break; 724 } 725 return (TRUE); 726 } 727 728 bool_t 729 xdr_nfslog_SYMLINK3args(XDR *xdrs, nfslog_SYMLINK3args *objp) 730 { 731 if (!xdr_nfslog_diropargs3(xdrs, &objp->where)) 732 return (FALSE); 733 if (!xdr_string(xdrs, &objp->symlink_data, ~0)) 734 return (FALSE); 735 return (TRUE); 736 } 737 738 bool_t 739 xdr_nfslog_SYMLINK3res(XDR *xdrs, nfslog_SYMLINK3res *objp) 740 { 741 if (!xdr_nfsstat3(xdrs, &objp->status)) 742 return (FALSE); 743 switch (objp->status) { 744 case NFS3_OK: 745 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_SYMLINK3res_u.obj)) 746 return (FALSE); 747 break; 748 } 749 return (TRUE); 750 } 751 752 bool_t 753 xdr_nfslog_MKNOD3args(XDR *xdrs, nfslog_MKNOD3args *objp) 754 { 755 if (!xdr_nfslog_diropargs3(xdrs, &objp->where)) 756 return (FALSE); 757 if (!xdr_ftype3(xdrs, &objp->type)) 758 return (FALSE); 759 return (TRUE); 760 } 761 762 bool_t 763 xdr_nfslog_MKNOD3res(XDR *xdrs, nfslog_MKNOD3res *objp) 764 { 765 if (!xdr_nfsstat3(xdrs, &objp->status)) 766 return (FALSE); 767 switch (objp->status) { 768 case NFS3_OK: 769 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKNOD3res_u.obj)) 770 return (FALSE); 771 break; 772 } 773 return (TRUE); 774 } 775 776 bool_t 777 xdr_nfslog_REMOVE3args(XDR *xdrs, nfslog_REMOVE3args *objp) 778 { 779 if (!xdr_nfslog_diropargs3(xdrs, &objp->object)) 780 return (FALSE); 781 return (TRUE); 782 } 783 784 bool_t 785 xdr_nfslog_RMDIR3args(XDR *xdrs, nfslog_RMDIR3args *objp) 786 { 787 if (!xdr_nfslog_diropargs3(xdrs, &objp->object)) 788 return (FALSE); 789 return (TRUE); 790 } 791 792 bool_t 793 xdr_nfslog_RENAME3args(XDR *xdrs, nfslog_RENAME3args *objp) 794 { 795 if (!xdr_nfslog_diropargs3(xdrs, &objp->from)) 796 return (FALSE); 797 if (!xdr_nfslog_diropargs3(xdrs, &objp->to)) 798 return (FALSE); 799 return (TRUE); 800 } 801 802 bool_t 803 xdr_nfslog_LINK3args(XDR *xdrs, nfslog_LINK3args *objp) 804 { 805 if (!xdr_nfs_fh3(xdrs, &objp->file)) 806 return (FALSE); 807 if (!xdr_nfslog_diropargs3(xdrs, &objp->link)) 808 return (FALSE); 809 return (TRUE); 810 } 811 812 bool_t 813 xdr_nfslog_READDIRPLUS3args(XDR *xdrs, nfslog_READDIRPLUS3args *objp) 814 { 815 if (!xdr_nfs_fh3(xdrs, &objp->dir)) 816 return (FALSE); 817 if (!xdr_count3(xdrs, &objp->dircount)) 818 return (FALSE); 819 if (!xdr_count3(xdrs, &objp->maxcount)) 820 return (FALSE); 821 return (TRUE); 822 } 823 824 static bool_t 825 xdr_nfslog_entryplus3(XDR *xdrs, nfslog_entryplus3 *objp) 826 { 827 if (!xdr_post_op_fh3(xdrs, &objp->name_handle)) 828 return (FALSE); 829 if (!xdr_string(xdrs, &objp->name, ~0)) 830 return (FALSE); 831 if (!xdr_pointer(xdrs, (char **)&objp->nextentry, 832 sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3)) 833 return (FALSE); 834 return (TRUE); 835 } 836 837 static bool_t 838 xdr_nfslog_dirlistplus3(XDR *xdrs, nfslog_dirlistplus3 *objp) 839 { 840 if (!xdr_pointer(xdrs, (char **)&objp->entries, 841 sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3)) 842 return (FALSE); 843 if (!xdr_bool(xdrs, &objp->eof)) 844 return (FALSE); 845 return (TRUE); 846 } 847 848 static bool_t 849 xdr_nfslog_READDIRPLUS3resok(XDR *xdrs, nfslog_READDIRPLUS3resok *objp) 850 { 851 if (!xdr_nfslog_dirlistplus3(xdrs, &objp->reply)) 852 return (FALSE); 853 return (TRUE); 854 } 855 856 bool_t 857 xdr_nfslog_READDIRPLUS3res(XDR *xdrs, nfslog_READDIRPLUS3res *objp) 858 { 859 if (!xdr_nfsstat3(xdrs, &objp->status)) 860 return (FALSE); 861 switch (objp->status) { 862 case NFS3_OK: 863 if (!xdr_nfslog_READDIRPLUS3resok( 864 xdrs, &objp->nfslog_READDIRPLUS3res_u.ok)) 865 return (FALSE); 866 break; 867 } 868 return (TRUE); 869 } 870 871 bool_t 872 xdr_nfslog_COMMIT3args(XDR *xdrs, nfslog_COMMIT3args *objp) 873 { 874 if (!xdr_nfs_fh3(xdrs, &objp->file)) 875 return (FALSE); 876 if (!xdr_offset3(xdrs, &objp->offset)) 877 return (FALSE); 878 if (!xdr_count3(xdrs, &objp->count)) 879 return (FALSE); 880 return (TRUE); 881 } 882