1/* Do not edit: automatically built by gen_rpc.awk. */ 2#include "db_config.h" 3 4#include "db_int.h" 5#ifdef HAVE_SYSTEM_INCLUDE_FILES 6#include <rpc/rpc.h> 7#endif 8#include "db_server.h" 9#include "dbinc/txn.h" 10#include "dbinc_auto/rpc_client_ext.h" 11 12static int __dbcl_dbp_illegal __P((DB *)); 13static int __dbcl_noserver __P((DB_ENV *)); 14static int __dbcl_txn_illegal __P((DB_TXN *)); 15 16static int 17__dbcl_noserver(dbenv) 18 DB_ENV *dbenv; 19{ 20 __db_errx(dbenv == NULL ? NULL : dbenv->env, 21 "No Berkeley DB RPC server environment"); 22 return (DB_NOSERVER); 23} 24 25/* 26 * __dbcl_dbenv_illegal -- 27 * DB_ENV method not supported under RPC. 28 * 29 * PUBLIC: int __dbcl_dbenv_illegal __P((DB_ENV *)); 30 */ 31int 32__dbcl_dbenv_illegal(dbenv) 33 DB_ENV *dbenv; 34{ 35 __db_errx(dbenv == NULL ? NULL : dbenv->env, 36 "Interface not supported by Berkeley DB RPC client environments"); 37 return (DB_OPNOTSUP); 38} 39 40/* 41 * __dbcl_dbp_illegal -- 42 * DB method not supported under RPC. 43 */ 44static int 45__dbcl_dbp_illegal(dbp) 46 DB *dbp; 47{ 48 return (__dbcl_dbenv_illegal(dbp->dbenv)); 49} 50 51/* 52 * __dbcl_txn_illegal -- 53 * DB_TXN method not supported under RPC. 54 */ 55static int 56__dbcl_txn_illegal(txn) 57 DB_TXN *txn; 58{ 59 return (__dbcl_dbenv_illegal(txn->mgrp->env->dbenv)); 60} 61 62/* 63 * PUBLIC: int __dbcl_env_create __P((DB_ENV *, long)); 64 */ 65int 66__dbcl_env_create(dbenv, timeout) 67 DB_ENV * dbenv; 68 long timeout; 69{ 70 CLIENT *cl; 71 __env_create_msg msg; 72 __env_create_reply *replyp = NULL; 73 int ret; 74 75 ret = 0; 76 if (dbenv == NULL || !RPC_ON(dbenv)) 77 return (__dbcl_noserver(dbenv)); 78 79 cl = (CLIENT *)dbenv->cl_handle; 80 81 msg.timeout = (u_int)timeout; 82 83 replyp = __db_env_create_4007(&msg, cl); 84 if (replyp == NULL) { 85 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 86 ret = DB_NOSERVER; 87 goto out; 88 } 89 ret = __dbcl_env_create_ret(dbenv, timeout, replyp); 90out: 91 if (replyp != NULL) 92 xdr_free((xdrproc_t)xdr___env_create_reply, (void *)replyp); 93 return (ret); 94} 95 96/* 97 * PUBLIC: int __dbcl_env_cdsgroup_begin __P((DB_ENV *, DB_TXN **)); 98 */ 99int 100__dbcl_env_cdsgroup_begin(dbenv, txnpp) 101 DB_ENV * dbenv; 102 DB_TXN ** txnpp; 103{ 104 CLIENT *cl; 105 __env_cdsgroup_begin_msg msg; 106 __env_cdsgroup_begin_reply *replyp = NULL; 107 int ret; 108 109 ret = 0; 110 if (dbenv == NULL || !RPC_ON(dbenv)) 111 return (__dbcl_noserver(dbenv)); 112 113 cl = (CLIENT *)dbenv->cl_handle; 114 115 msg.dbenvcl_id = dbenv->cl_id; 116 117 replyp = __db_env_cdsgroup_begin_4007(&msg, cl); 118 if (replyp == NULL) { 119 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 120 ret = DB_NOSERVER; 121 goto out; 122 } 123 ret = __dbcl_env_cdsgroup_begin_ret(dbenv, txnpp, replyp); 124out: 125 if (replyp != NULL) 126 xdr_free((xdrproc_t)xdr___env_cdsgroup_begin_reply, (void *)replyp); 127 return (ret); 128} 129 130/* 131 * PUBLIC: int __dbcl_env_close __P((DB_ENV *, u_int32_t)); 132 */ 133int 134__dbcl_env_close(dbenv, flags) 135 DB_ENV * dbenv; 136 u_int32_t flags; 137{ 138 CLIENT *cl; 139 __env_close_msg msg; 140 __env_close_reply *replyp = NULL; 141 int ret; 142 143 ret = 0; 144 if (dbenv == NULL || !RPC_ON(dbenv)) 145 return (__dbcl_noserver(dbenv)); 146 147 cl = (CLIENT *)dbenv->cl_handle; 148 149 msg.dbenvcl_id = dbenv->cl_id; 150 msg.flags = (u_int)flags; 151 152 replyp = __db_env_close_4007(&msg, cl); 153 if (replyp == NULL) { 154 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 155 ret = DB_NOSERVER; 156 goto out; 157 } 158 ret = replyp->status; 159out: 160 if (replyp != NULL) 161 xdr_free((xdrproc_t)xdr___env_close_reply, (void *)replyp); 162 return (ret); 163} 164 165/* 166 * PUBLIC: int __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const char *, 167 * PUBLIC: const char *, u_int32_t)); 168 */ 169int 170__dbcl_env_dbremove(dbenv, txnp, name, subdb, flags) 171 DB_ENV * dbenv; 172 DB_TXN * txnp; 173 const char * name; 174 const char * subdb; 175 u_int32_t flags; 176{ 177 CLIENT *cl; 178 __env_dbremove_msg msg; 179 __env_dbremove_reply *replyp = NULL; 180 int ret; 181 182 ret = 0; 183 if (dbenv == NULL || !RPC_ON(dbenv)) 184 return (__dbcl_noserver(dbenv)); 185 186 cl = (CLIENT *)dbenv->cl_handle; 187 188 msg.dbenvcl_id = dbenv->cl_id; 189 if (txnp == NULL) 190 msg.txnpcl_id = 0; 191 else 192 msg.txnpcl_id = txnp->txnid; 193 if (name == NULL) 194 msg.name = ""; 195 else 196 msg.name = (char *)name; 197 if (subdb == NULL) 198 msg.subdb = ""; 199 else 200 msg.subdb = (char *)subdb; 201 msg.flags = (u_int)flags; 202 203 replyp = __db_env_dbremove_4007(&msg, cl); 204 if (replyp == NULL) { 205 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 206 ret = DB_NOSERVER; 207 goto out; 208 } 209 ret = replyp->status; 210out: 211 if (replyp != NULL) 212 xdr_free((xdrproc_t)xdr___env_dbremove_reply, (void *)replyp); 213 return (ret); 214} 215 216/* 217 * PUBLIC: int __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const char *, 218 * PUBLIC: const char *, const char *, u_int32_t)); 219 */ 220int 221__dbcl_env_dbrename(dbenv, txnp, name, subdb, newname, flags) 222 DB_ENV * dbenv; 223 DB_TXN * txnp; 224 const char * name; 225 const char * subdb; 226 const char * newname; 227 u_int32_t flags; 228{ 229 CLIENT *cl; 230 __env_dbrename_msg msg; 231 __env_dbrename_reply *replyp = NULL; 232 int ret; 233 234 ret = 0; 235 if (dbenv == NULL || !RPC_ON(dbenv)) 236 return (__dbcl_noserver(dbenv)); 237 238 cl = (CLIENT *)dbenv->cl_handle; 239 240 msg.dbenvcl_id = dbenv->cl_id; 241 if (txnp == NULL) 242 msg.txnpcl_id = 0; 243 else 244 msg.txnpcl_id = txnp->txnid; 245 if (name == NULL) 246 msg.name = ""; 247 else 248 msg.name = (char *)name; 249 if (subdb == NULL) 250 msg.subdb = ""; 251 else 252 msg.subdb = (char *)subdb; 253 if (newname == NULL) 254 msg.newname = ""; 255 else 256 msg.newname = (char *)newname; 257 msg.flags = (u_int)flags; 258 259 replyp = __db_env_dbrename_4007(&msg, cl); 260 if (replyp == NULL) { 261 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 262 ret = DB_NOSERVER; 263 goto out; 264 } 265 ret = replyp->status; 266out: 267 if (replyp != NULL) 268 xdr_free((xdrproc_t)xdr___env_dbrename_reply, (void *)replyp); 269 return (ret); 270} 271 272/* 273 * PUBLIC: int __dbcl_env_get_cachesize __P((DB_ENV *, u_int32_t *, 274 * PUBLIC: u_int32_t *, int *)); 275 */ 276int 277__dbcl_env_get_cachesize(dbenv, gbytesp, bytesp, ncachep) 278 DB_ENV * dbenv; 279 u_int32_t * gbytesp; 280 u_int32_t * bytesp; 281 int * ncachep; 282{ 283 CLIENT *cl; 284 __env_get_cachesize_msg msg; 285 __env_get_cachesize_reply *replyp = NULL; 286 int ret; 287 288 ret = 0; 289 if (dbenv == NULL || !RPC_ON(dbenv)) 290 return (__dbcl_noserver(dbenv)); 291 292 cl = (CLIENT *)dbenv->cl_handle; 293 294 msg.dbenvcl_id = dbenv->cl_id; 295 296 replyp = __db_env_get_cachesize_4007(&msg, cl); 297 if (replyp == NULL) { 298 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 299 ret = DB_NOSERVER; 300 goto out; 301 } 302 ret = replyp->status; 303 if (gbytesp != NULL) 304 *gbytesp = (u_int32_t)replyp->gbytes; 305 if (bytesp != NULL) 306 *bytesp = (u_int32_t)replyp->bytes; 307 if (ncachep != NULL) 308 *ncachep = (int)replyp->ncache; 309out: 310 if (replyp != NULL) 311 xdr_free((xdrproc_t)xdr___env_get_cachesize_reply, (void *)replyp); 312 return (ret); 313} 314 315/* 316 * PUBLIC: int __dbcl_env_get_encrypt_flags __P((DB_ENV *, u_int32_t *)); 317 */ 318int 319__dbcl_env_get_encrypt_flags(dbenv, flagsp) 320 DB_ENV * dbenv; 321 u_int32_t * flagsp; 322{ 323 CLIENT *cl; 324 __env_get_encrypt_flags_msg msg; 325 __env_get_encrypt_flags_reply *replyp = NULL; 326 int ret; 327 328 ret = 0; 329 if (dbenv == NULL || !RPC_ON(dbenv)) 330 return (__dbcl_noserver(dbenv)); 331 332 cl = (CLIENT *)dbenv->cl_handle; 333 334 msg.dbenvcl_id = dbenv->cl_id; 335 336 replyp = __db_env_get_encrypt_flags_4007(&msg, cl); 337 if (replyp == NULL) { 338 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 339 ret = DB_NOSERVER; 340 goto out; 341 } 342 ret = replyp->status; 343 if (flagsp != NULL) 344 *flagsp = (u_int32_t)replyp->flags; 345out: 346 if (replyp != NULL) 347 xdr_free((xdrproc_t)xdr___env_get_encrypt_flags_reply, (void *)replyp); 348 return (ret); 349} 350 351/* 352 * PUBLIC: int __dbcl_env_get_flags __P((DB_ENV *, u_int32_t *)); 353 */ 354int 355__dbcl_env_get_flags(dbenv, flagsp) 356 DB_ENV * dbenv; 357 u_int32_t * flagsp; 358{ 359 CLIENT *cl; 360 __env_get_flags_msg msg; 361 __env_get_flags_reply *replyp = NULL; 362 int ret; 363 364 ret = 0; 365 if (dbenv == NULL || !RPC_ON(dbenv)) 366 return (__dbcl_noserver(dbenv)); 367 368 cl = (CLIENT *)dbenv->cl_handle; 369 370 msg.dbenvcl_id = dbenv->cl_id; 371 372 replyp = __db_env_get_flags_4007(&msg, cl); 373 if (replyp == NULL) { 374 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 375 ret = DB_NOSERVER; 376 goto out; 377 } 378 ret = replyp->status; 379 if (flagsp != NULL) 380 *flagsp = (u_int32_t)replyp->flags; 381out: 382 if (replyp != NULL) 383 xdr_free((xdrproc_t)xdr___env_get_flags_reply, (void *)replyp); 384 return (ret); 385} 386 387/* 388 * PUBLIC: int __dbcl_env_get_home __P((DB_ENV *, const char * *)); 389 */ 390int 391__dbcl_env_get_home(dbenv, homep) 392 DB_ENV * dbenv; 393 const char * * homep; 394{ 395 CLIENT *cl; 396 __env_get_home_msg msg; 397 __env_get_home_reply *replyp = NULL; 398 int ret; 399 400 ret = 0; 401 if (dbenv == NULL || !RPC_ON(dbenv)) 402 return (__dbcl_noserver(dbenv)); 403 404 cl = (CLIENT *)dbenv->cl_handle; 405 406 msg.dbenvcl_id = dbenv->cl_id; 407 408 replyp = __db_env_get_home_4007(&msg, cl); 409 if (replyp == NULL) { 410 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 411 ret = DB_NOSERVER; 412 goto out; 413 } 414 ret = replyp->status; 415 if (homep != NULL) 416 *homep = (const char *)replyp->home; 417out: 418 if (replyp != NULL) 419 xdr_free((xdrproc_t)xdr___env_get_home_reply, (void *)replyp); 420 return (ret); 421} 422 423/* 424 * PUBLIC: int __dbcl_env_get_open_flags __P((DB_ENV *, u_int32_t *)); 425 */ 426int 427__dbcl_env_get_open_flags(dbenv, flagsp) 428 DB_ENV * dbenv; 429 u_int32_t * flagsp; 430{ 431 CLIENT *cl; 432 __env_get_open_flags_msg msg; 433 __env_get_open_flags_reply *replyp = NULL; 434 int ret; 435 436 ret = 0; 437 if (dbenv == NULL || !RPC_ON(dbenv)) 438 return (__dbcl_noserver(dbenv)); 439 440 cl = (CLIENT *)dbenv->cl_handle; 441 442 msg.dbenvcl_id = dbenv->cl_id; 443 444 replyp = __db_env_get_open_flags_4007(&msg, cl); 445 if (replyp == NULL) { 446 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 447 ret = DB_NOSERVER; 448 goto out; 449 } 450 ret = replyp->status; 451 if (flagsp != NULL) 452 *flagsp = (u_int32_t)replyp->flags; 453out: 454 if (replyp != NULL) 455 xdr_free((xdrproc_t)xdr___env_get_open_flags_reply, (void *)replyp); 456 return (ret); 457} 458 459/* 460 * PUBLIC: int __dbcl_env_open __P((DB_ENV *, const char *, u_int32_t, int)); 461 */ 462int 463__dbcl_env_open(dbenv, home, flags, mode) 464 DB_ENV * dbenv; 465 const char * home; 466 u_int32_t flags; 467 int mode; 468{ 469 CLIENT *cl; 470 __env_open_msg msg; 471 __env_open_reply *replyp = NULL; 472 int ret; 473 474 ret = 0; 475 if (dbenv == NULL || !RPC_ON(dbenv)) 476 return (__dbcl_noserver(dbenv)); 477 478 cl = (CLIENT *)dbenv->cl_handle; 479 480 msg.dbenvcl_id = dbenv->cl_id; 481 if (home == NULL) 482 msg.home = ""; 483 else 484 msg.home = (char *)home; 485 msg.flags = (u_int)flags; 486 msg.mode = (u_int)mode; 487 488 replyp = __db_env_open_4007(&msg, cl); 489 if (replyp == NULL) { 490 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 491 ret = DB_NOSERVER; 492 goto out; 493 } 494 ret = __dbcl_env_open_ret(dbenv, home, flags, mode, replyp); 495out: 496 if (replyp != NULL) 497 xdr_free((xdrproc_t)xdr___env_open_reply, (void *)replyp); 498 return (ret); 499} 500 501/* 502 * PUBLIC: int __dbcl_env_remove __P((DB_ENV *, const char *, u_int32_t)); 503 */ 504int 505__dbcl_env_remove(dbenv, home, flags) 506 DB_ENV * dbenv; 507 const char * home; 508 u_int32_t flags; 509{ 510 CLIENT *cl; 511 __env_remove_msg msg; 512 __env_remove_reply *replyp = NULL; 513 int ret; 514 515 ret = 0; 516 if (dbenv == NULL || !RPC_ON(dbenv)) 517 return (__dbcl_noserver(dbenv)); 518 519 cl = (CLIENT *)dbenv->cl_handle; 520 521 msg.dbenvcl_id = dbenv->cl_id; 522 if (home == NULL) 523 msg.home = ""; 524 else 525 msg.home = (char *)home; 526 msg.flags = (u_int)flags; 527 528 replyp = __db_env_remove_4007(&msg, cl); 529 if (replyp == NULL) { 530 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 531 ret = DB_NOSERVER; 532 goto out; 533 } 534 ret = __dbcl_env_remove_ret(dbenv, home, flags, replyp); 535out: 536 if (replyp != NULL) 537 xdr_free((xdrproc_t)xdr___env_remove_reply, (void *)replyp); 538 return (ret); 539} 540 541/* 542 * PUBLIC: int __dbcl_env_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, 543 * PUBLIC: int)); 544 */ 545int 546__dbcl_env_set_cachesize(dbenv, gbytes, bytes, ncache) 547 DB_ENV * dbenv; 548 u_int32_t gbytes; 549 u_int32_t bytes; 550 int ncache; 551{ 552 CLIENT *cl; 553 __env_set_cachesize_msg msg; 554 __env_set_cachesize_reply *replyp = NULL; 555 int ret; 556 557 ret = 0; 558 if (dbenv == NULL || !RPC_ON(dbenv)) 559 return (__dbcl_noserver(dbenv)); 560 561 cl = (CLIENT *)dbenv->cl_handle; 562 563 msg.dbenvcl_id = dbenv->cl_id; 564 msg.gbytes = (u_int)gbytes; 565 msg.bytes = (u_int)bytes; 566 msg.ncache = (u_int)ncache; 567 568 replyp = __db_env_set_cachesize_4007(&msg, cl); 569 if (replyp == NULL) { 570 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 571 ret = DB_NOSERVER; 572 goto out; 573 } 574 ret = replyp->status; 575out: 576 if (replyp != NULL) 577 xdr_free((xdrproc_t)xdr___env_set_cachesize_reply, (void *)replyp); 578 return (ret); 579} 580 581/* 582 * PUBLIC: int __dbcl_env_set_encrypt __P((DB_ENV *, const char *, u_int32_t)); 583 */ 584int 585__dbcl_env_set_encrypt(dbenv, passwd, flags) 586 DB_ENV * dbenv; 587 const char * passwd; 588 u_int32_t flags; 589{ 590 CLIENT *cl; 591 __env_set_encrypt_msg msg; 592 __env_set_encrypt_reply *replyp = NULL; 593 int ret; 594 595 ret = 0; 596 if (dbenv == NULL || !RPC_ON(dbenv)) 597 return (__dbcl_noserver(dbenv)); 598 599 cl = (CLIENT *)dbenv->cl_handle; 600 601 msg.dbenvcl_id = dbenv->cl_id; 602 if (passwd == NULL) 603 msg.passwd = ""; 604 else 605 msg.passwd = (char *)passwd; 606 msg.flags = (u_int)flags; 607 608 replyp = __db_env_set_encrypt_4007(&msg, cl); 609 if (replyp == NULL) { 610 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 611 ret = DB_NOSERVER; 612 goto out; 613 } 614 ret = replyp->status; 615out: 616 if (replyp != NULL) 617 xdr_free((xdrproc_t)xdr___env_set_encrypt_reply, (void *)replyp); 618 return (ret); 619} 620 621/* 622 * PUBLIC: int __dbcl_env_set_flags __P((DB_ENV *, u_int32_t, int)); 623 */ 624int 625__dbcl_env_set_flags(dbenv, flags, onoff) 626 DB_ENV * dbenv; 627 u_int32_t flags; 628 int onoff; 629{ 630 CLIENT *cl; 631 __env_set_flags_msg msg; 632 __env_set_flags_reply *replyp = NULL; 633 int ret; 634 635 ret = 0; 636 if (dbenv == NULL || !RPC_ON(dbenv)) 637 return (__dbcl_noserver(dbenv)); 638 639 cl = (CLIENT *)dbenv->cl_handle; 640 641 msg.dbenvcl_id = dbenv->cl_id; 642 msg.flags = (u_int)flags; 643 msg.onoff = (u_int)onoff; 644 645 replyp = __db_env_set_flags_4007(&msg, cl); 646 if (replyp == NULL) { 647 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 648 ret = DB_NOSERVER; 649 goto out; 650 } 651 ret = replyp->status; 652out: 653 if (replyp != NULL) 654 xdr_free((xdrproc_t)xdr___env_set_flags_reply, (void *)replyp); 655 return (ret); 656} 657 658/* 659 * PUBLIC: int __dbcl_env_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, 660 * PUBLIC: u_int32_t)); 661 */ 662int 663__dbcl_env_txn_begin(dbenv, parent, txnpp, flags) 664 DB_ENV * dbenv; 665 DB_TXN * parent; 666 DB_TXN ** txnpp; 667 u_int32_t flags; 668{ 669 CLIENT *cl; 670 __env_txn_begin_msg msg; 671 __env_txn_begin_reply *replyp = NULL; 672 int ret; 673 674 ret = 0; 675 if (dbenv == NULL || !RPC_ON(dbenv)) 676 return (__dbcl_noserver(dbenv)); 677 678 cl = (CLIENT *)dbenv->cl_handle; 679 680 msg.dbenvcl_id = dbenv->cl_id; 681 if (parent == NULL) 682 msg.parentcl_id = 0; 683 else 684 msg.parentcl_id = parent->txnid; 685 msg.flags = (u_int)flags; 686 687 replyp = __db_env_txn_begin_4007(&msg, cl); 688 if (replyp == NULL) { 689 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 690 ret = DB_NOSERVER; 691 goto out; 692 } 693 ret = __dbcl_env_txn_begin_ret(dbenv, parent, txnpp, flags, replyp); 694out: 695 if (replyp != NULL) 696 xdr_free((xdrproc_t)xdr___env_txn_begin_reply, (void *)replyp); 697 return (ret); 698} 699 700/* 701 * PUBLIC: int __dbcl_env_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, 702 * PUBLIC: long *, u_int32_t)); 703 */ 704int 705__dbcl_env_txn_recover(dbenv, preplist, count, retp, flags) 706 DB_ENV * dbenv; 707 DB_PREPLIST * preplist; 708 long count; 709 long * retp; 710 u_int32_t flags; 711{ 712 CLIENT *cl; 713 __env_txn_recover_msg msg; 714 __env_txn_recover_reply *replyp = NULL; 715 int ret; 716 717 ret = 0; 718 if (dbenv == NULL || !RPC_ON(dbenv)) 719 return (__dbcl_noserver(dbenv)); 720 721 cl = (CLIENT *)dbenv->cl_handle; 722 723 msg.dbenvcl_id = dbenv->cl_id; 724 msg.count = (u_int)count; 725 msg.flags = (u_int)flags; 726 727 replyp = __db_env_txn_recover_4007(&msg, cl); 728 if (replyp == NULL) { 729 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 730 ret = DB_NOSERVER; 731 goto out; 732 } 733 ret = __dbcl_env_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp); 734out: 735 if (replyp != NULL) 736 xdr_free((xdrproc_t)xdr___env_txn_recover_reply, (void *)replyp); 737 return (ret); 738} 739 740/* 741 * PUBLIC: int __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t)); 742 */ 743int 744__dbcl_db_create(dbp, dbenv, flags) 745 DB * dbp; 746 DB_ENV * dbenv; 747 u_int32_t flags; 748{ 749 CLIENT *cl; 750 __db_create_msg msg; 751 __db_create_reply *replyp = NULL; 752 int ret; 753 754 ret = 0; 755 if (dbenv == NULL || !RPC_ON(dbenv)) 756 return (__dbcl_noserver(dbenv)); 757 758 cl = (CLIENT *)dbenv->cl_handle; 759 760 msg.dbenvcl_id = dbenv->cl_id; 761 msg.flags = (u_int)flags; 762 763 replyp = __db_db_create_4007(&msg, cl); 764 if (replyp == NULL) { 765 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 766 ret = DB_NOSERVER; 767 goto out; 768 } 769 ret = __dbcl_db_create_ret(dbp, dbenv, flags, replyp); 770out: 771 if (replyp != NULL) 772 xdr_free((xdrproc_t)xdr___db_create_reply, (void *)replyp); 773 return (ret); 774} 775 776/* 777 * PUBLIC: int __dbcl_db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *, 778 * PUBLIC: const DBT *, const DBT *, DBT *), u_int32_t)); 779 */ 780int 781__dbcl_db_associate(dbp, txnp, sdbp, func0, flags) 782 DB * dbp; 783 DB_TXN * txnp; 784 DB * sdbp; 785 int (*func0) __P((DB *, const DBT *, const DBT *, DBT *)); 786 u_int32_t flags; 787{ 788 CLIENT *cl; 789 __db_associate_msg msg; 790 __db_associate_reply *replyp = NULL; 791 int ret; 792 DB_ENV *dbenv; 793 794 ret = 0; 795 dbenv = dbp->dbenv; 796 if (dbenv == NULL || !RPC_ON(dbenv)) 797 return (__dbcl_noserver(NULL)); 798 799 cl = (CLIENT *)dbenv->cl_handle; 800 801 if (func0 != NULL) { 802 __db_errx(dbenv->env, "User functions not supported in RPC"); 803 return (EINVAL); 804 } 805 if (dbp == NULL) 806 msg.dbpcl_id = 0; 807 else 808 msg.dbpcl_id = dbp->cl_id; 809 if (txnp == NULL) 810 msg.txnpcl_id = 0; 811 else 812 msg.txnpcl_id = txnp->txnid; 813 if (sdbp == NULL) 814 msg.sdbpcl_id = 0; 815 else 816 msg.sdbpcl_id = sdbp->cl_id; 817 msg.flags = (u_int)flags; 818 819 replyp = __db_db_associate_4007(&msg, cl); 820 if (replyp == NULL) { 821 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 822 ret = DB_NOSERVER; 823 goto out; 824 } 825 ret = replyp->status; 826out: 827 if (replyp != NULL) 828 xdr_free((xdrproc_t)xdr___db_associate_reply, (void *)replyp); 829 return (ret); 830} 831 832/* 833 * PUBLIC: int __dbcl_db_close __P((DB *, u_int32_t)); 834 */ 835int 836__dbcl_db_close(dbp, flags) 837 DB * dbp; 838 u_int32_t flags; 839{ 840 CLIENT *cl; 841 __db_close_msg msg; 842 __db_close_reply *replyp = NULL; 843 int ret; 844 DB_ENV *dbenv; 845 846 ret = 0; 847 dbenv = dbp->dbenv; 848 if (dbenv == NULL || !RPC_ON(dbenv)) 849 return (__dbcl_noserver(NULL)); 850 851 cl = (CLIENT *)dbenv->cl_handle; 852 853 if (dbp == NULL) 854 msg.dbpcl_id = 0; 855 else 856 msg.dbpcl_id = dbp->cl_id; 857 msg.flags = (u_int)flags; 858 859 replyp = __db_db_close_4007(&msg, cl); 860 if (replyp == NULL) { 861 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 862 ret = DB_NOSERVER; 863 goto out; 864 } 865 ret = __dbcl_db_close_ret(dbp, flags, replyp); 866out: 867 if (replyp != NULL) 868 xdr_free((xdrproc_t)xdr___db_close_reply, (void *)replyp); 869 return (ret); 870} 871 872/* 873 * PUBLIC: int __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t)); 874 */ 875int 876__dbcl_db_cursor(dbp, txnp, dbcpp, flags) 877 DB * dbp; 878 DB_TXN * txnp; 879 DBC ** dbcpp; 880 u_int32_t flags; 881{ 882 CLIENT *cl; 883 __db_cursor_msg msg; 884 __db_cursor_reply *replyp = NULL; 885 int ret; 886 DB_ENV *dbenv; 887 888 ret = 0; 889 dbenv = dbp->dbenv; 890 if (dbenv == NULL || !RPC_ON(dbenv)) 891 return (__dbcl_noserver(NULL)); 892 893 cl = (CLIENT *)dbenv->cl_handle; 894 895 if (dbp == NULL) 896 msg.dbpcl_id = 0; 897 else 898 msg.dbpcl_id = dbp->cl_id; 899 if (txnp == NULL) 900 msg.txnpcl_id = 0; 901 else 902 msg.txnpcl_id = txnp->txnid; 903 msg.flags = (u_int)flags; 904 905 replyp = __db_db_cursor_4007(&msg, cl); 906 if (replyp == NULL) { 907 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 908 ret = DB_NOSERVER; 909 goto out; 910 } 911 ret = __dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp); 912out: 913 if (replyp != NULL) 914 xdr_free((xdrproc_t)xdr___db_cursor_reply, (void *)replyp); 915 return (ret); 916} 917 918/* 919 * PUBLIC: int __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t)); 920 */ 921int 922__dbcl_db_del(dbp, txnp, key, flags) 923 DB * dbp; 924 DB_TXN * txnp; 925 DBT * key; 926 u_int32_t flags; 927{ 928 CLIENT *cl; 929 __db_del_msg msg; 930 __db_del_reply *replyp = NULL; 931 int ret; 932 DB_ENV *dbenv; 933 934 ret = 0; 935 dbenv = dbp->dbenv; 936 if (dbenv == NULL || !RPC_ON(dbenv)) 937 return (__dbcl_noserver(NULL)); 938 939 cl = (CLIENT *)dbenv->cl_handle; 940 941 if (dbp == NULL) 942 msg.dbpcl_id = 0; 943 else 944 msg.dbpcl_id = dbp->cl_id; 945 if (txnp == NULL) 946 msg.txnpcl_id = 0; 947 else 948 msg.txnpcl_id = txnp->txnid; 949 msg.keydlen = key->dlen; 950 msg.keydoff = key->doff; 951 msg.keyulen = key->ulen; 952 msg.keyflags = key->flags; 953 msg.keydata.keydata_val = key->data; 954 msg.keydata.keydata_len = key->size; 955 msg.flags = (u_int)flags; 956 957 replyp = __db_db_del_4007(&msg, cl); 958 if (replyp == NULL) { 959 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 960 ret = DB_NOSERVER; 961 goto out; 962 } 963 ret = replyp->status; 964out: 965 if (replyp != NULL) 966 xdr_free((xdrproc_t)xdr___db_del_reply, (void *)replyp); 967 return (ret); 968} 969 970/* 971 * PUBLIC: int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); 972 */ 973int 974__dbcl_db_get(dbp, txnp, key, data, flags) 975 DB * dbp; 976 DB_TXN * txnp; 977 DBT * key; 978 DBT * data; 979 u_int32_t flags; 980{ 981 CLIENT *cl; 982 __db_get_msg msg; 983 __db_get_reply *replyp = NULL; 984 int ret; 985 DB_ENV *dbenv; 986 987 ret = 0; 988 dbenv = dbp->dbenv; 989 if (dbenv == NULL || !RPC_ON(dbenv)) 990 return (__dbcl_noserver(NULL)); 991 992 cl = (CLIENT *)dbenv->cl_handle; 993 994 if (dbp == NULL) 995 msg.dbpcl_id = 0; 996 else 997 msg.dbpcl_id = dbp->cl_id; 998 if (txnp == NULL) 999 msg.txnpcl_id = 0; 1000 else 1001 msg.txnpcl_id = txnp->txnid; 1002 msg.keydlen = key->dlen; 1003 msg.keydoff = key->doff; 1004 msg.keyulen = key->ulen; 1005 msg.keyflags = key->flags; 1006 msg.keydata.keydata_val = key->data; 1007 msg.keydata.keydata_len = key->size; 1008 msg.datadlen = data->dlen; 1009 msg.datadoff = data->doff; 1010 msg.dataulen = data->ulen; 1011 msg.dataflags = data->flags; 1012 msg.datadata.datadata_val = data->data; 1013 msg.datadata.datadata_len = data->size; 1014 msg.flags = (u_int)flags; 1015 1016 replyp = __db_db_get_4007(&msg, cl); 1017 if (replyp == NULL) { 1018 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1019 ret = DB_NOSERVER; 1020 goto out; 1021 } 1022 ret = __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp); 1023out: 1024 if (replyp != NULL) 1025 xdr_free((xdrproc_t)xdr___db_get_reply, (void *)replyp); 1026 return (ret); 1027} 1028 1029/* 1030 * PUBLIC: int __dbcl_db_get_bt_minkey __P((DB *, u_int32_t *)); 1031 */ 1032int 1033__dbcl_db_get_bt_minkey(dbp, minkeyp) 1034 DB * dbp; 1035 u_int32_t * minkeyp; 1036{ 1037 CLIENT *cl; 1038 __db_get_bt_minkey_msg msg; 1039 __db_get_bt_minkey_reply *replyp = NULL; 1040 int ret; 1041 DB_ENV *dbenv; 1042 1043 ret = 0; 1044 dbenv = dbp->dbenv; 1045 if (dbenv == NULL || !RPC_ON(dbenv)) 1046 return (__dbcl_noserver(NULL)); 1047 1048 cl = (CLIENT *)dbenv->cl_handle; 1049 1050 if (dbp == NULL) 1051 msg.dbpcl_id = 0; 1052 else 1053 msg.dbpcl_id = dbp->cl_id; 1054 1055 replyp = __db_db_get_bt_minkey_4007(&msg, cl); 1056 if (replyp == NULL) { 1057 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1058 ret = DB_NOSERVER; 1059 goto out; 1060 } 1061 ret = replyp->status; 1062 if (minkeyp != NULL) 1063 *minkeyp = (u_int32_t)replyp->minkey; 1064out: 1065 if (replyp != NULL) 1066 xdr_free((xdrproc_t)xdr___db_get_bt_minkey_reply, (void *)replyp); 1067 return (ret); 1068} 1069 1070/* 1071 * PUBLIC: int __dbcl_db_get_dbname __P((DB *, const char * *, 1072 * PUBLIC: const char * *)); 1073 */ 1074int 1075__dbcl_db_get_dbname(dbp, filenamep, dbnamep) 1076 DB * dbp; 1077 const char * * filenamep; 1078 const char * * dbnamep; 1079{ 1080 CLIENT *cl; 1081 __db_get_dbname_msg msg; 1082 __db_get_dbname_reply *replyp = NULL; 1083 int ret; 1084 DB_ENV *dbenv; 1085 1086 ret = 0; 1087 dbenv = dbp->dbenv; 1088 if (dbenv == NULL || !RPC_ON(dbenv)) 1089 return (__dbcl_noserver(NULL)); 1090 1091 cl = (CLIENT *)dbenv->cl_handle; 1092 1093 if (dbp == NULL) 1094 msg.dbpcl_id = 0; 1095 else 1096 msg.dbpcl_id = dbp->cl_id; 1097 1098 replyp = __db_db_get_dbname_4007(&msg, cl); 1099 if (replyp == NULL) { 1100 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1101 ret = DB_NOSERVER; 1102 goto out; 1103 } 1104 ret = replyp->status; 1105 if (filenamep != NULL) 1106 *filenamep = (const char *)replyp->filename; 1107 if (dbnamep != NULL) 1108 *dbnamep = (const char *)replyp->dbname; 1109out: 1110 if (replyp != NULL) 1111 xdr_free((xdrproc_t)xdr___db_get_dbname_reply, (void *)replyp); 1112 return (ret); 1113} 1114 1115/* 1116 * PUBLIC: int __dbcl_db_get_encrypt_flags __P((DB *, u_int32_t *)); 1117 */ 1118int 1119__dbcl_db_get_encrypt_flags(dbp, flagsp) 1120 DB * dbp; 1121 u_int32_t * flagsp; 1122{ 1123 CLIENT *cl; 1124 __db_get_encrypt_flags_msg msg; 1125 __db_get_encrypt_flags_reply *replyp = NULL; 1126 int ret; 1127 DB_ENV *dbenv; 1128 1129 ret = 0; 1130 dbenv = dbp->dbenv; 1131 if (dbenv == NULL || !RPC_ON(dbenv)) 1132 return (__dbcl_noserver(NULL)); 1133 1134 cl = (CLIENT *)dbenv->cl_handle; 1135 1136 if (dbp == NULL) 1137 msg.dbpcl_id = 0; 1138 else 1139 msg.dbpcl_id = dbp->cl_id; 1140 1141 replyp = __db_db_get_encrypt_flags_4007(&msg, cl); 1142 if (replyp == NULL) { 1143 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1144 ret = DB_NOSERVER; 1145 goto out; 1146 } 1147 ret = replyp->status; 1148 if (flagsp != NULL) 1149 *flagsp = (u_int32_t)replyp->flags; 1150out: 1151 if (replyp != NULL) 1152 xdr_free((xdrproc_t)xdr___db_get_encrypt_flags_reply, (void *)replyp); 1153 return (ret); 1154} 1155 1156/* 1157 * PUBLIC: int __dbcl_db_get_flags __P((DB *, u_int32_t *)); 1158 */ 1159int 1160__dbcl_db_get_flags(dbp, flagsp) 1161 DB * dbp; 1162 u_int32_t * flagsp; 1163{ 1164 CLIENT *cl; 1165 __db_get_flags_msg msg; 1166 __db_get_flags_reply *replyp = NULL; 1167 int ret; 1168 DB_ENV *dbenv; 1169 1170 ret = 0; 1171 dbenv = dbp->dbenv; 1172 if (dbenv == NULL || !RPC_ON(dbenv)) 1173 return (__dbcl_noserver(NULL)); 1174 1175 cl = (CLIENT *)dbenv->cl_handle; 1176 1177 if (dbp == NULL) 1178 msg.dbpcl_id = 0; 1179 else 1180 msg.dbpcl_id = dbp->cl_id; 1181 1182 replyp = __db_db_get_flags_4007(&msg, cl); 1183 if (replyp == NULL) { 1184 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1185 ret = DB_NOSERVER; 1186 goto out; 1187 } 1188 ret = replyp->status; 1189 if (flagsp != NULL) 1190 *flagsp = (u_int32_t)replyp->flags; 1191out: 1192 if (replyp != NULL) 1193 xdr_free((xdrproc_t)xdr___db_get_flags_reply, (void *)replyp); 1194 return (ret); 1195} 1196 1197/* 1198 * PUBLIC: int __dbcl_db_get_h_ffactor __P((DB *, u_int32_t *)); 1199 */ 1200int 1201__dbcl_db_get_h_ffactor(dbp, ffactorp) 1202 DB * dbp; 1203 u_int32_t * ffactorp; 1204{ 1205 CLIENT *cl; 1206 __db_get_h_ffactor_msg msg; 1207 __db_get_h_ffactor_reply *replyp = NULL; 1208 int ret; 1209 DB_ENV *dbenv; 1210 1211 ret = 0; 1212 dbenv = dbp->dbenv; 1213 if (dbenv == NULL || !RPC_ON(dbenv)) 1214 return (__dbcl_noserver(NULL)); 1215 1216 cl = (CLIENT *)dbenv->cl_handle; 1217 1218 if (dbp == NULL) 1219 msg.dbpcl_id = 0; 1220 else 1221 msg.dbpcl_id = dbp->cl_id; 1222 1223 replyp = __db_db_get_h_ffactor_4007(&msg, cl); 1224 if (replyp == NULL) { 1225 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1226 ret = DB_NOSERVER; 1227 goto out; 1228 } 1229 ret = replyp->status; 1230 if (ffactorp != NULL) 1231 *ffactorp = (u_int32_t)replyp->ffactor; 1232out: 1233 if (replyp != NULL) 1234 xdr_free((xdrproc_t)xdr___db_get_h_ffactor_reply, (void *)replyp); 1235 return (ret); 1236} 1237 1238/* 1239 * PUBLIC: int __dbcl_db_get_h_nelem __P((DB *, u_int32_t *)); 1240 */ 1241int 1242__dbcl_db_get_h_nelem(dbp, nelemp) 1243 DB * dbp; 1244 u_int32_t * nelemp; 1245{ 1246 CLIENT *cl; 1247 __db_get_h_nelem_msg msg; 1248 __db_get_h_nelem_reply *replyp = NULL; 1249 int ret; 1250 DB_ENV *dbenv; 1251 1252 ret = 0; 1253 dbenv = dbp->dbenv; 1254 if (dbenv == NULL || !RPC_ON(dbenv)) 1255 return (__dbcl_noserver(NULL)); 1256 1257 cl = (CLIENT *)dbenv->cl_handle; 1258 1259 if (dbp == NULL) 1260 msg.dbpcl_id = 0; 1261 else 1262 msg.dbpcl_id = dbp->cl_id; 1263 1264 replyp = __db_db_get_h_nelem_4007(&msg, cl); 1265 if (replyp == NULL) { 1266 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1267 ret = DB_NOSERVER; 1268 goto out; 1269 } 1270 ret = replyp->status; 1271 if (nelemp != NULL) 1272 *nelemp = (u_int32_t)replyp->nelem; 1273out: 1274 if (replyp != NULL) 1275 xdr_free((xdrproc_t)xdr___db_get_h_nelem_reply, (void *)replyp); 1276 return (ret); 1277} 1278 1279/* 1280 * PUBLIC: int __dbcl_db_get_lorder __P((DB *, int *)); 1281 */ 1282int 1283__dbcl_db_get_lorder(dbp, lorderp) 1284 DB * dbp; 1285 int * lorderp; 1286{ 1287 CLIENT *cl; 1288 __db_get_lorder_msg msg; 1289 __db_get_lorder_reply *replyp = NULL; 1290 int ret; 1291 DB_ENV *dbenv; 1292 1293 ret = 0; 1294 dbenv = dbp->dbenv; 1295 if (dbenv == NULL || !RPC_ON(dbenv)) 1296 return (__dbcl_noserver(NULL)); 1297 1298 cl = (CLIENT *)dbenv->cl_handle; 1299 1300 if (dbp == NULL) 1301 msg.dbpcl_id = 0; 1302 else 1303 msg.dbpcl_id = dbp->cl_id; 1304 1305 replyp = __db_db_get_lorder_4007(&msg, cl); 1306 if (replyp == NULL) { 1307 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1308 ret = DB_NOSERVER; 1309 goto out; 1310 } 1311 ret = replyp->status; 1312 if (lorderp != NULL) 1313 *lorderp = (int)replyp->lorder; 1314out: 1315 if (replyp != NULL) 1316 xdr_free((xdrproc_t)xdr___db_get_lorder_reply, (void *)replyp); 1317 return (ret); 1318} 1319 1320/* 1321 * PUBLIC: int __dbcl_db_get_open_flags __P((DB *, u_int32_t *)); 1322 */ 1323int 1324__dbcl_db_get_open_flags(dbp, flagsp) 1325 DB * dbp; 1326 u_int32_t * flagsp; 1327{ 1328 CLIENT *cl; 1329 __db_get_open_flags_msg msg; 1330 __db_get_open_flags_reply *replyp = NULL; 1331 int ret; 1332 DB_ENV *dbenv; 1333 1334 ret = 0; 1335 dbenv = dbp->dbenv; 1336 if (dbenv == NULL || !RPC_ON(dbenv)) 1337 return (__dbcl_noserver(NULL)); 1338 1339 cl = (CLIENT *)dbenv->cl_handle; 1340 1341 if (dbp == NULL) 1342 msg.dbpcl_id = 0; 1343 else 1344 msg.dbpcl_id = dbp->cl_id; 1345 1346 replyp = __db_db_get_open_flags_4007(&msg, cl); 1347 if (replyp == NULL) { 1348 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1349 ret = DB_NOSERVER; 1350 goto out; 1351 } 1352 ret = replyp->status; 1353 if (flagsp != NULL) 1354 *flagsp = (u_int32_t)replyp->flags; 1355out: 1356 if (replyp != NULL) 1357 xdr_free((xdrproc_t)xdr___db_get_open_flags_reply, (void *)replyp); 1358 return (ret); 1359} 1360 1361/* 1362 * PUBLIC: int __dbcl_db_get_pagesize __P((DB *, u_int32_t *)); 1363 */ 1364int 1365__dbcl_db_get_pagesize(dbp, pagesizep) 1366 DB * dbp; 1367 u_int32_t * pagesizep; 1368{ 1369 CLIENT *cl; 1370 __db_get_pagesize_msg msg; 1371 __db_get_pagesize_reply *replyp = NULL; 1372 int ret; 1373 DB_ENV *dbenv; 1374 1375 ret = 0; 1376 dbenv = dbp->dbenv; 1377 if (dbenv == NULL || !RPC_ON(dbenv)) 1378 return (__dbcl_noserver(NULL)); 1379 1380 cl = (CLIENT *)dbenv->cl_handle; 1381 1382 if (dbp == NULL) 1383 msg.dbpcl_id = 0; 1384 else 1385 msg.dbpcl_id = dbp->cl_id; 1386 1387 replyp = __db_db_get_pagesize_4007(&msg, cl); 1388 if (replyp == NULL) { 1389 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1390 ret = DB_NOSERVER; 1391 goto out; 1392 } 1393 ret = replyp->status; 1394 if (pagesizep != NULL) 1395 *pagesizep = (u_int32_t)replyp->pagesize; 1396out: 1397 if (replyp != NULL) 1398 xdr_free((xdrproc_t)xdr___db_get_pagesize_reply, (void *)replyp); 1399 return (ret); 1400} 1401 1402/* 1403 * PUBLIC: int __dbcl_db_get_priority __P((DB *, DB_CACHE_PRIORITY *)); 1404 */ 1405int 1406__dbcl_db_get_priority(dbp, priorityp) 1407 DB * dbp; 1408 DB_CACHE_PRIORITY * priorityp; 1409{ 1410 CLIENT *cl; 1411 __db_get_priority_msg msg; 1412 __db_get_priority_reply *replyp = NULL; 1413 int ret; 1414 DB_ENV *dbenv; 1415 1416 ret = 0; 1417 dbenv = dbp->dbenv; 1418 if (dbenv == NULL || !RPC_ON(dbenv)) 1419 return (__dbcl_noserver(NULL)); 1420 1421 cl = (CLIENT *)dbenv->cl_handle; 1422 1423 if (dbp == NULL) 1424 msg.dbpcl_id = 0; 1425 else 1426 msg.dbpcl_id = dbp->cl_id; 1427 1428 replyp = __db_db_get_priority_4007(&msg, cl); 1429 if (replyp == NULL) { 1430 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1431 ret = DB_NOSERVER; 1432 goto out; 1433 } 1434 ret = replyp->status; 1435 if (priorityp != NULL) 1436 *priorityp = (DB_CACHE_PRIORITY)replyp->priority; 1437out: 1438 if (replyp != NULL) 1439 xdr_free((xdrproc_t)xdr___db_get_priority_reply, (void *)replyp); 1440 return (ret); 1441} 1442 1443/* 1444 * PUBLIC: int __dbcl_db_get_q_extentsize __P((DB *, u_int32_t *)); 1445 */ 1446int 1447__dbcl_db_get_q_extentsize(dbp, extentsizep) 1448 DB * dbp; 1449 u_int32_t * extentsizep; 1450{ 1451 CLIENT *cl; 1452 __db_get_q_extentsize_msg msg; 1453 __db_get_q_extentsize_reply *replyp = NULL; 1454 int ret; 1455 DB_ENV *dbenv; 1456 1457 ret = 0; 1458 dbenv = dbp->dbenv; 1459 if (dbenv == NULL || !RPC_ON(dbenv)) 1460 return (__dbcl_noserver(NULL)); 1461 1462 cl = (CLIENT *)dbenv->cl_handle; 1463 1464 if (dbp == NULL) 1465 msg.dbpcl_id = 0; 1466 else 1467 msg.dbpcl_id = dbp->cl_id; 1468 1469 replyp = __db_db_get_q_extentsize_4007(&msg, cl); 1470 if (replyp == NULL) { 1471 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1472 ret = DB_NOSERVER; 1473 goto out; 1474 } 1475 ret = replyp->status; 1476 if (extentsizep != NULL) 1477 *extentsizep = (u_int32_t)replyp->extentsize; 1478out: 1479 if (replyp != NULL) 1480 xdr_free((xdrproc_t)xdr___db_get_q_extentsize_reply, (void *)replyp); 1481 return (ret); 1482} 1483 1484/* 1485 * PUBLIC: int __dbcl_db_get_re_delim __P((DB *, int *)); 1486 */ 1487int 1488__dbcl_db_get_re_delim(dbp, delimp) 1489 DB * dbp; 1490 int * delimp; 1491{ 1492 CLIENT *cl; 1493 __db_get_re_delim_msg msg; 1494 __db_get_re_delim_reply *replyp = NULL; 1495 int ret; 1496 DB_ENV *dbenv; 1497 1498 ret = 0; 1499 dbenv = dbp->dbenv; 1500 if (dbenv == NULL || !RPC_ON(dbenv)) 1501 return (__dbcl_noserver(NULL)); 1502 1503 cl = (CLIENT *)dbenv->cl_handle; 1504 1505 if (dbp == NULL) 1506 msg.dbpcl_id = 0; 1507 else 1508 msg.dbpcl_id = dbp->cl_id; 1509 1510 replyp = __db_db_get_re_delim_4007(&msg, cl); 1511 if (replyp == NULL) { 1512 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1513 ret = DB_NOSERVER; 1514 goto out; 1515 } 1516 ret = replyp->status; 1517 if (delimp != NULL) 1518 *delimp = (int)replyp->delim; 1519out: 1520 if (replyp != NULL) 1521 xdr_free((xdrproc_t)xdr___db_get_re_delim_reply, (void *)replyp); 1522 return (ret); 1523} 1524 1525/* 1526 * PUBLIC: int __dbcl_db_get_re_len __P((DB *, u_int32_t *)); 1527 */ 1528int 1529__dbcl_db_get_re_len(dbp, lenp) 1530 DB * dbp; 1531 u_int32_t * lenp; 1532{ 1533 CLIENT *cl; 1534 __db_get_re_len_msg msg; 1535 __db_get_re_len_reply *replyp = NULL; 1536 int ret; 1537 DB_ENV *dbenv; 1538 1539 ret = 0; 1540 dbenv = dbp->dbenv; 1541 if (dbenv == NULL || !RPC_ON(dbenv)) 1542 return (__dbcl_noserver(NULL)); 1543 1544 cl = (CLIENT *)dbenv->cl_handle; 1545 1546 if (dbp == NULL) 1547 msg.dbpcl_id = 0; 1548 else 1549 msg.dbpcl_id = dbp->cl_id; 1550 1551 replyp = __db_db_get_re_len_4007(&msg, cl); 1552 if (replyp == NULL) { 1553 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1554 ret = DB_NOSERVER; 1555 goto out; 1556 } 1557 ret = replyp->status; 1558 if (lenp != NULL) 1559 *lenp = (u_int32_t)replyp->len; 1560out: 1561 if (replyp != NULL) 1562 xdr_free((xdrproc_t)xdr___db_get_re_len_reply, (void *)replyp); 1563 return (ret); 1564} 1565 1566/* 1567 * PUBLIC: int __dbcl_db_get_re_pad __P((DB *, int *)); 1568 */ 1569int 1570__dbcl_db_get_re_pad(dbp, padp) 1571 DB * dbp; 1572 int * padp; 1573{ 1574 CLIENT *cl; 1575 __db_get_re_pad_msg msg; 1576 __db_get_re_pad_reply *replyp = NULL; 1577 int ret; 1578 DB_ENV *dbenv; 1579 1580 ret = 0; 1581 dbenv = dbp->dbenv; 1582 if (dbenv == NULL || !RPC_ON(dbenv)) 1583 return (__dbcl_noserver(NULL)); 1584 1585 cl = (CLIENT *)dbenv->cl_handle; 1586 1587 if (dbp == NULL) 1588 msg.dbpcl_id = 0; 1589 else 1590 msg.dbpcl_id = dbp->cl_id; 1591 1592 replyp = __db_db_get_re_pad_4007(&msg, cl); 1593 if (replyp == NULL) { 1594 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1595 ret = DB_NOSERVER; 1596 goto out; 1597 } 1598 ret = replyp->status; 1599 if (padp != NULL) 1600 *padp = (int)replyp->pad; 1601out: 1602 if (replyp != NULL) 1603 xdr_free((xdrproc_t)xdr___db_get_re_pad_reply, (void *)replyp); 1604 return (ret); 1605} 1606 1607/* 1608 * PUBLIC: int __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t)); 1609 */ 1610int 1611__dbcl_db_join(dbp, curs, dbcp, flags) 1612 DB * dbp; 1613 DBC ** curs; 1614 DBC ** dbcp; 1615 u_int32_t flags; 1616{ 1617 CLIENT *cl; 1618 __db_join_msg msg; 1619 __db_join_reply *replyp = NULL; 1620 int ret; 1621 DB_ENV *dbenv; 1622 DBC ** cursp; 1623 int cursi; 1624 u_int32_t * cursq; 1625 1626 ret = 0; 1627 dbenv = dbp->dbenv; 1628 if (dbenv == NULL || !RPC_ON(dbenv)) 1629 return (__dbcl_noserver(NULL)); 1630 1631 cl = (CLIENT *)dbenv->cl_handle; 1632 1633 if (dbp == NULL) 1634 msg.dbpcl_id = 0; 1635 else 1636 msg.dbpcl_id = dbp->cl_id; 1637 for (cursi = 0, cursp = curs; *cursp != 0; cursi++, cursp++) 1638 ; 1639 msg.curs.curs_len = (u_int)cursi; 1640 if ((ret = __os_calloc(dbenv->env, 1641 msg.curs.curs_len, sizeof(u_int32_t), &msg.curs.curs_val)) != 0) 1642 return (ret); 1643 for (cursq = msg.curs.curs_val, cursp = curs; cursi--; cursq++, cursp++) 1644 *cursq = (*cursp)->cl_id; 1645 msg.flags = (u_int)flags; 1646 1647 replyp = __db_db_join_4007(&msg, cl); 1648 __os_free(dbenv->env, msg.curs.curs_val); 1649 if (replyp == NULL) { 1650 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1651 ret = DB_NOSERVER; 1652 goto out; 1653 } 1654 ret = __dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp); 1655out: 1656 if (replyp != NULL) 1657 xdr_free((xdrproc_t)xdr___db_join_reply, (void *)replyp); 1658 return (ret); 1659} 1660 1661/* 1662 * PUBLIC: int __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, 1663 * PUBLIC: u_int32_t)); 1664 */ 1665int 1666__dbcl_db_key_range(dbp, txnp, key, range, flags) 1667 DB * dbp; 1668 DB_TXN * txnp; 1669 DBT * key; 1670 DB_KEY_RANGE * range; 1671 u_int32_t flags; 1672{ 1673 CLIENT *cl; 1674 __db_key_range_msg msg; 1675 __db_key_range_reply *replyp = NULL; 1676 int ret; 1677 DB_ENV *dbenv; 1678 1679 ret = 0; 1680 dbenv = dbp->dbenv; 1681 if (dbenv == NULL || !RPC_ON(dbenv)) 1682 return (__dbcl_noserver(NULL)); 1683 1684 cl = (CLIENT *)dbenv->cl_handle; 1685 1686 if (dbp == NULL) 1687 msg.dbpcl_id = 0; 1688 else 1689 msg.dbpcl_id = dbp->cl_id; 1690 if (txnp == NULL) 1691 msg.txnpcl_id = 0; 1692 else 1693 msg.txnpcl_id = txnp->txnid; 1694 msg.keydlen = key->dlen; 1695 msg.keydoff = key->doff; 1696 msg.keyulen = key->ulen; 1697 msg.keyflags = key->flags; 1698 msg.keydata.keydata_val = key->data; 1699 msg.keydata.keydata_len = key->size; 1700 msg.flags = (u_int)flags; 1701 1702 replyp = __db_db_key_range_4007(&msg, cl); 1703 if (replyp == NULL) { 1704 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1705 ret = DB_NOSERVER; 1706 goto out; 1707 } 1708 ret = __dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp); 1709out: 1710 if (replyp != NULL) 1711 xdr_free((xdrproc_t)xdr___db_key_range_reply, (void *)replyp); 1712 return (ret); 1713} 1714 1715/* 1716 * PUBLIC: int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *, 1717 * PUBLIC: DBTYPE, u_int32_t, int)); 1718 */ 1719int 1720__dbcl_db_open(dbp, txnp, name, subdb, type, flags, mode) 1721 DB * dbp; 1722 DB_TXN * txnp; 1723 const char * name; 1724 const char * subdb; 1725 DBTYPE type; 1726 u_int32_t flags; 1727 int mode; 1728{ 1729 CLIENT *cl; 1730 __db_open_msg msg; 1731 __db_open_reply *replyp = NULL; 1732 int ret; 1733 DB_ENV *dbenv; 1734 1735 ret = 0; 1736 dbenv = dbp->dbenv; 1737 if (dbenv == NULL || !RPC_ON(dbenv)) 1738 return (__dbcl_noserver(NULL)); 1739 1740 cl = (CLIENT *)dbenv->cl_handle; 1741 1742 if (dbp == NULL) 1743 msg.dbpcl_id = 0; 1744 else 1745 msg.dbpcl_id = dbp->cl_id; 1746 if (txnp == NULL) 1747 msg.txnpcl_id = 0; 1748 else 1749 msg.txnpcl_id = txnp->txnid; 1750 if (name == NULL) 1751 msg.name = ""; 1752 else 1753 msg.name = (char *)name; 1754 if (subdb == NULL) 1755 msg.subdb = ""; 1756 else 1757 msg.subdb = (char *)subdb; 1758 msg.type = (u_int)type; 1759 msg.flags = (u_int)flags; 1760 msg.mode = (u_int)mode; 1761 1762 replyp = __db_db_open_4007(&msg, cl); 1763 if (replyp == NULL) { 1764 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1765 ret = DB_NOSERVER; 1766 goto out; 1767 } 1768 ret = __dbcl_db_open_ret(dbp, txnp, name, subdb, type, flags, mode, replyp); 1769out: 1770 if (replyp != NULL) 1771 xdr_free((xdrproc_t)xdr___db_open_reply, (void *)replyp); 1772 return (ret); 1773} 1774 1775/* 1776 * PUBLIC: int __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, 1777 * PUBLIC: u_int32_t)); 1778 */ 1779int 1780__dbcl_db_pget(dbp, txnp, skey, pkey, data, flags) 1781 DB * dbp; 1782 DB_TXN * txnp; 1783 DBT * skey; 1784 DBT * pkey; 1785 DBT * data; 1786 u_int32_t flags; 1787{ 1788 CLIENT *cl; 1789 __db_pget_msg msg; 1790 __db_pget_reply *replyp = NULL; 1791 int ret; 1792 DB_ENV *dbenv; 1793 1794 ret = 0; 1795 dbenv = dbp->dbenv; 1796 if (dbenv == NULL || !RPC_ON(dbenv)) 1797 return (__dbcl_noserver(NULL)); 1798 1799 cl = (CLIENT *)dbenv->cl_handle; 1800 1801 if (dbp == NULL) 1802 msg.dbpcl_id = 0; 1803 else 1804 msg.dbpcl_id = dbp->cl_id; 1805 if (txnp == NULL) 1806 msg.txnpcl_id = 0; 1807 else 1808 msg.txnpcl_id = txnp->txnid; 1809 msg.skeydlen = skey->dlen; 1810 msg.skeydoff = skey->doff; 1811 msg.skeyulen = skey->ulen; 1812 msg.skeyflags = skey->flags; 1813 msg.skeydata.skeydata_val = skey->data; 1814 msg.skeydata.skeydata_len = skey->size; 1815 msg.pkeydlen = pkey->dlen; 1816 msg.pkeydoff = pkey->doff; 1817 msg.pkeyulen = pkey->ulen; 1818 msg.pkeyflags = pkey->flags; 1819 msg.pkeydata.pkeydata_val = pkey->data; 1820 msg.pkeydata.pkeydata_len = pkey->size; 1821 msg.datadlen = data->dlen; 1822 msg.datadoff = data->doff; 1823 msg.dataulen = data->ulen; 1824 msg.dataflags = data->flags; 1825 msg.datadata.datadata_val = data->data; 1826 msg.datadata.datadata_len = data->size; 1827 msg.flags = (u_int)flags; 1828 1829 replyp = __db_db_pget_4007(&msg, cl); 1830 if (replyp == NULL) { 1831 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1832 ret = DB_NOSERVER; 1833 goto out; 1834 } 1835 ret = __dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, flags, replyp); 1836out: 1837 if (replyp != NULL) 1838 xdr_free((xdrproc_t)xdr___db_pget_reply, (void *)replyp); 1839 return (ret); 1840} 1841 1842/* 1843 * PUBLIC: int __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); 1844 */ 1845int 1846__dbcl_db_put(dbp, txnp, key, data, flags) 1847 DB * dbp; 1848 DB_TXN * txnp; 1849 DBT * key; 1850 DBT * data; 1851 u_int32_t flags; 1852{ 1853 CLIENT *cl; 1854 __db_put_msg msg; 1855 __db_put_reply *replyp = NULL; 1856 int ret; 1857 DB_ENV *dbenv; 1858 1859 ret = 0; 1860 dbenv = dbp->dbenv; 1861 if (dbenv == NULL || !RPC_ON(dbenv)) 1862 return (__dbcl_noserver(NULL)); 1863 1864 cl = (CLIENT *)dbenv->cl_handle; 1865 1866 if (dbp == NULL) 1867 msg.dbpcl_id = 0; 1868 else 1869 msg.dbpcl_id = dbp->cl_id; 1870 if (txnp == NULL) 1871 msg.txnpcl_id = 0; 1872 else 1873 msg.txnpcl_id = txnp->txnid; 1874 msg.keydlen = key->dlen; 1875 msg.keydoff = key->doff; 1876 msg.keyulen = key->ulen; 1877 msg.keyflags = key->flags; 1878 msg.keydata.keydata_val = key->data; 1879 msg.keydata.keydata_len = key->size; 1880 msg.datadlen = data->dlen; 1881 msg.datadoff = data->doff; 1882 msg.dataulen = data->ulen; 1883 msg.dataflags = data->flags; 1884 msg.datadata.datadata_val = data->data; 1885 msg.datadata.datadata_len = data->size; 1886 msg.flags = (u_int)flags; 1887 1888 replyp = __db_db_put_4007(&msg, cl); 1889 if (replyp == NULL) { 1890 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1891 ret = DB_NOSERVER; 1892 goto out; 1893 } 1894 ret = __dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp); 1895out: 1896 if (replyp != NULL) 1897 xdr_free((xdrproc_t)xdr___db_put_reply, (void *)replyp); 1898 return (ret); 1899} 1900 1901/* 1902 * PUBLIC: int __dbcl_db_remove __P((DB *, const char *, const char *, 1903 * PUBLIC: u_int32_t)); 1904 */ 1905int 1906__dbcl_db_remove(dbp, name, subdb, flags) 1907 DB * dbp; 1908 const char * name; 1909 const char * subdb; 1910 u_int32_t flags; 1911{ 1912 CLIENT *cl; 1913 __db_remove_msg msg; 1914 __db_remove_reply *replyp = NULL; 1915 int ret; 1916 DB_ENV *dbenv; 1917 1918 ret = 0; 1919 dbenv = dbp->dbenv; 1920 if (dbenv == NULL || !RPC_ON(dbenv)) 1921 return (__dbcl_noserver(NULL)); 1922 1923 cl = (CLIENT *)dbenv->cl_handle; 1924 1925 if (dbp == NULL) 1926 msg.dbpcl_id = 0; 1927 else 1928 msg.dbpcl_id = dbp->cl_id; 1929 if (name == NULL) 1930 msg.name = ""; 1931 else 1932 msg.name = (char *)name; 1933 if (subdb == NULL) 1934 msg.subdb = ""; 1935 else 1936 msg.subdb = (char *)subdb; 1937 msg.flags = (u_int)flags; 1938 1939 replyp = __db_db_remove_4007(&msg, cl); 1940 if (replyp == NULL) { 1941 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1942 ret = DB_NOSERVER; 1943 goto out; 1944 } 1945 ret = __dbcl_db_remove_ret(dbp, name, subdb, flags, replyp); 1946out: 1947 if (replyp != NULL) 1948 xdr_free((xdrproc_t)xdr___db_remove_reply, (void *)replyp); 1949 return (ret); 1950} 1951 1952/* 1953 * PUBLIC: int __dbcl_db_rename __P((DB *, const char *, const char *, 1954 * PUBLIC: const char *, u_int32_t)); 1955 */ 1956int 1957__dbcl_db_rename(dbp, name, subdb, newname, flags) 1958 DB * dbp; 1959 const char * name; 1960 const char * subdb; 1961 const char * newname; 1962 u_int32_t flags; 1963{ 1964 CLIENT *cl; 1965 __db_rename_msg msg; 1966 __db_rename_reply *replyp = NULL; 1967 int ret; 1968 DB_ENV *dbenv; 1969 1970 ret = 0; 1971 dbenv = dbp->dbenv; 1972 if (dbenv == NULL || !RPC_ON(dbenv)) 1973 return (__dbcl_noserver(NULL)); 1974 1975 cl = (CLIENT *)dbenv->cl_handle; 1976 1977 if (dbp == NULL) 1978 msg.dbpcl_id = 0; 1979 else 1980 msg.dbpcl_id = dbp->cl_id; 1981 if (name == NULL) 1982 msg.name = ""; 1983 else 1984 msg.name = (char *)name; 1985 if (subdb == NULL) 1986 msg.subdb = ""; 1987 else 1988 msg.subdb = (char *)subdb; 1989 if (newname == NULL) 1990 msg.newname = ""; 1991 else 1992 msg.newname = (char *)newname; 1993 msg.flags = (u_int)flags; 1994 1995 replyp = __db_db_rename_4007(&msg, cl); 1996 if (replyp == NULL) { 1997 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 1998 ret = DB_NOSERVER; 1999 goto out; 2000 } 2001 ret = __dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp); 2002out: 2003 if (replyp != NULL) 2004 xdr_free((xdrproc_t)xdr___db_rename_reply, (void *)replyp); 2005 return (ret); 2006} 2007 2008/* 2009 * PUBLIC: int __dbcl_db_set_bt_minkey __P((DB *, u_int32_t)); 2010 */ 2011int 2012__dbcl_db_set_bt_minkey(dbp, minkey) 2013 DB * dbp; 2014 u_int32_t minkey; 2015{ 2016 CLIENT *cl; 2017 __db_set_bt_minkey_msg msg; 2018 __db_set_bt_minkey_reply *replyp = NULL; 2019 int ret; 2020 DB_ENV *dbenv; 2021 2022 ret = 0; 2023 dbenv = dbp->dbenv; 2024 if (dbenv == NULL || !RPC_ON(dbenv)) 2025 return (__dbcl_noserver(NULL)); 2026 2027 cl = (CLIENT *)dbenv->cl_handle; 2028 2029 if (dbp == NULL) 2030 msg.dbpcl_id = 0; 2031 else 2032 msg.dbpcl_id = dbp->cl_id; 2033 msg.minkey = (u_int)minkey; 2034 2035 replyp = __db_db_set_bt_minkey_4007(&msg, cl); 2036 if (replyp == NULL) { 2037 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2038 ret = DB_NOSERVER; 2039 goto out; 2040 } 2041 ret = replyp->status; 2042out: 2043 if (replyp != NULL) 2044 xdr_free((xdrproc_t)xdr___db_set_bt_minkey_reply, (void *)replyp); 2045 return (ret); 2046} 2047 2048/* 2049 * PUBLIC: int __dbcl_db_set_encrypt __P((DB *, const char *, u_int32_t)); 2050 */ 2051int 2052__dbcl_db_set_encrypt(dbp, passwd, flags) 2053 DB * dbp; 2054 const char * passwd; 2055 u_int32_t flags; 2056{ 2057 CLIENT *cl; 2058 __db_set_encrypt_msg msg; 2059 __db_set_encrypt_reply *replyp = NULL; 2060 int ret; 2061 DB_ENV *dbenv; 2062 2063 ret = 0; 2064 dbenv = dbp->dbenv; 2065 if (dbenv == NULL || !RPC_ON(dbenv)) 2066 return (__dbcl_noserver(NULL)); 2067 2068 cl = (CLIENT *)dbenv->cl_handle; 2069 2070 if (dbp == NULL) 2071 msg.dbpcl_id = 0; 2072 else 2073 msg.dbpcl_id = dbp->cl_id; 2074 if (passwd == NULL) 2075 msg.passwd = ""; 2076 else 2077 msg.passwd = (char *)passwd; 2078 msg.flags = (u_int)flags; 2079 2080 replyp = __db_db_set_encrypt_4007(&msg, cl); 2081 if (replyp == NULL) { 2082 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2083 ret = DB_NOSERVER; 2084 goto out; 2085 } 2086 ret = replyp->status; 2087out: 2088 if (replyp != NULL) 2089 xdr_free((xdrproc_t)xdr___db_set_encrypt_reply, (void *)replyp); 2090 return (ret); 2091} 2092 2093/* 2094 * PUBLIC: int __dbcl_db_set_flags __P((DB *, u_int32_t)); 2095 */ 2096int 2097__dbcl_db_set_flags(dbp, flags) 2098 DB * dbp; 2099 u_int32_t flags; 2100{ 2101 CLIENT *cl; 2102 __db_set_flags_msg msg; 2103 __db_set_flags_reply *replyp = NULL; 2104 int ret; 2105 DB_ENV *dbenv; 2106 2107 ret = 0; 2108 dbenv = dbp->dbenv; 2109 if (dbenv == NULL || !RPC_ON(dbenv)) 2110 return (__dbcl_noserver(NULL)); 2111 2112 cl = (CLIENT *)dbenv->cl_handle; 2113 2114 if (dbp == NULL) 2115 msg.dbpcl_id = 0; 2116 else 2117 msg.dbpcl_id = dbp->cl_id; 2118 msg.flags = (u_int)flags; 2119 2120 replyp = __db_db_set_flags_4007(&msg, cl); 2121 if (replyp == NULL) { 2122 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2123 ret = DB_NOSERVER; 2124 goto out; 2125 } 2126 ret = replyp->status; 2127out: 2128 if (replyp != NULL) 2129 xdr_free((xdrproc_t)xdr___db_set_flags_reply, (void *)replyp); 2130 return (ret); 2131} 2132 2133/* 2134 * PUBLIC: int __dbcl_db_set_h_ffactor __P((DB *, u_int32_t)); 2135 */ 2136int 2137__dbcl_db_set_h_ffactor(dbp, ffactor) 2138 DB * dbp; 2139 u_int32_t ffactor; 2140{ 2141 CLIENT *cl; 2142 __db_set_h_ffactor_msg msg; 2143 __db_set_h_ffactor_reply *replyp = NULL; 2144 int ret; 2145 DB_ENV *dbenv; 2146 2147 ret = 0; 2148 dbenv = dbp->dbenv; 2149 if (dbenv == NULL || !RPC_ON(dbenv)) 2150 return (__dbcl_noserver(NULL)); 2151 2152 cl = (CLIENT *)dbenv->cl_handle; 2153 2154 if (dbp == NULL) 2155 msg.dbpcl_id = 0; 2156 else 2157 msg.dbpcl_id = dbp->cl_id; 2158 msg.ffactor = (u_int)ffactor; 2159 2160 replyp = __db_db_set_h_ffactor_4007(&msg, cl); 2161 if (replyp == NULL) { 2162 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2163 ret = DB_NOSERVER; 2164 goto out; 2165 } 2166 ret = replyp->status; 2167out: 2168 if (replyp != NULL) 2169 xdr_free((xdrproc_t)xdr___db_set_h_ffactor_reply, (void *)replyp); 2170 return (ret); 2171} 2172 2173/* 2174 * PUBLIC: int __dbcl_db_set_h_nelem __P((DB *, u_int32_t)); 2175 */ 2176int 2177__dbcl_db_set_h_nelem(dbp, nelem) 2178 DB * dbp; 2179 u_int32_t nelem; 2180{ 2181 CLIENT *cl; 2182 __db_set_h_nelem_msg msg; 2183 __db_set_h_nelem_reply *replyp = NULL; 2184 int ret; 2185 DB_ENV *dbenv; 2186 2187 ret = 0; 2188 dbenv = dbp->dbenv; 2189 if (dbenv == NULL || !RPC_ON(dbenv)) 2190 return (__dbcl_noserver(NULL)); 2191 2192 cl = (CLIENT *)dbenv->cl_handle; 2193 2194 if (dbp == NULL) 2195 msg.dbpcl_id = 0; 2196 else 2197 msg.dbpcl_id = dbp->cl_id; 2198 msg.nelem = (u_int)nelem; 2199 2200 replyp = __db_db_set_h_nelem_4007(&msg, cl); 2201 if (replyp == NULL) { 2202 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2203 ret = DB_NOSERVER; 2204 goto out; 2205 } 2206 ret = replyp->status; 2207out: 2208 if (replyp != NULL) 2209 xdr_free((xdrproc_t)xdr___db_set_h_nelem_reply, (void *)replyp); 2210 return (ret); 2211} 2212 2213/* 2214 * PUBLIC: int __dbcl_db_set_lorder __P((DB *, int)); 2215 */ 2216int 2217__dbcl_db_set_lorder(dbp, lorder) 2218 DB * dbp; 2219 int lorder; 2220{ 2221 CLIENT *cl; 2222 __db_set_lorder_msg msg; 2223 __db_set_lorder_reply *replyp = NULL; 2224 int ret; 2225 DB_ENV *dbenv; 2226 2227 ret = 0; 2228 dbenv = dbp->dbenv; 2229 if (dbenv == NULL || !RPC_ON(dbenv)) 2230 return (__dbcl_noserver(NULL)); 2231 2232 cl = (CLIENT *)dbenv->cl_handle; 2233 2234 if (dbp == NULL) 2235 msg.dbpcl_id = 0; 2236 else 2237 msg.dbpcl_id = dbp->cl_id; 2238 msg.lorder = (u_int)lorder; 2239 2240 replyp = __db_db_set_lorder_4007(&msg, cl); 2241 if (replyp == NULL) { 2242 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2243 ret = DB_NOSERVER; 2244 goto out; 2245 } 2246 ret = replyp->status; 2247out: 2248 if (replyp != NULL) 2249 xdr_free((xdrproc_t)xdr___db_set_lorder_reply, (void *)replyp); 2250 return (ret); 2251} 2252 2253/* 2254 * PUBLIC: int __dbcl_db_set_pagesize __P((DB *, u_int32_t)); 2255 */ 2256int 2257__dbcl_db_set_pagesize(dbp, pagesize) 2258 DB * dbp; 2259 u_int32_t pagesize; 2260{ 2261 CLIENT *cl; 2262 __db_set_pagesize_msg msg; 2263 __db_set_pagesize_reply *replyp = NULL; 2264 int ret; 2265 DB_ENV *dbenv; 2266 2267 ret = 0; 2268 dbenv = dbp->dbenv; 2269 if (dbenv == NULL || !RPC_ON(dbenv)) 2270 return (__dbcl_noserver(NULL)); 2271 2272 cl = (CLIENT *)dbenv->cl_handle; 2273 2274 if (dbp == NULL) 2275 msg.dbpcl_id = 0; 2276 else 2277 msg.dbpcl_id = dbp->cl_id; 2278 msg.pagesize = (u_int)pagesize; 2279 2280 replyp = __db_db_set_pagesize_4007(&msg, cl); 2281 if (replyp == NULL) { 2282 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2283 ret = DB_NOSERVER; 2284 goto out; 2285 } 2286 ret = replyp->status; 2287out: 2288 if (replyp != NULL) 2289 xdr_free((xdrproc_t)xdr___db_set_pagesize_reply, (void *)replyp); 2290 return (ret); 2291} 2292 2293/* 2294 * PUBLIC: int __dbcl_db_set_priority __P((DB *, DB_CACHE_PRIORITY)); 2295 */ 2296int 2297__dbcl_db_set_priority(dbp, priority) 2298 DB * dbp; 2299 DB_CACHE_PRIORITY priority; 2300{ 2301 CLIENT *cl; 2302 __db_set_priority_msg msg; 2303 __db_set_priority_reply *replyp = NULL; 2304 int ret; 2305 DB_ENV *dbenv; 2306 2307 ret = 0; 2308 dbenv = dbp->dbenv; 2309 if (dbenv == NULL || !RPC_ON(dbenv)) 2310 return (__dbcl_noserver(NULL)); 2311 2312 cl = (CLIENT *)dbenv->cl_handle; 2313 2314 if (dbp == NULL) 2315 msg.dbpcl_id = 0; 2316 else 2317 msg.dbpcl_id = dbp->cl_id; 2318 msg.priority = (u_int)priority; 2319 2320 replyp = __db_db_set_priority_4007(&msg, cl); 2321 if (replyp == NULL) { 2322 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2323 ret = DB_NOSERVER; 2324 goto out; 2325 } 2326 ret = replyp->status; 2327out: 2328 if (replyp != NULL) 2329 xdr_free((xdrproc_t)xdr___db_set_priority_reply, (void *)replyp); 2330 return (ret); 2331} 2332 2333/* 2334 * PUBLIC: int __dbcl_db_set_q_extentsize __P((DB *, u_int32_t)); 2335 */ 2336int 2337__dbcl_db_set_q_extentsize(dbp, extentsize) 2338 DB * dbp; 2339 u_int32_t extentsize; 2340{ 2341 CLIENT *cl; 2342 __db_set_q_extentsize_msg msg; 2343 __db_set_q_extentsize_reply *replyp = NULL; 2344 int ret; 2345 DB_ENV *dbenv; 2346 2347 ret = 0; 2348 dbenv = dbp->dbenv; 2349 if (dbenv == NULL || !RPC_ON(dbenv)) 2350 return (__dbcl_noserver(NULL)); 2351 2352 cl = (CLIENT *)dbenv->cl_handle; 2353 2354 if (dbp == NULL) 2355 msg.dbpcl_id = 0; 2356 else 2357 msg.dbpcl_id = dbp->cl_id; 2358 msg.extentsize = (u_int)extentsize; 2359 2360 replyp = __db_db_set_q_extentsize_4007(&msg, cl); 2361 if (replyp == NULL) { 2362 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2363 ret = DB_NOSERVER; 2364 goto out; 2365 } 2366 ret = replyp->status; 2367out: 2368 if (replyp != NULL) 2369 xdr_free((xdrproc_t)xdr___db_set_q_extentsize_reply, (void *)replyp); 2370 return (ret); 2371} 2372 2373/* 2374 * PUBLIC: int __dbcl_db_set_re_delim __P((DB *, int)); 2375 */ 2376int 2377__dbcl_db_set_re_delim(dbp, delim) 2378 DB * dbp; 2379 int delim; 2380{ 2381 CLIENT *cl; 2382 __db_set_re_delim_msg msg; 2383 __db_set_re_delim_reply *replyp = NULL; 2384 int ret; 2385 DB_ENV *dbenv; 2386 2387 ret = 0; 2388 dbenv = dbp->dbenv; 2389 if (dbenv == NULL || !RPC_ON(dbenv)) 2390 return (__dbcl_noserver(NULL)); 2391 2392 cl = (CLIENT *)dbenv->cl_handle; 2393 2394 if (dbp == NULL) 2395 msg.dbpcl_id = 0; 2396 else 2397 msg.dbpcl_id = dbp->cl_id; 2398 msg.delim = (u_int)delim; 2399 2400 replyp = __db_db_set_re_delim_4007(&msg, cl); 2401 if (replyp == NULL) { 2402 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2403 ret = DB_NOSERVER; 2404 goto out; 2405 } 2406 ret = replyp->status; 2407out: 2408 if (replyp != NULL) 2409 xdr_free((xdrproc_t)xdr___db_set_re_delim_reply, (void *)replyp); 2410 return (ret); 2411} 2412 2413/* 2414 * PUBLIC: int __dbcl_db_set_re_len __P((DB *, u_int32_t)); 2415 */ 2416int 2417__dbcl_db_set_re_len(dbp, len) 2418 DB * dbp; 2419 u_int32_t len; 2420{ 2421 CLIENT *cl; 2422 __db_set_re_len_msg msg; 2423 __db_set_re_len_reply *replyp = NULL; 2424 int ret; 2425 DB_ENV *dbenv; 2426 2427 ret = 0; 2428 dbenv = dbp->dbenv; 2429 if (dbenv == NULL || !RPC_ON(dbenv)) 2430 return (__dbcl_noserver(NULL)); 2431 2432 cl = (CLIENT *)dbenv->cl_handle; 2433 2434 if (dbp == NULL) 2435 msg.dbpcl_id = 0; 2436 else 2437 msg.dbpcl_id = dbp->cl_id; 2438 msg.len = (u_int)len; 2439 2440 replyp = __db_db_set_re_len_4007(&msg, cl); 2441 if (replyp == NULL) { 2442 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2443 ret = DB_NOSERVER; 2444 goto out; 2445 } 2446 ret = replyp->status; 2447out: 2448 if (replyp != NULL) 2449 xdr_free((xdrproc_t)xdr___db_set_re_len_reply, (void *)replyp); 2450 return (ret); 2451} 2452 2453/* 2454 * PUBLIC: int __dbcl_db_set_re_pad __P((DB *, int)); 2455 */ 2456int 2457__dbcl_db_set_re_pad(dbp, pad) 2458 DB * dbp; 2459 int pad; 2460{ 2461 CLIENT *cl; 2462 __db_set_re_pad_msg msg; 2463 __db_set_re_pad_reply *replyp = NULL; 2464 int ret; 2465 DB_ENV *dbenv; 2466 2467 ret = 0; 2468 dbenv = dbp->dbenv; 2469 if (dbenv == NULL || !RPC_ON(dbenv)) 2470 return (__dbcl_noserver(NULL)); 2471 2472 cl = (CLIENT *)dbenv->cl_handle; 2473 2474 if (dbp == NULL) 2475 msg.dbpcl_id = 0; 2476 else 2477 msg.dbpcl_id = dbp->cl_id; 2478 msg.pad = (u_int)pad; 2479 2480 replyp = __db_db_set_re_pad_4007(&msg, cl); 2481 if (replyp == NULL) { 2482 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2483 ret = DB_NOSERVER; 2484 goto out; 2485 } 2486 ret = replyp->status; 2487out: 2488 if (replyp != NULL) 2489 xdr_free((xdrproc_t)xdr___db_set_re_pad_reply, (void *)replyp); 2490 return (ret); 2491} 2492 2493/* 2494 * PUBLIC: int __dbcl_db_stat __P((DB *, DB_TXN *, void *, u_int32_t)); 2495 */ 2496int 2497__dbcl_db_stat(dbp, txnp, sp, flags) 2498 DB * dbp; 2499 DB_TXN * txnp; 2500 void * sp; 2501 u_int32_t flags; 2502{ 2503 CLIENT *cl; 2504 __db_stat_msg msg; 2505 __db_stat_reply *replyp = NULL; 2506 int ret; 2507 DB_ENV *dbenv; 2508 2509 ret = 0; 2510 dbenv = dbp->dbenv; 2511 if (dbenv == NULL || !RPC_ON(dbenv)) 2512 return (__dbcl_noserver(NULL)); 2513 2514 cl = (CLIENT *)dbenv->cl_handle; 2515 2516 if (dbp == NULL) 2517 msg.dbpcl_id = 0; 2518 else 2519 msg.dbpcl_id = dbp->cl_id; 2520 if (txnp == NULL) 2521 msg.txnpcl_id = 0; 2522 else 2523 msg.txnpcl_id = txnp->txnid; 2524 msg.flags = (u_int)flags; 2525 2526 replyp = __db_db_stat_4007(&msg, cl); 2527 if (replyp == NULL) { 2528 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2529 ret = DB_NOSERVER; 2530 goto out; 2531 } 2532 ret = __dbcl_db_stat_ret(dbp, txnp, sp, flags, replyp); 2533out: 2534 if (replyp != NULL) 2535 xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)replyp); 2536 return (ret); 2537} 2538 2539/* 2540 * PUBLIC: int __dbcl_db_sync __P((DB *, u_int32_t)); 2541 */ 2542int 2543__dbcl_db_sync(dbp, flags) 2544 DB * dbp; 2545 u_int32_t flags; 2546{ 2547 CLIENT *cl; 2548 __db_sync_msg msg; 2549 __db_sync_reply *replyp = NULL; 2550 int ret; 2551 DB_ENV *dbenv; 2552 2553 ret = 0; 2554 dbenv = dbp->dbenv; 2555 if (dbenv == NULL || !RPC_ON(dbenv)) 2556 return (__dbcl_noserver(NULL)); 2557 2558 cl = (CLIENT *)dbenv->cl_handle; 2559 2560 if (dbp == NULL) 2561 msg.dbpcl_id = 0; 2562 else 2563 msg.dbpcl_id = dbp->cl_id; 2564 msg.flags = (u_int)flags; 2565 2566 replyp = __db_db_sync_4007(&msg, cl); 2567 if (replyp == NULL) { 2568 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2569 ret = DB_NOSERVER; 2570 goto out; 2571 } 2572 ret = replyp->status; 2573out: 2574 if (replyp != NULL) 2575 xdr_free((xdrproc_t)xdr___db_sync_reply, (void *)replyp); 2576 return (ret); 2577} 2578 2579/* 2580 * PUBLIC: int __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t *, 2581 * PUBLIC: u_int32_t)); 2582 */ 2583int 2584__dbcl_db_truncate(dbp, txnp, countp, flags) 2585 DB * dbp; 2586 DB_TXN * txnp; 2587 u_int32_t * countp; 2588 u_int32_t flags; 2589{ 2590 CLIENT *cl; 2591 __db_truncate_msg msg; 2592 __db_truncate_reply *replyp = NULL; 2593 int ret; 2594 DB_ENV *dbenv; 2595 2596 ret = 0; 2597 dbenv = dbp->dbenv; 2598 if (dbenv == NULL || !RPC_ON(dbenv)) 2599 return (__dbcl_noserver(NULL)); 2600 2601 cl = (CLIENT *)dbenv->cl_handle; 2602 2603 if (dbp == NULL) 2604 msg.dbpcl_id = 0; 2605 else 2606 msg.dbpcl_id = dbp->cl_id; 2607 if (txnp == NULL) 2608 msg.txnpcl_id = 0; 2609 else 2610 msg.txnpcl_id = txnp->txnid; 2611 msg.flags = (u_int)flags; 2612 2613 replyp = __db_db_truncate_4007(&msg, cl); 2614 if (replyp == NULL) { 2615 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2616 ret = DB_NOSERVER; 2617 goto out; 2618 } 2619 ret = __dbcl_db_truncate_ret(dbp, txnp, countp, flags, replyp); 2620out: 2621 if (replyp != NULL) 2622 xdr_free((xdrproc_t)xdr___db_truncate_reply, (void *)replyp); 2623 return (ret); 2624} 2625 2626/* 2627 * PUBLIC: int __dbcl_dbc_close __P((DBC *)); 2628 */ 2629int 2630__dbcl_dbc_close(dbc) 2631 DBC * dbc; 2632{ 2633 CLIENT *cl; 2634 __dbc_close_msg msg; 2635 __dbc_close_reply *replyp = NULL; 2636 int ret; 2637 DB_ENV *dbenv; 2638 2639 ret = 0; 2640 dbenv = dbc->dbenv; 2641 if (dbenv == NULL || !RPC_ON(dbenv)) 2642 return (__dbcl_noserver(NULL)); 2643 2644 cl = (CLIENT *)dbenv->cl_handle; 2645 2646 if (dbc == NULL) 2647 msg.dbccl_id = 0; 2648 else 2649 msg.dbccl_id = dbc->cl_id; 2650 2651 replyp = __db_dbc_close_4007(&msg, cl); 2652 if (replyp == NULL) { 2653 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2654 ret = DB_NOSERVER; 2655 goto out; 2656 } 2657 ret = __dbcl_dbc_close_ret(dbc, replyp); 2658out: 2659 if (replyp != NULL) 2660 xdr_free((xdrproc_t)xdr___dbc_close_reply, (void *)replyp); 2661 return (ret); 2662} 2663 2664/* 2665 * PUBLIC: int __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t)); 2666 */ 2667int 2668__dbcl_dbc_count(dbc, countp, flags) 2669 DBC * dbc; 2670 db_recno_t * countp; 2671 u_int32_t flags; 2672{ 2673 CLIENT *cl; 2674 __dbc_count_msg msg; 2675 __dbc_count_reply *replyp = NULL; 2676 int ret; 2677 DB_ENV *dbenv; 2678 2679 ret = 0; 2680 dbenv = dbc->dbenv; 2681 if (dbenv == NULL || !RPC_ON(dbenv)) 2682 return (__dbcl_noserver(NULL)); 2683 2684 cl = (CLIENT *)dbenv->cl_handle; 2685 2686 if (dbc == NULL) 2687 msg.dbccl_id = 0; 2688 else 2689 msg.dbccl_id = dbc->cl_id; 2690 msg.flags = (u_int)flags; 2691 2692 replyp = __db_dbc_count_4007(&msg, cl); 2693 if (replyp == NULL) { 2694 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2695 ret = DB_NOSERVER; 2696 goto out; 2697 } 2698 ret = __dbcl_dbc_count_ret(dbc, countp, flags, replyp); 2699out: 2700 if (replyp != NULL) 2701 xdr_free((xdrproc_t)xdr___dbc_count_reply, (void *)replyp); 2702 return (ret); 2703} 2704 2705/* 2706 * PUBLIC: int __dbcl_dbc_del __P((DBC *, u_int32_t)); 2707 */ 2708int 2709__dbcl_dbc_del(dbc, flags) 2710 DBC * dbc; 2711 u_int32_t flags; 2712{ 2713 CLIENT *cl; 2714 __dbc_del_msg msg; 2715 __dbc_del_reply *replyp = NULL; 2716 int ret; 2717 DB_ENV *dbenv; 2718 2719 ret = 0; 2720 dbenv = dbc->dbenv; 2721 if (dbenv == NULL || !RPC_ON(dbenv)) 2722 return (__dbcl_noserver(NULL)); 2723 2724 cl = (CLIENT *)dbenv->cl_handle; 2725 2726 if (dbc == NULL) 2727 msg.dbccl_id = 0; 2728 else 2729 msg.dbccl_id = dbc->cl_id; 2730 msg.flags = (u_int)flags; 2731 2732 replyp = __db_dbc_del_4007(&msg, cl); 2733 if (replyp == NULL) { 2734 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2735 ret = DB_NOSERVER; 2736 goto out; 2737 } 2738 ret = replyp->status; 2739out: 2740 if (replyp != NULL) 2741 xdr_free((xdrproc_t)xdr___dbc_del_reply, (void *)replyp); 2742 return (ret); 2743} 2744 2745/* 2746 * PUBLIC: int __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t)); 2747 */ 2748int 2749__dbcl_dbc_dup(dbc, dbcp, flags) 2750 DBC * dbc; 2751 DBC ** dbcp; 2752 u_int32_t flags; 2753{ 2754 CLIENT *cl; 2755 __dbc_dup_msg msg; 2756 __dbc_dup_reply *replyp = NULL; 2757 int ret; 2758 DB_ENV *dbenv; 2759 2760 ret = 0; 2761 dbenv = dbc->dbenv; 2762 if (dbenv == NULL || !RPC_ON(dbenv)) 2763 return (__dbcl_noserver(NULL)); 2764 2765 cl = (CLIENT *)dbenv->cl_handle; 2766 2767 if (dbc == NULL) 2768 msg.dbccl_id = 0; 2769 else 2770 msg.dbccl_id = dbc->cl_id; 2771 msg.flags = (u_int)flags; 2772 2773 replyp = __db_dbc_dup_4007(&msg, cl); 2774 if (replyp == NULL) { 2775 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2776 ret = DB_NOSERVER; 2777 goto out; 2778 } 2779 ret = __dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp); 2780out: 2781 if (replyp != NULL) 2782 xdr_free((xdrproc_t)xdr___dbc_dup_reply, (void *)replyp); 2783 return (ret); 2784} 2785 2786/* 2787 * PUBLIC: int __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t)); 2788 */ 2789int 2790__dbcl_dbc_get(dbc, key, data, flags) 2791 DBC * dbc; 2792 DBT * key; 2793 DBT * data; 2794 u_int32_t flags; 2795{ 2796 CLIENT *cl; 2797 __dbc_get_msg msg; 2798 __dbc_get_reply *replyp = NULL; 2799 int ret; 2800 DB_ENV *dbenv; 2801 2802 ret = 0; 2803 dbenv = dbc->dbenv; 2804 if (dbenv == NULL || !RPC_ON(dbenv)) 2805 return (__dbcl_noserver(NULL)); 2806 2807 cl = (CLIENT *)dbenv->cl_handle; 2808 2809 if (dbc == NULL) 2810 msg.dbccl_id = 0; 2811 else 2812 msg.dbccl_id = dbc->cl_id; 2813 msg.keydlen = key->dlen; 2814 msg.keydoff = key->doff; 2815 msg.keyulen = key->ulen; 2816 msg.keyflags = key->flags; 2817 msg.keydata.keydata_val = key->data; 2818 msg.keydata.keydata_len = key->size; 2819 msg.datadlen = data->dlen; 2820 msg.datadoff = data->doff; 2821 msg.dataulen = data->ulen; 2822 msg.dataflags = data->flags; 2823 msg.datadata.datadata_val = data->data; 2824 msg.datadata.datadata_len = data->size; 2825 msg.flags = (u_int)flags; 2826 2827 replyp = __db_dbc_get_4007(&msg, cl); 2828 if (replyp == NULL) { 2829 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2830 ret = DB_NOSERVER; 2831 goto out; 2832 } 2833 ret = __dbcl_dbc_get_ret(dbc, key, data, flags, replyp); 2834out: 2835 if (replyp != NULL) 2836 xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)replyp); 2837 return (ret); 2838} 2839 2840/* 2841 * PUBLIC: int __dbcl_dbc_get_priority __P((DBC *, DB_CACHE_PRIORITY *)); 2842 */ 2843int 2844__dbcl_dbc_get_priority(dbc, priorityp) 2845 DBC * dbc; 2846 DB_CACHE_PRIORITY * priorityp; 2847{ 2848 CLIENT *cl; 2849 __dbc_get_priority_msg msg; 2850 __dbc_get_priority_reply *replyp = NULL; 2851 int ret; 2852 DB_ENV *dbenv; 2853 2854 ret = 0; 2855 dbenv = dbc->dbenv; 2856 if (dbenv == NULL || !RPC_ON(dbenv)) 2857 return (__dbcl_noserver(NULL)); 2858 2859 cl = (CLIENT *)dbenv->cl_handle; 2860 2861 if (dbc == NULL) 2862 msg.dbccl_id = 0; 2863 else 2864 msg.dbccl_id = dbc->cl_id; 2865 2866 replyp = __db_dbc_get_priority_4007(&msg, cl); 2867 if (replyp == NULL) { 2868 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2869 ret = DB_NOSERVER; 2870 goto out; 2871 } 2872 ret = replyp->status; 2873 if (priorityp != NULL) 2874 *priorityp = (DB_CACHE_PRIORITY)replyp->priority; 2875out: 2876 if (replyp != NULL) 2877 xdr_free((xdrproc_t)xdr___dbc_get_priority_reply, (void *)replyp); 2878 return (ret); 2879} 2880 2881/* 2882 * PUBLIC: int __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); 2883 */ 2884int 2885__dbcl_dbc_pget(dbc, skey, pkey, data, flags) 2886 DBC * dbc; 2887 DBT * skey; 2888 DBT * pkey; 2889 DBT * data; 2890 u_int32_t flags; 2891{ 2892 CLIENT *cl; 2893 __dbc_pget_msg msg; 2894 __dbc_pget_reply *replyp = NULL; 2895 int ret; 2896 DB_ENV *dbenv; 2897 2898 ret = 0; 2899 dbenv = dbc->dbenv; 2900 if (dbenv == NULL || !RPC_ON(dbenv)) 2901 return (__dbcl_noserver(NULL)); 2902 2903 cl = (CLIENT *)dbenv->cl_handle; 2904 2905 if (dbc == NULL) 2906 msg.dbccl_id = 0; 2907 else 2908 msg.dbccl_id = dbc->cl_id; 2909 msg.skeydlen = skey->dlen; 2910 msg.skeydoff = skey->doff; 2911 msg.skeyulen = skey->ulen; 2912 msg.skeyflags = skey->flags; 2913 msg.skeydata.skeydata_val = skey->data; 2914 msg.skeydata.skeydata_len = skey->size; 2915 msg.pkeydlen = pkey->dlen; 2916 msg.pkeydoff = pkey->doff; 2917 msg.pkeyulen = pkey->ulen; 2918 msg.pkeyflags = pkey->flags; 2919 msg.pkeydata.pkeydata_val = pkey->data; 2920 msg.pkeydata.pkeydata_len = pkey->size; 2921 msg.datadlen = data->dlen; 2922 msg.datadoff = data->doff; 2923 msg.dataulen = data->ulen; 2924 msg.dataflags = data->flags; 2925 msg.datadata.datadata_val = data->data; 2926 msg.datadata.datadata_len = data->size; 2927 msg.flags = (u_int)flags; 2928 2929 replyp = __db_dbc_pget_4007(&msg, cl); 2930 if (replyp == NULL) { 2931 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2932 ret = DB_NOSERVER; 2933 goto out; 2934 } 2935 ret = __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp); 2936out: 2937 if (replyp != NULL) 2938 xdr_free((xdrproc_t)xdr___dbc_pget_reply, (void *)replyp); 2939 return (ret); 2940} 2941 2942/* 2943 * PUBLIC: int __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t)); 2944 */ 2945int 2946__dbcl_dbc_put(dbc, key, data, flags) 2947 DBC * dbc; 2948 DBT * key; 2949 DBT * data; 2950 u_int32_t flags; 2951{ 2952 CLIENT *cl; 2953 __dbc_put_msg msg; 2954 __dbc_put_reply *replyp = NULL; 2955 int ret; 2956 DB_ENV *dbenv; 2957 2958 ret = 0; 2959 dbenv = dbc->dbenv; 2960 if (dbenv == NULL || !RPC_ON(dbenv)) 2961 return (__dbcl_noserver(NULL)); 2962 2963 cl = (CLIENT *)dbenv->cl_handle; 2964 2965 if (dbc == NULL) 2966 msg.dbccl_id = 0; 2967 else 2968 msg.dbccl_id = dbc->cl_id; 2969 msg.keydlen = key->dlen; 2970 msg.keydoff = key->doff; 2971 msg.keyulen = key->ulen; 2972 msg.keyflags = key->flags; 2973 msg.keydata.keydata_val = key->data; 2974 msg.keydata.keydata_len = key->size; 2975 msg.datadlen = data->dlen; 2976 msg.datadoff = data->doff; 2977 msg.dataulen = data->ulen; 2978 msg.dataflags = data->flags; 2979 msg.datadata.datadata_val = data->data; 2980 msg.datadata.datadata_len = data->size; 2981 msg.flags = (u_int)flags; 2982 2983 replyp = __db_dbc_put_4007(&msg, cl); 2984 if (replyp == NULL) { 2985 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 2986 ret = DB_NOSERVER; 2987 goto out; 2988 } 2989 ret = __dbcl_dbc_put_ret(dbc, key, data, flags, replyp); 2990out: 2991 if (replyp != NULL) 2992 xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)replyp); 2993 return (ret); 2994} 2995 2996/* 2997 * PUBLIC: int __dbcl_dbc_set_priority __P((DBC *, DB_CACHE_PRIORITY)); 2998 */ 2999int 3000__dbcl_dbc_set_priority(dbc, priority) 3001 DBC * dbc; 3002 DB_CACHE_PRIORITY priority; 3003{ 3004 CLIENT *cl; 3005 __dbc_set_priority_msg msg; 3006 __dbc_set_priority_reply *replyp = NULL; 3007 int ret; 3008 DB_ENV *dbenv; 3009 3010 ret = 0; 3011 dbenv = dbc->dbenv; 3012 if (dbenv == NULL || !RPC_ON(dbenv)) 3013 return (__dbcl_noserver(NULL)); 3014 3015 cl = (CLIENT *)dbenv->cl_handle; 3016 3017 if (dbc == NULL) 3018 msg.dbccl_id = 0; 3019 else 3020 msg.dbccl_id = dbc->cl_id; 3021 msg.priority = (u_int)priority; 3022 3023 replyp = __db_dbc_set_priority_4007(&msg, cl); 3024 if (replyp == NULL) { 3025 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 3026 ret = DB_NOSERVER; 3027 goto out; 3028 } 3029 ret = replyp->status; 3030out: 3031 if (replyp != NULL) 3032 xdr_free((xdrproc_t)xdr___dbc_set_priority_reply, (void *)replyp); 3033 return (ret); 3034} 3035 3036/* 3037 * PUBLIC: int __dbcl_txn_abort __P((DB_TXN *)); 3038 */ 3039int 3040__dbcl_txn_abort(txnp) 3041 DB_TXN * txnp; 3042{ 3043 CLIENT *cl; 3044 __txn_abort_msg msg; 3045 __txn_abort_reply *replyp = NULL; 3046 int ret; 3047 DB_ENV *dbenv; 3048 3049 ret = 0; 3050 dbenv = txnp->mgrp->env->dbenv; 3051 if (dbenv == NULL || !RPC_ON(dbenv)) 3052 return (__dbcl_noserver(NULL)); 3053 3054 cl = (CLIENT *)dbenv->cl_handle; 3055 3056 if (txnp == NULL) 3057 msg.txnpcl_id = 0; 3058 else 3059 msg.txnpcl_id = txnp->txnid; 3060 3061 replyp = __db_txn_abort_4007(&msg, cl); 3062 if (replyp == NULL) { 3063 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 3064 ret = DB_NOSERVER; 3065 goto out; 3066 } 3067 ret = __dbcl_txn_abort_ret(txnp, replyp); 3068out: 3069 if (replyp != NULL) 3070 xdr_free((xdrproc_t)xdr___txn_abort_reply, (void *)replyp); 3071 return (ret); 3072} 3073 3074/* 3075 * PUBLIC: int __dbcl_txn_commit __P((DB_TXN *, u_int32_t)); 3076 */ 3077int 3078__dbcl_txn_commit(txnp, flags) 3079 DB_TXN * txnp; 3080 u_int32_t flags; 3081{ 3082 CLIENT *cl; 3083 __txn_commit_msg msg; 3084 __txn_commit_reply *replyp = NULL; 3085 int ret; 3086 DB_ENV *dbenv; 3087 3088 ret = 0; 3089 dbenv = txnp->mgrp->env->dbenv; 3090 if (dbenv == NULL || !RPC_ON(dbenv)) 3091 return (__dbcl_noserver(NULL)); 3092 3093 cl = (CLIENT *)dbenv->cl_handle; 3094 3095 if (txnp == NULL) 3096 msg.txnpcl_id = 0; 3097 else 3098 msg.txnpcl_id = txnp->txnid; 3099 msg.flags = (u_int)flags; 3100 3101 replyp = __db_txn_commit_4007(&msg, cl); 3102 if (replyp == NULL) { 3103 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 3104 ret = DB_NOSERVER; 3105 goto out; 3106 } 3107 ret = __dbcl_txn_commit_ret(txnp, flags, replyp); 3108out: 3109 if (replyp != NULL) 3110 xdr_free((xdrproc_t)xdr___txn_commit_reply, (void *)replyp); 3111 return (ret); 3112} 3113 3114/* 3115 * PUBLIC: int __dbcl_txn_discard __P((DB_TXN *, u_int32_t)); 3116 */ 3117int 3118__dbcl_txn_discard(txnp, flags) 3119 DB_TXN * txnp; 3120 u_int32_t flags; 3121{ 3122 CLIENT *cl; 3123 __txn_discard_msg msg; 3124 __txn_discard_reply *replyp = NULL; 3125 int ret; 3126 DB_ENV *dbenv; 3127 3128 ret = 0; 3129 dbenv = txnp->mgrp->env->dbenv; 3130 if (dbenv == NULL || !RPC_ON(dbenv)) 3131 return (__dbcl_noserver(NULL)); 3132 3133 cl = (CLIENT *)dbenv->cl_handle; 3134 3135 if (txnp == NULL) 3136 msg.txnpcl_id = 0; 3137 else 3138 msg.txnpcl_id = txnp->txnid; 3139 msg.flags = (u_int)flags; 3140 3141 replyp = __db_txn_discard_4007(&msg, cl); 3142 if (replyp == NULL) { 3143 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 3144 ret = DB_NOSERVER; 3145 goto out; 3146 } 3147 ret = __dbcl_txn_discard_ret(txnp, flags, replyp); 3148out: 3149 if (replyp != NULL) 3150 xdr_free((xdrproc_t)xdr___txn_discard_reply, (void *)replyp); 3151 return (ret); 3152} 3153 3154/* 3155 * PUBLIC: int __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *)); 3156 */ 3157int 3158__dbcl_txn_prepare(txnp, gid) 3159 DB_TXN * txnp; 3160 u_int8_t * gid; 3161{ 3162 CLIENT *cl; 3163 __txn_prepare_msg msg; 3164 __txn_prepare_reply *replyp = NULL; 3165 int ret; 3166 DB_ENV *dbenv; 3167 3168 ret = 0; 3169 dbenv = txnp->mgrp->env->dbenv; 3170 if (dbenv == NULL || !RPC_ON(dbenv)) 3171 return (__dbcl_noserver(NULL)); 3172 3173 cl = (CLIENT *)dbenv->cl_handle; 3174 3175 if (txnp == NULL) 3176 msg.txnpcl_id = 0; 3177 else 3178 msg.txnpcl_id = txnp->txnid; 3179 memcpy(msg.gid, gid, 128); 3180 3181 replyp = __db_txn_prepare_4007(&msg, cl); 3182 if (replyp == NULL) { 3183 __db_errx(dbenv->env, clnt_sperror(cl, "Berkeley DB")); 3184 ret = DB_NOSERVER; 3185 goto out; 3186 } 3187 ret = replyp->status; 3188out: 3189 if (replyp != NULL) 3190 xdr_free((xdrproc_t)xdr___txn_prepare_reply, (void *)replyp); 3191 return (ret); 3192} 3193 3194/* 3195 * __dbcl_dbp_init -- 3196 * Initialize DB handle methods. 3197 * 3198 * PUBLIC: void __dbcl_dbp_init __P((DB *)); 3199 */ 3200void 3201__dbcl_dbp_init(dbp) 3202 DB *dbp; 3203{ 3204 dbp->associate = __dbcl_db_associate; 3205 dbp->close = __dbcl_db_close; 3206 dbp->compact = 3207 (int (*)(DB *, DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *)) 3208 __dbcl_dbp_illegal; 3209 dbp->cursor = __dbcl_db_cursor; 3210 dbp->del = __dbcl_db_del; 3211 dbp->fd = 3212 (int (*)(DB *, int *)) 3213 __dbcl_dbp_illegal; 3214 dbp->get = __dbcl_db_get; 3215 dbp->get_bt_minkey = __dbcl_db_get_bt_minkey; 3216 dbp->get_cachesize = 3217 (int (*)(DB *, u_int32_t *, u_int32_t *, int *)) 3218 __dbcl_dbp_illegal; 3219 dbp->get_dbname = __dbcl_db_get_dbname; 3220 dbp->get_encrypt_flags = __dbcl_db_get_encrypt_flags; 3221 dbp->get_flags = __dbcl_db_get_flags; 3222 dbp->get_h_ffactor = __dbcl_db_get_h_ffactor; 3223 dbp->get_h_nelem = __dbcl_db_get_h_nelem; 3224 dbp->get_lorder = __dbcl_db_get_lorder; 3225 dbp->get_mpf = 3226 (DB_MPOOLFILE * (*)(DB *)) 3227 __dbcl_dbp_illegal; 3228 dbp->get_open_flags = __dbcl_db_get_open_flags; 3229 dbp->get_pagesize = __dbcl_db_get_pagesize; 3230 dbp->get_priority = __dbcl_db_get_priority; 3231 dbp->get_q_extentsize = __dbcl_db_get_q_extentsize; 3232 dbp->get_re_delim = __dbcl_db_get_re_delim; 3233 dbp->get_re_len = __dbcl_db_get_re_len; 3234 dbp->get_re_pad = __dbcl_db_get_re_pad; 3235 dbp->get_re_source = 3236 (int (*)(DB *, const char **)) 3237 __dbcl_dbp_illegal; 3238 dbp->join = __dbcl_db_join; 3239 dbp->key_range = __dbcl_db_key_range; 3240 dbp->open = __dbcl_db_open; 3241 dbp->pget = __dbcl_db_pget; 3242 dbp->put = __dbcl_db_put; 3243 dbp->remove = __dbcl_db_remove; 3244 dbp->rename = __dbcl_db_rename; 3245 dbp->set_alloc = 3246 (int (*)(DB *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *))) 3247 __dbcl_dbp_illegal; 3248 dbp->set_append_recno = 3249 (int (*)(DB *, int (*)(DB *, DBT *, db_recno_t))) 3250 __dbcl_dbp_illegal; 3251 dbp->set_bt_compare = 3252 (int (*)(DB *, int (*)(DB *, const DBT *, const DBT *))) 3253 __dbcl_dbp_illegal; 3254 dbp->set_bt_minkey = __dbcl_db_set_bt_minkey; 3255 dbp->set_bt_prefix = 3256 (int (*)(DB *, size_t(*)(DB *, const DBT *, const DBT *))) 3257 __dbcl_dbp_illegal; 3258 dbp->set_cachesize = 3259 (int (*)(DB *, u_int32_t, u_int32_t, int)) 3260 __dbcl_dbp_illegal; 3261 dbp->set_dup_compare = 3262 (int (*)(DB *, int (*)(DB *, const DBT *, const DBT *))) 3263 __dbcl_dbp_illegal; 3264 dbp->set_encrypt = __dbcl_db_set_encrypt; 3265 dbp->set_feedback = 3266 (int (*)(DB *, void (*)(DB *, int, int))) 3267 __dbcl_dbp_illegal; 3268 dbp->set_flags = __dbcl_db_set_flags; 3269 dbp->set_h_compare = 3270 (int (*)(DB *, int (*)(DB *, const DBT *, const DBT *))) 3271 __dbcl_dbp_illegal; 3272 dbp->set_h_ffactor = __dbcl_db_set_h_ffactor; 3273 dbp->set_h_hash = 3274 (int (*)(DB *, u_int32_t(*)(DB *, const void *, u_int32_t))) 3275 __dbcl_dbp_illegal; 3276 dbp->set_h_nelem = __dbcl_db_set_h_nelem; 3277 dbp->set_lorder = __dbcl_db_set_lorder; 3278 dbp->set_pagesize = __dbcl_db_set_pagesize; 3279 dbp->set_paniccall = 3280 (int (*)(DB *, void (*)(DB_ENV *, int))) 3281 __dbcl_dbp_illegal; 3282 dbp->set_priority = __dbcl_db_set_priority; 3283 dbp->set_q_extentsize = __dbcl_db_set_q_extentsize; 3284 dbp->set_re_delim = __dbcl_db_set_re_delim; 3285 dbp->set_re_len = __dbcl_db_set_re_len; 3286 dbp->set_re_pad = __dbcl_db_set_re_pad; 3287 dbp->set_re_source = 3288 (int (*)(DB *, const char *)) 3289 __dbcl_dbp_illegal; 3290 dbp->stat = __dbcl_db_stat; 3291 dbp->stat_print = 3292 (int (*)(DB *, u_int32_t)) 3293 __dbcl_dbp_illegal; 3294 dbp->sync = __dbcl_db_sync; 3295 dbp->truncate = __dbcl_db_truncate; 3296 dbp->upgrade = 3297 (int (*)(DB *, const char *, u_int32_t)) 3298 __dbcl_dbp_illegal; 3299 dbp->verify = 3300 (int (*)(DB *, const char *, const char *, FILE *, u_int32_t)) 3301 __dbcl_dbp_illegal; 3302 return; 3303} 3304 3305/* 3306 * __dbcl_dbc_init -- 3307 * Initialize DBC handle methods. 3308 * 3309 * PUBLIC: void __dbcl_dbc_init __P((DBC *)); 3310 */ 3311void 3312__dbcl_dbc_init(dbc) 3313 DBC *dbc; 3314{ 3315 dbc->close = dbc->c_close = __dbcl_dbc_close; 3316 dbc->count = dbc->c_count = __dbcl_dbc_count; 3317 dbc->del = dbc->c_del = __dbcl_dbc_del; 3318 dbc->dup = dbc->c_dup = __dbcl_dbc_dup; 3319 dbc->get = dbc->c_get = __dbcl_dbc_get; 3320 dbc->get_priority = __dbcl_dbc_get_priority; 3321 dbc->pget = dbc->c_pget = __dbcl_dbc_pget; 3322 dbc->put = dbc->c_put = __dbcl_dbc_put; 3323 dbc->set_priority = __dbcl_dbc_set_priority; 3324 return; 3325} 3326 3327/* 3328 * __dbcl_dbenv_init -- 3329 * Initialize DB_ENV handle methods. 3330 * 3331 * PUBLIC: void __dbcl_dbenv_init __P((DB_ENV *)); 3332 */ 3333void 3334__dbcl_dbenv_init(dbenv) 3335 DB_ENV *dbenv; 3336{ 3337 dbenv->cdsgroup_begin = __dbcl_env_cdsgroup_begin; 3338 dbenv->close = __dbcl_env_close; 3339 dbenv->dbremove = __dbcl_env_dbremove; 3340 dbenv->dbrename = __dbcl_env_dbrename; 3341 dbenv->failchk = 3342 (int (*)(DB_ENV *, u_int32_t)) 3343 __dbcl_dbenv_illegal; 3344 dbenv->fileid_reset = 3345 (int (*)(DB_ENV *, const char *, u_int32_t)) 3346 __dbcl_dbenv_illegal; 3347 dbenv->get_cache_max = 3348 (int (*)(DB_ENV *, u_int32_t *, u_int32_t *)) 3349 __dbcl_dbenv_illegal; 3350 dbenv->get_cachesize = __dbcl_env_get_cachesize; 3351 dbenv->get_data_dirs = 3352 (int (*)(DB_ENV *, const char ***)) 3353 __dbcl_dbenv_illegal; 3354 dbenv->get_encrypt_flags = __dbcl_env_get_encrypt_flags; 3355 dbenv->get_flags = __dbcl_env_get_flags; 3356 dbenv->get_home = __dbcl_env_get_home; 3357 dbenv->get_intermediate_dir_mode = 3358 (int (*)(DB_ENV *, const char **)) 3359 __dbcl_dbenv_illegal; 3360 dbenv->get_lg_bsize = 3361 (int (*)(DB_ENV *, u_int32_t *)) 3362 __dbcl_dbenv_illegal; 3363 dbenv->get_lg_dir = 3364 (int (*)(DB_ENV *, const char **)) 3365 __dbcl_dbenv_illegal; 3366 dbenv->get_lg_filemode = 3367 (int (*)(DB_ENV *, int *)) 3368 __dbcl_dbenv_illegal; 3369 dbenv->get_lg_max = 3370 (int (*)(DB_ENV *, u_int32_t *)) 3371 __dbcl_dbenv_illegal; 3372 dbenv->get_lg_regionmax = 3373 (int (*)(DB_ENV *, u_int32_t *)) 3374 __dbcl_dbenv_illegal; 3375 dbenv->get_lk_conflicts = 3376 (int (*)(DB_ENV *, const u_int8_t **, int *)) 3377 __dbcl_dbenv_illegal; 3378 dbenv->get_lk_detect = 3379 (int (*)(DB_ENV *, u_int32_t *)) 3380 __dbcl_dbenv_illegal; 3381 dbenv->get_lk_max_lockers = 3382 (int (*)(DB_ENV *, u_int32_t *)) 3383 __dbcl_dbenv_illegal; 3384 dbenv->get_lk_max_locks = 3385 (int (*)(DB_ENV *, u_int32_t *)) 3386 __dbcl_dbenv_illegal; 3387 dbenv->get_lk_max_objects = 3388 (int (*)(DB_ENV *, u_int32_t *)) 3389 __dbcl_dbenv_illegal; 3390 dbenv->get_lk_partitions = 3391 (int (*)(DB_ENV *, u_int32_t *)) 3392 __dbcl_dbenv_illegal; 3393 dbenv->get_mp_max_openfd = 3394 (int (*)(DB_ENV *, int *)) 3395 __dbcl_dbenv_illegal; 3396 dbenv->get_mp_max_write = 3397 (int (*)(DB_ENV *, int *, db_timeout_t *)) 3398 __dbcl_dbenv_illegal; 3399 dbenv->get_mp_mmapsize = 3400 (int (*)(DB_ENV *, size_t *)) 3401 __dbcl_dbenv_illegal; 3402 dbenv->get_open_flags = __dbcl_env_get_open_flags; 3403 dbenv->get_shm_key = 3404 (int (*)(DB_ENV *, long *)) 3405 __dbcl_dbenv_illegal; 3406 dbenv->get_thread_count = 3407 (int (*)(DB_ENV *, u_int32_t *)) 3408 __dbcl_dbenv_illegal; 3409 dbenv->get_timeout = 3410 (int (*)(DB_ENV *, db_timeout_t *, u_int32_t)) 3411 __dbcl_dbenv_illegal; 3412 dbenv->get_tmp_dir = 3413 (int (*)(DB_ENV *, const char **)) 3414 __dbcl_dbenv_illegal; 3415 dbenv->get_tx_max = 3416 (int (*)(DB_ENV *, u_int32_t *)) 3417 __dbcl_dbenv_illegal; 3418 dbenv->get_tx_timestamp = 3419 (int (*)(DB_ENV *, time_t *)) 3420 __dbcl_dbenv_illegal; 3421 dbenv->get_verbose = 3422 (int (*)(DB_ENV *, u_int32_t, int *)) 3423 __dbcl_dbenv_illegal; 3424 dbenv->lock_detect = 3425 (int (*)(DB_ENV *, u_int32_t, u_int32_t, int *)) 3426 __dbcl_dbenv_illegal; 3427 dbenv->lock_get = 3428 (int (*)(DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)) 3429 __dbcl_dbenv_illegal; 3430 dbenv->lock_id = 3431 (int (*)(DB_ENV *, u_int32_t *)) 3432 __dbcl_dbenv_illegal; 3433 dbenv->lock_id_free = 3434 (int (*)(DB_ENV *, u_int32_t)) 3435 __dbcl_dbenv_illegal; 3436 dbenv->lock_put = 3437 (int (*)(DB_ENV *, DB_LOCK *)) 3438 __dbcl_dbenv_illegal; 3439 dbenv->lock_stat = 3440 (int (*)(DB_ENV *, DB_LOCK_STAT **, u_int32_t)) 3441 __dbcl_dbenv_illegal; 3442 dbenv->lock_stat_print = 3443 (int (*)(DB_ENV *, u_int32_t)) 3444 __dbcl_dbenv_illegal; 3445 dbenv->lock_vec = 3446 (int (*)(DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)) 3447 __dbcl_dbenv_illegal; 3448 dbenv->log_archive = 3449 (int (*)(DB_ENV *, char ***, u_int32_t)) 3450 __dbcl_dbenv_illegal; 3451 dbenv->log_cursor = 3452 (int (*)(DB_ENV *, DB_LOGC **, u_int32_t)) 3453 __dbcl_dbenv_illegal; 3454 dbenv->log_file = 3455 (int (*)(DB_ENV *, const DB_LSN *, char *, size_t)) 3456 __dbcl_dbenv_illegal; 3457 dbenv->log_flush = 3458 (int (*)(DB_ENV *, const DB_LSN *)) 3459 __dbcl_dbenv_illegal; 3460 dbenv->log_get_config = 3461 (int (*)(DB_ENV *, u_int32_t, int *)) 3462 __dbcl_dbenv_illegal; 3463 dbenv->log_printf = 3464 (int (*)(DB_ENV *, DB_TXN *, const char *, ...)) 3465 __dbcl_dbenv_illegal; 3466 dbenv->log_put = 3467 (int (*)(DB_ENV *, DB_LSN *, const DBT *, u_int32_t)) 3468 __dbcl_dbenv_illegal; 3469 dbenv->log_set_config = 3470 (int (*)(DB_ENV *, u_int32_t, int)) 3471 __dbcl_dbenv_illegal; 3472 dbenv->log_stat = 3473 (int (*)(DB_ENV *, DB_LOG_STAT **, u_int32_t)) 3474 __dbcl_dbenv_illegal; 3475 dbenv->log_stat_print = 3476 (int (*)(DB_ENV *, u_int32_t)) 3477 __dbcl_dbenv_illegal; 3478 dbenv->lsn_reset = 3479 (int (*)(DB_ENV *, const char *, u_int32_t)) 3480 __dbcl_dbenv_illegal; 3481 dbenv->memp_fcreate = 3482 (int (*)(DB_ENV *, DB_MPOOLFILE **, u_int32_t)) 3483 __dbcl_dbenv_illegal; 3484 dbenv->memp_register = 3485 (int (*)(DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *))) 3486 __dbcl_dbenv_illegal; 3487 dbenv->memp_stat = 3488 (int (*)(DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t)) 3489 __dbcl_dbenv_illegal; 3490 dbenv->memp_stat_print = 3491 (int (*)(DB_ENV *, u_int32_t)) 3492 __dbcl_dbenv_illegal; 3493 dbenv->memp_sync = 3494 (int (*)(DB_ENV *, DB_LSN *)) 3495 __dbcl_dbenv_illegal; 3496 dbenv->memp_trickle = 3497 (int (*)(DB_ENV *, int, int *)) 3498 __dbcl_dbenv_illegal; 3499 dbenv->mutex_alloc = 3500 (int (*)(DB_ENV *, u_int32_t, u_int32_t *)) 3501 __dbcl_dbenv_illegal; 3502 dbenv->mutex_free = 3503 (int (*)(DB_ENV *, u_int32_t)) 3504 __dbcl_dbenv_illegal; 3505 dbenv->mutex_get_align = 3506 (int (*)(DB_ENV *, u_int32_t *)) 3507 __dbcl_dbenv_illegal; 3508 dbenv->mutex_get_increment = 3509 (int (*)(DB_ENV *, u_int32_t *)) 3510 __dbcl_dbenv_illegal; 3511 dbenv->mutex_get_max = 3512 (int (*)(DB_ENV *, u_int32_t *)) 3513 __dbcl_dbenv_illegal; 3514 dbenv->mutex_get_tas_spins = 3515 (int (*)(DB_ENV *, u_int32_t *)) 3516 __dbcl_dbenv_illegal; 3517 dbenv->mutex_lock = 3518 (int (*)(DB_ENV *, u_int32_t)) 3519 __dbcl_dbenv_illegal; 3520 dbenv->mutex_set_align = 3521 (int (*)(DB_ENV *, u_int32_t)) 3522 __dbcl_dbenv_illegal; 3523 dbenv->mutex_set_increment = 3524 (int (*)(DB_ENV *, u_int32_t)) 3525 __dbcl_dbenv_illegal; 3526 dbenv->mutex_set_max = 3527 (int (*)(DB_ENV *, u_int32_t)) 3528 __dbcl_dbenv_illegal; 3529 dbenv->mutex_set_tas_spins = 3530 (int (*)(DB_ENV *, u_int32_t)) 3531 __dbcl_dbenv_illegal; 3532 dbenv->mutex_stat = 3533 (int (*)(DB_ENV *, DB_MUTEX_STAT **, u_int32_t)) 3534 __dbcl_dbenv_illegal; 3535 dbenv->mutex_stat_print = 3536 (int (*)(DB_ENV *, u_int32_t)) 3537 __dbcl_dbenv_illegal; 3538 dbenv->mutex_unlock = 3539 (int (*)(DB_ENV *, u_int32_t)) 3540 __dbcl_dbenv_illegal; 3541 dbenv->open = __dbcl_env_open; 3542 dbenv->remove = __dbcl_env_remove; 3543 dbenv->rep_elect = 3544 (int (*)(DB_ENV *, u_int32_t, u_int32_t, u_int32_t)) 3545 __dbcl_dbenv_illegal; 3546 dbenv->rep_flush = 3547 (int (*)(DB_ENV *)) 3548 __dbcl_dbenv_illegal; 3549 dbenv->rep_get_clockskew = 3550 (int (*)(DB_ENV *, u_int32_t *, u_int32_t *)) 3551 __dbcl_dbenv_illegal; 3552 dbenv->rep_get_config = 3553 (int (*)(DB_ENV *, u_int32_t, int *)) 3554 __dbcl_dbenv_illegal; 3555 dbenv->rep_get_limit = 3556 (int (*)(DB_ENV *, u_int32_t *, u_int32_t *)) 3557 __dbcl_dbenv_illegal; 3558 dbenv->rep_get_nsites = 3559 (int (*)(DB_ENV *, u_int32_t *)) 3560 __dbcl_dbenv_illegal; 3561 dbenv->rep_get_priority = 3562 (int (*)(DB_ENV *, u_int32_t *)) 3563 __dbcl_dbenv_illegal; 3564 dbenv->rep_get_request = 3565 (int (*)(DB_ENV *, u_int32_t *, u_int32_t *)) 3566 __dbcl_dbenv_illegal; 3567 dbenv->rep_get_timeout = 3568 (int (*)(DB_ENV *, int, db_timeout_t *)) 3569 __dbcl_dbenv_illegal; 3570 dbenv->rep_process_message = 3571 (int (*)(DB_ENV *, DBT *, DBT *, int, DB_LSN *)) 3572 __dbcl_dbenv_illegal; 3573 dbenv->rep_set_clockskew = 3574 (int (*)(DB_ENV *, u_int32_t, u_int32_t)) 3575 __dbcl_dbenv_illegal; 3576 dbenv->rep_set_config = 3577 (int (*)(DB_ENV *, u_int32_t, int)) 3578 __dbcl_dbenv_illegal; 3579 dbenv->rep_set_limit = 3580 (int (*)(DB_ENV *, u_int32_t, u_int32_t)) 3581 __dbcl_dbenv_illegal; 3582 dbenv->rep_set_nsites = 3583 (int (*)(DB_ENV *, u_int32_t)) 3584 __dbcl_dbenv_illegal; 3585 dbenv->rep_set_priority = 3586 (int (*)(DB_ENV *, u_int32_t)) 3587 __dbcl_dbenv_illegal; 3588 dbenv->rep_set_request = 3589 (int (*)(DB_ENV *, u_int32_t, u_int32_t)) 3590 __dbcl_dbenv_illegal; 3591 dbenv->rep_set_timeout = 3592 (int (*)(DB_ENV *, int, db_timeout_t)) 3593 __dbcl_dbenv_illegal; 3594 dbenv->rep_set_transport = 3595 (int (*)(DB_ENV *, int, int (*)(DB_ENV *, const DBT *, const DBT *, const DB_LSN *, int, u_int32_t))) 3596 __dbcl_dbenv_illegal; 3597 dbenv->rep_start = 3598 (int (*)(DB_ENV *, DBT *, u_int32_t)) 3599 __dbcl_dbenv_illegal; 3600 dbenv->rep_stat = 3601 (int (*)(DB_ENV *, DB_REP_STAT **, u_int32_t)) 3602 __dbcl_dbenv_illegal; 3603 dbenv->rep_stat_print = 3604 (int (*)(DB_ENV *, u_int32_t)) 3605 __dbcl_dbenv_illegal; 3606 dbenv->rep_sync = 3607 (int (*)(DB_ENV *, u_int32_t)) 3608 __dbcl_dbenv_illegal; 3609 dbenv->repmgr_add_remote_site = 3610 (int (*)(DB_ENV *, const char *, u_int, int *, u_int32_t)) 3611 __dbcl_dbenv_illegal; 3612 dbenv->repmgr_get_ack_policy = 3613 (int (*)(DB_ENV *, int *)) 3614 __dbcl_dbenv_illegal; 3615 dbenv->repmgr_set_ack_policy = 3616 (int (*)(DB_ENV *, int)) 3617 __dbcl_dbenv_illegal; 3618 dbenv->repmgr_set_local_site = 3619 (int (*)(DB_ENV *, const char *, u_int, u_int32_t)) 3620 __dbcl_dbenv_illegal; 3621 dbenv->repmgr_site_list = 3622 (int (*)(DB_ENV *, u_int *, DB_REPMGR_SITE **)) 3623 __dbcl_dbenv_illegal; 3624 dbenv->repmgr_start = 3625 (int (*)(DB_ENV *, int, u_int32_t)) 3626 __dbcl_dbenv_illegal; 3627 dbenv->repmgr_stat = 3628 (int (*)(DB_ENV *, DB_REPMGR_STAT **, u_int32_t)) 3629 __dbcl_dbenv_illegal; 3630 dbenv->repmgr_stat_print = 3631 (int (*)(DB_ENV *, u_int32_t)) 3632 __dbcl_dbenv_illegal; 3633 dbenv->set_alloc = 3634 (int (*)(DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *))) 3635 __dbcl_dbenv_illegal; 3636 dbenv->set_app_dispatch = 3637 (int (*)(DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops))) 3638 __dbcl_dbenv_illegal; 3639 dbenv->set_cache_max = 3640 (int (*)(DB_ENV *, u_int32_t, u_int32_t)) 3641 __dbcl_dbenv_illegal; 3642 dbenv->set_cachesize = __dbcl_env_set_cachesize; 3643 dbenv->set_data_dir = 3644 (int (*)(DB_ENV *, const char *)) 3645 __dbcl_dbenv_illegal; 3646 dbenv->set_encrypt = __dbcl_env_set_encrypt; 3647 dbenv->set_event_notify = 3648 (int (*)(DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *))) 3649 __dbcl_dbenv_illegal; 3650 dbenv->set_feedback = 3651 (int (*)(DB_ENV *, void (*)(DB_ENV *, int, int))) 3652 __dbcl_dbenv_illegal; 3653 dbenv->set_flags = __dbcl_env_set_flags; 3654 dbenv->set_intermediate_dir_mode = 3655 (int (*)(DB_ENV *, const char *)) 3656 __dbcl_dbenv_illegal; 3657 dbenv->set_isalive = 3658 (int (*)(DB_ENV *, int (*)(DB_ENV *, pid_t, db_threadid_t, u_int32_t))) 3659 __dbcl_dbenv_illegal; 3660 dbenv->set_lg_bsize = 3661 (int (*)(DB_ENV *, u_int32_t)) 3662 __dbcl_dbenv_illegal; 3663 dbenv->set_lg_dir = 3664 (int (*)(DB_ENV *, const char *)) 3665 __dbcl_dbenv_illegal; 3666 dbenv->set_lg_filemode = 3667 (int (*)(DB_ENV *, int)) 3668 __dbcl_dbenv_illegal; 3669 dbenv->set_lg_max = 3670 (int (*)(DB_ENV *, u_int32_t)) 3671 __dbcl_dbenv_illegal; 3672 dbenv->set_lg_regionmax = 3673 (int (*)(DB_ENV *, u_int32_t)) 3674 __dbcl_dbenv_illegal; 3675 dbenv->set_lk_conflicts = 3676 (int (*)(DB_ENV *, u_int8_t *, int)) 3677 __dbcl_dbenv_illegal; 3678 dbenv->set_lk_detect = 3679 (int (*)(DB_ENV *, u_int32_t)) 3680 __dbcl_dbenv_illegal; 3681 dbenv->set_lk_max_lockers = 3682 (int (*)(DB_ENV *, u_int32_t)) 3683 __dbcl_dbenv_illegal; 3684 dbenv->set_lk_max_locks = 3685 (int (*)(DB_ENV *, u_int32_t)) 3686 __dbcl_dbenv_illegal; 3687 dbenv->set_lk_max_objects = 3688 (int (*)(DB_ENV *, u_int32_t)) 3689 __dbcl_dbenv_illegal; 3690 dbenv->set_lk_partitions = 3691 (int (*)(DB_ENV *, u_int32_t)) 3692 __dbcl_dbenv_illegal; 3693 dbenv->set_mp_max_openfd = 3694 (int (*)(DB_ENV *, int)) 3695 __dbcl_dbenv_illegal; 3696 dbenv->set_mp_max_write = 3697 (int (*)(DB_ENV *, int, db_timeout_t)) 3698 __dbcl_dbenv_illegal; 3699 dbenv->set_mp_mmapsize = 3700 (int (*)(DB_ENV *, size_t)) 3701 __dbcl_dbenv_illegal; 3702 dbenv->set_paniccall = 3703 (int (*)(DB_ENV *, void (*)(DB_ENV *, int))) 3704 __dbcl_dbenv_illegal; 3705 dbenv->set_rpc_server = __dbcl_env_set_rpc_server; 3706 dbenv->set_shm_key = 3707 (int (*)(DB_ENV *, long)) 3708 __dbcl_dbenv_illegal; 3709 dbenv->set_thread_count = 3710 (int (*)(DB_ENV *, u_int32_t)) 3711 __dbcl_dbenv_illegal; 3712 dbenv->set_thread_id = 3713 (int (*)(DB_ENV *, void (*)(DB_ENV *, pid_t *, db_threadid_t*))) 3714 __dbcl_dbenv_illegal; 3715 dbenv->set_thread_id_string = 3716 (int (*)(DB_ENV *, char *(*)(DB_ENV *, pid_t, db_threadid_t, char *))) 3717 __dbcl_dbenv_illegal; 3718 dbenv->set_timeout = 3719 (int (*)(DB_ENV *, u_int32_t, u_int32_t)) 3720 __dbcl_dbenv_illegal; 3721 dbenv->set_tmp_dir = 3722 (int (*)(DB_ENV *, const char *)) 3723 __dbcl_dbenv_illegal; 3724 dbenv->set_tx_max = 3725 (int (*)(DB_ENV *, u_int32_t)) 3726 __dbcl_dbenv_illegal; 3727 dbenv->set_tx_timestamp = 3728 (int (*)(DB_ENV *, time_t *)) 3729 __dbcl_dbenv_illegal; 3730 dbenv->set_verbose = 3731 (int (*)(DB_ENV *, u_int32_t, int)) 3732 __dbcl_dbenv_illegal; 3733 dbenv->stat_print = 3734 (int (*)(DB_ENV *, u_int32_t)) 3735 __dbcl_dbenv_illegal; 3736 dbenv->txn_begin = __dbcl_env_txn_begin; 3737 dbenv->txn_checkpoint = 3738 (int (*)(DB_ENV *, u_int32_t, u_int32_t, u_int32_t)) 3739 __dbcl_dbenv_illegal; 3740 dbenv->txn_recover = __dbcl_env_txn_recover; 3741 dbenv->txn_stat = 3742 (int (*)(DB_ENV *, DB_TXN_STAT **, u_int32_t)) 3743 __dbcl_dbenv_illegal; 3744 dbenv->txn_stat_print = 3745 (int (*)(DB_ENV *, u_int32_t)) 3746 __dbcl_dbenv_illegal; 3747 return; 3748} 3749 3750/* 3751 * __dbcl_txn_init -- 3752 * Initialize DB_TXN handle methods. 3753 * 3754 * PUBLIC: void __dbcl_txn_init __P((DB_TXN *)); 3755 */ 3756void 3757__dbcl_txn_init(txn) 3758 DB_TXN *txn; 3759{ 3760 txn->abort = __dbcl_txn_abort; 3761 txn->commit = __dbcl_txn_commit; 3762 txn->discard = __dbcl_txn_discard; 3763 txn->get_name = 3764 (int (*)(DB_TXN *, const char **)) 3765 __dbcl_txn_illegal; 3766 txn->prepare = __dbcl_txn_prepare; 3767 txn->set_name = 3768 (int (*)(DB_TXN *, const char *)) 3769 __dbcl_txn_illegal; 3770 return; 3771} 3772 3773