[BACK]Return to xdryp.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / yp

Annotation of src/lib/libc/yp/xdryp.c, Revision 1.32

1.32    ! matt        1: /*     $NetBSD: xdryp.c,v 1.31 2012/03/13 21:13:49 christos Exp $      */
1.8       cgd         2:
1.3       deraadt     3: /*
1.27      keihan      4:  * Copyright (c) 1996 Jason R. Thorpe <thorpej@NetBSD.org>.
1.12      thorpej     5:  * All rights reserved.
                      6:  *
1.3       deraadt     7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
1.6       deraadt    15:  * 3. All advertising materials mentioning features or use of this software
                     16:  *    must display the following acknowledgement:
1.12      thorpej    17:  *     This product includes software developed for the NetBSD Project
                     18:  *     by Jason R. Thorpe.
1.6       deraadt    19:  * 4. The name of the author may not be used to endorse or promote products
                     20:  *    derived from this software without specific prior written permission.
1.3       deraadt    21:  *
                     22:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
                     23:  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                     24:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
                     26:  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32:  * SUCH DAMAGE.
                     33:  */
                     34:
1.28      agc        35: /*
                     36:  * Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
                     37:  * All rights reserved.
                     38:  *
                     39:  * Redistribution and use in source and binary forms, with or without
                     40:  * modification, are permitted provided that the following conditions
                     41:  * are met:
                     42:  * 1. Redistributions of source code must retain the above copyright
                     43:  *    notice, this list of conditions and the following disclaimer.
                     44:  * 2. Redistributions in binary form must reproduce the above copyright
                     45:  *    notice, this list of conditions and the following disclaimer in the
                     46:  *    documentation and/or other materials provided with the distribution.
                     47:  *
                     48:  *
                     49:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
                     50:  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                     51:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     52:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
                     53:  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     54:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     55:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     56:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     57:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     58:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     59:  * SUCH DAMAGE.
                     60:  */
                     61:
1.16      christos   62: #include <sys/cdefs.h>
1.10      jtc        63: #if defined(LIBC_SCCS) && !defined(lint)
1.32    ! matt       64: __RCSID("$NetBSD: xdryp.c,v 1.31 2012/03/13 21:13:49 christos Exp $");
1.3       deraadt    65: #endif
                     66:
1.12      thorpej    67: /*
                     68:  * XDR routines used by the YP protocol.  Note that these routines do
                     69:  * not strictly conform to the RPC definition in yp.x.  This file
                     70:  * replicates the functions exported by the Sun YP API; reality is
                     71:  * often inaccurate.
                     72:  */
                     73:
1.17      jtc        74: #include "namespace.h"
1.23      lukem      75:
1.1       deraadt    76: #include <sys/param.h>
                     77: #include <sys/socket.h>
1.23      lukem      78:
                     79: #include <assert.h>
                     80: #include <ctype.h>
1.1       deraadt    81: #include <stdio.h>
1.7       jtc        82: #include <stdlib.h>
                     83: #include <string.h>
1.23      lukem      84:
1.1       deraadt    85: #include <rpc/rpc.h>
                     86: #include <rpc/xdr.h>
                     87: #include <rpcsvc/yp_prot.h>
                     88: #include <rpcsvc/ypclnt.h>
1.17      jtc        89:
                     90: #ifdef __weak_alias
1.25      mycroft    91: __weak_alias(xdr_datum,_xdr_datum)
                     92: __weak_alias(xdr_domainname,_xdr_domainname)
                     93: __weak_alias(xdr_mapname,_xdr_mapname)
                     94: __weak_alias(xdr_peername,_xdr_peername)
                     95: __weak_alias(xdr_yp_inaddr,_xdr_yp_inaddr)
                     96: __weak_alias(xdr_ypall,_xdr_ypall)
                     97: __weak_alias(xdr_ypbind_resp,_xdr_ypbind_resp)
                     98: __weak_alias(xdr_ypbind_setdom,_xdr_ypbind_setdom)
                     99: __weak_alias(xdr_ypdomain_wrap_string,_xdr_ypdomain_wrap_string)
                    100: __weak_alias(xdr_ypmap_parms,_xdr_ypmap_parms)
                    101: __weak_alias(xdr_ypmap_wrap_string,_xdr_ypmap_wrap_string)
                    102: __weak_alias(xdr_ypmaplist,_xdr_ypmaplist)
                    103: __weak_alias(xdr_ypowner_wrap_string,_xdr_ypowner_wrap_string)
                    104: __weak_alias(xdr_yppushresp_xfr,_xdr_yppushresp_xfr)
                    105: __weak_alias(xdr_ypreq_key,_xdr_ypreq_key)
                    106: __weak_alias(xdr_ypreq_nokey,_xdr_ypreq_nokey)
                    107: __weak_alias(xdr_ypreq_xfr,_xdr_ypreq_xfr)
                    108: __weak_alias(xdr_ypresp_key_val,_xdr_ypresp_key_val)
                    109: __weak_alias(xdr_ypresp_maplist,_xdr_ypresp_maplist)
                    110: __weak_alias(xdr_ypresp_master,_xdr_ypresp_master)
                    111: __weak_alias(xdr_ypresp_order,_xdr_ypresp_order)
                    112: __weak_alias(xdr_ypresp_val,_xdr_ypresp_val)
1.17      jtc       113: #endif
1.1       deraadt   114:
1.12      thorpej   115: /*
                    116:  * Functions used only within this file.
                    117:  */
1.32    ! matt      118: static bool_t xdr_ypbind_binding(XDR *, struct ypbind_binding *);
        !           119: static bool_t xdr_ypbind_resptype(XDR *, enum ypbind_resptype *);
        !           120: static bool_t xdr_ypstat(XDR *, enum ypbind_resptype *);
        !           121: static bool_t xdr_ypmaplist_str(XDR *, char *);
1.12      thorpej   122:
1.19      thorpej   123: __warn_references(xdr_domainname,
1.20      thorpej   124:     "warning: this program uses xdr_domainname(), which is deprecated and buggy.")
1.19      thorpej   125:
                    126: bool_t
1.31      christos  127: xdr_domainname(XDR *xdrs, char *objp)
1.19      thorpej   128: {
1.23      lukem     129:
                    130:        _DIAGASSERT(xdrs != NULL);
                    131:        _DIAGASSERT(objp != NULL);
                    132:
1.19      thorpej   133:        return xdr_string(xdrs, &objp, YPMAXDOMAIN);
                    134: }
                    135:
                    136: __warn_references(xdr_peername,
1.20      thorpej   137:     "warning: this program uses xdr_peername(), which is deprecated and buggy.")
1.19      thorpej   138:
                    139: bool_t
1.31      christos  140: xdr_peername(XDR *xdrs, char *objp)
1.19      thorpej   141: {
1.23      lukem     142:
                    143:        _DIAGASSERT(xdrs != NULL);
                    144:        _DIAGASSERT(objp != NULL);
                    145:
1.19      thorpej   146:        return xdr_string(xdrs, &objp, YPMAXPEER);
                    147: }
                    148:
                    149: __warn_references(xdr_mapname,
1.20      thorpej   150:     "warning: this program uses xdr_mapname(), which is deprecated and buggy.")
1.19      thorpej   151:
                    152: bool_t
1.31      christos  153: xdr_mapname(XDR *xdrs, char *objp)
1.19      thorpej   154: {
1.23      lukem     155:
                    156:        _DIAGASSERT(xdrs != NULL);
                    157:        _DIAGASSERT(objp != NULL);
                    158:
1.19      thorpej   159:        return xdr_string(xdrs, &objp, YPMAXMAP);
                    160: }
                    161:
1.12      thorpej   162: bool_t
1.31      christos  163: xdr_ypdomain_wrap_string(XDR *xdrs, char **objp)
1.12      thorpej   164: {
1.23      lukem     165:
                    166:        _DIAGASSERT(xdrs != NULL);
                    167:        _DIAGASSERT(objp != NULL);
                    168:
1.12      thorpej   169:        return xdr_string(xdrs, objp, YPMAXDOMAIN);
                    170: }
                    171:
                    172: bool_t
1.31      christos  173: xdr_ypmap_wrap_string(XDR *xdrs, char **objp)
1.12      thorpej   174: {
1.23      lukem     175:
                    176:        _DIAGASSERT(xdrs != NULL);
                    177:        _DIAGASSERT(objp != NULL);
                    178:
1.12      thorpej   179:        return xdr_string(xdrs, objp, YPMAXMAP);
                    180: }
                    181:
1.1       deraadt   182: bool_t
1.31      christos  183: xdr_ypowner_wrap_string(XDR *xdrs, char **objp)
1.1       deraadt   184: {
1.23      lukem     185:
                    186:        _DIAGASSERT(xdrs != NULL);
                    187:        _DIAGASSERT(objp != NULL);
                    188:
1.12      thorpej   189:        return xdr_string(xdrs, objp, YPMAXPEER);
1.1       deraadt   190: }
                    191:
                    192: bool_t
1.31      christos  193: xdr_datum(XDR *xdrs, datum *objp)
1.1       deraadt   194: {
1.23      lukem     195:
                    196:        _DIAGASSERT(xdrs != NULL);
                    197:        _DIAGASSERT(objp != NULL);
                    198:
1.29      christos  199:        return xdr_bytes(xdrs, __UNCONST(&objp->dptr),
1.12      thorpej   200:            (u_int *)&objp->dsize, YPMAXRECORD);
1.1       deraadt   201: }
                    202:
                    203: bool_t
1.31      christos  204: xdr_ypreq_key(XDR *xdrs, struct ypreq_key *objp)
1.1       deraadt   205: {
1.23      lukem     206:
                    207:        _DIAGASSERT(xdrs != NULL);
                    208:        _DIAGASSERT(objp != NULL);
                    209:
1.29      christos  210:        if (!xdr_ypdomain_wrap_string(xdrs, __UNCONST(&objp->domain)))
1.9       christos  211:                return FALSE;
1.12      thorpej   212:
1.29      christos  213:        if (!xdr_ypmap_wrap_string(xdrs, __UNCONST(&objp->map)))
1.9       christos  214:                return FALSE;
1.12      thorpej   215:
1.13      christos  216:        if (!xdr_datum(xdrs, &objp->keydat))
                    217:                return FALSE;
                    218:
                    219:        return TRUE;
1.1       deraadt   220: }
                    221:
                    222: bool_t
1.31      christos  223: xdr_ypreq_nokey(XDR *xdrs, struct ypreq_nokey *objp)
1.1       deraadt   224: {
1.23      lukem     225:
                    226:        _DIAGASSERT(xdrs != NULL);
                    227:        _DIAGASSERT(objp != NULL);
                    228:
1.29      christos  229:        if (!xdr_ypdomain_wrap_string(xdrs, __UNCONST(&objp->domain)))
1.13      christos  230:                return FALSE;
                    231:
1.29      christos  232:        if (!xdr_ypmap_wrap_string(xdrs, __UNCONST(&objp->map)))
1.9       christos  233:                return FALSE;
1.12      thorpej   234:
1.13      christos  235:        return TRUE;
1.1       deraadt   236: }
                    237:
                    238: bool_t
1.31      christos  239: xdr_yp_inaddr(XDR *xdrs, struct in_addr *objp)
1.1       deraadt   240: {
1.23      lukem     241:
                    242:        _DIAGASSERT(xdrs != NULL);
                    243:        _DIAGASSERT(objp != NULL);
                    244:
1.21      christos  245:        return xdr_opaque(xdrs, (caddr_t)(void *)&objp->s_addr,
1.31      christos  246:            (u_int)sizeof objp->s_addr);
1.1       deraadt   247: }
                    248:
1.12      thorpej   249: static bool_t
1.31      christos  250: xdr_ypbind_binding(XDR *xdrs, struct ypbind_binding *objp)
1.1       deraadt   251: {
1.23      lukem     252:
                    253:        _DIAGASSERT(xdrs != NULL);
                    254:        _DIAGASSERT(objp != NULL);
                    255:
1.12      thorpej   256:        if (!xdr_yp_inaddr(xdrs, &objp->ypbind_binding_addr))
1.9       christos  257:                return FALSE;
1.12      thorpej   258:
1.13      christos  259:        if (!xdr_opaque(xdrs, (void *)&objp->ypbind_binding_port,
1.31      christos  260:            (u_int)sizeof objp->ypbind_binding_port))
1.13      christos  261:                return FALSE;
                    262:
                    263:        return TRUE;
1.1       deraadt   264: }
                    265:
1.12      thorpej   266: static bool_t
1.31      christos  267: xdr_ypbind_resptype(XDR *xdrs, enum ypbind_resptype *objp)
1.1       deraadt   268: {
1.23      lukem     269:
                    270:        _DIAGASSERT(xdrs != NULL);
                    271:        _DIAGASSERT(objp != NULL);
                    272:
1.26      christos  273:        return xdr_enum(xdrs, (enum_t *)(void *)objp);
1.1       deraadt   274: }
                    275:
1.12      thorpej   276: static bool_t
1.31      christos  277: xdr_ypstat(XDR *xdrs, enum ypbind_resptype *objp)
1.1       deraadt   278: {
1.23      lukem     279:
                    280:        _DIAGASSERT(xdrs != NULL);
                    281:        _DIAGASSERT(objp != NULL);
                    282:
1.26      christos  283:        return xdr_enum(xdrs, (enum_t *)(void *)objp);
1.1       deraadt   284: }
                    285:
                    286: bool_t
1.31      christos  287: xdr_ypbind_resp(XDR *xdrs, struct ypbind_resp *objp)
1.1       deraadt   288: {
1.23      lukem     289:
                    290:        _DIAGASSERT(xdrs != NULL);
                    291:        _DIAGASSERT(objp != NULL);
                    292:
1.12      thorpej   293:        if (!xdr_ypbind_resptype(xdrs, &objp->ypbind_status))
1.9       christos  294:                return FALSE;
                    295:
1.1       deraadt   296:        switch (objp->ypbind_status) {
                    297:        case YPBIND_FAIL_VAL:
1.9       christos  298:                return xdr_u_int(xdrs,
1.12      thorpej   299:                    (u_int *)&objp->ypbind_respbody.ypbind_error);
                    300:
1.1       deraadt   301:        case YPBIND_SUCC_VAL:
1.12      thorpej   302:                return xdr_ypbind_binding(xdrs,
                    303:                    &objp->ypbind_respbody.ypbind_bindinfo);
                    304:
1.1       deraadt   305:        default:
1.9       christos  306:                return FALSE;
1.1       deraadt   307:        }
1.7       jtc       308:        /* NOTREACHED */
1.1       deraadt   309: }
                    310:
                    311: bool_t
1.31      christos  312: xdr_ypresp_val(XDR *xdrs, struct ypresp_val *objp)
1.1       deraadt   313: {
1.23      lukem     314:
                    315:        _DIAGASSERT(xdrs != NULL);
                    316:        _DIAGASSERT(objp != NULL);
                    317:
1.26      christos  318:        if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)(void *)&objp->status))
1.9       christos  319:                return FALSE;
1.12      thorpej   320:
1.13      christos  321:        if (!xdr_datum(xdrs, &objp->valdat))
                    322:                return FALSE;
                    323:
                    324:        return TRUE;
1.1       deraadt   325: }
                    326:
                    327: bool_t
1.31      christos  328: xdr_ypbind_setdom(XDR *xdrs, struct ypbind_setdom *objp)
1.1       deraadt   329: {
1.23      lukem     330:        char *cp;
                    331:
                    332:        _DIAGASSERT(xdrs != NULL);
                    333:        _DIAGASSERT(objp != NULL);
                    334:
                    335:        cp = objp->ypsetdom_domain;
1.12      thorpej   336:
1.13      christos  337:        if (!xdr_ypdomain_wrap_string(xdrs, &cp))
1.9       christos  338:                return FALSE;
1.12      thorpej   339:
                    340:        if (!xdr_ypbind_binding(xdrs, &objp->ypsetdom_binding))
1.9       christos  341:                return FALSE;
1.12      thorpej   342:
1.14      thorpej   343:        if (!xdr_u_int(xdrs, &objp->ypsetdom_vers))
1.13      christos  344:                return FALSE;
                    345:
                    346:        return TRUE;
1.1       deraadt   347: }
                    348:
                    349: bool_t
1.31      christos  350: xdr_ypresp_key_val(XDR *xdrs, struct ypresp_key_val *objp)
1.1       deraadt   351: {
1.23      lukem     352:
                    353:        _DIAGASSERT(xdrs != NULL);
                    354:        _DIAGASSERT(objp != NULL);
                    355:
1.26      christos  356:        if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)(void *)&objp->status))
1.9       christos  357:                return FALSE;
1.12      thorpej   358:
                    359:        if (!xdr_datum(xdrs, &objp->valdat))
1.9       christos  360:                return FALSE;
1.12      thorpej   361:
1.13      christos  362:        if (!xdr_datum(xdrs, &objp->keydat))
                    363:                return FALSE;
                    364:
                    365:        return TRUE;
1.1       deraadt   366: }
                    367:
                    368: bool_t
1.31      christos  369: xdr_ypall(XDR *xdrs, struct ypall_callback *incallback)
1.12      thorpej   370: {
                    371:        struct ypresp_key_val out;
                    372:        char key[YPMAXRECORD], val[YPMAXRECORD];
                    373:        bool_t more, status;
1.1       deraadt   374:
1.23      lukem     375:        _DIAGASSERT(xdrs != NULL);
                    376:        _DIAGASSERT(incallback != NULL);
                    377:
1.12      thorpej   378:        /*
                    379:         * Set up key/val struct to be used during the transaction.
                    380:         */
1.7       jtc       381:        memset(&out, 0, sizeof out);
1.12      thorpej   382:        out.keydat.dptr = key;
                    383:        out.keydat.dsize = sizeof(key);
                    384:        out.valdat.dptr = val;
                    385:        out.valdat.dsize = sizeof(val);
                    386:
                    387:        for (;;) {
                    388:                /* Values pending? */
                    389:                if (!xdr_bool(xdrs, &more))
                    390:                        return FALSE;           /* can't tell! */
1.13      christos  391:                if (!more)
1.12      thorpej   392:                        return TRUE;            /* no more */
                    393:
                    394:                /* Transfer key/value pair. */
                    395:                status = xdr_ypresp_key_val(xdrs, &out);
                    396:
                    397:                /*
                    398:                 * If we succeeded, call the callback function.
                    399:                 * The callback will return TRUE when it wants
                    400:                 * no more values.  If we fail, indicate the
                    401:                 * error.
                    402:                 */
1.13      christos  403:                if (status) {
1.21      christos  404:                        if ((*incallback->foreach)((int)out.status,
1.29      christos  405:                            __UNCONST(out.keydat.dptr), out.keydat.dsize,
                    406:                            __UNCONST(out.valdat.dptr), out.valdat.dsize,
1.12      thorpej   407:                            incallback->data))
                    408:                                return TRUE;
                    409:                } else
1.1       deraadt   410:                        return FALSE;
                    411:        }
                    412: }
                    413:
                    414: bool_t
1.31      christos  415: xdr_ypresp_master(XDR *xdrs, struct ypresp_master *objp)
1.1       deraadt   416: {
1.23      lukem     417:
                    418:        _DIAGASSERT(xdrs != NULL);
                    419:        _DIAGASSERT(objp != NULL);
                    420:
1.26      christos  421:        if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)(void *)&objp->status))
1.9       christos  422:                return FALSE;
1.12      thorpej   423:
1.13      christos  424:        if (!xdr_string(xdrs, &objp->master, YPMAXPEER))
                    425:                return FALSE;
                    426:
                    427:        return TRUE;
1.1       deraadt   428: }
                    429:
1.12      thorpej   430: static bool_t
1.31      christos  431: xdr_ypmaplist_str(XDR *xdrs, char *objp)
1.1       deraadt   432: {
1.23      lukem     433:
                    434:        _DIAGASSERT(xdrs != NULL);
                    435:        _DIAGASSERT(objp != NULL);
                    436:
1.7       jtc       437:        return xdr_string(xdrs, &objp, YPMAXMAP+1);
1.1       deraadt   438: }
                    439:
                    440: bool_t
1.31      christos  441: xdr_ypmaplist(XDR *xdrs, struct ypmaplist *objp)
1.1       deraadt   442: {
1.23      lukem     443:
                    444:        _DIAGASSERT(xdrs != NULL);
                    445:        _DIAGASSERT(objp != NULL);
                    446:
1.12      thorpej   447:        if (!xdr_ypmaplist_str(xdrs, objp->ypml_name))
1.9       christos  448:                return FALSE;
1.12      thorpej   449:
1.30      mrg       450:        if (!xdr_pointer(xdrs, (char **)(void *)&objp->ypml_next,
1.31      christos  451:            (u_int)sizeof(struct ypmaplist), (xdrproc_t)xdr_ypmaplist))
1.13      christos  452:                return FALSE;
                    453:
                    454:        return TRUE;
1.1       deraadt   455: }
                    456:
                    457: bool_t
1.31      christos  458: xdr_ypresp_maplist(XDR *xdrs, struct ypresp_maplist *objp)
1.1       deraadt   459: {
1.23      lukem     460:
                    461:        _DIAGASSERT(xdrs != NULL);
                    462:        _DIAGASSERT(objp != NULL);
                    463:
1.26      christos  464:        if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)(void *)&objp->status))
1.9       christos  465:                return FALSE;
1.12      thorpej   466:
1.30      mrg       467:        if (!xdr_pointer(xdrs, (char **)(void *)&objp->list,
1.31      christos  468:            (u_int)sizeof(struct ypmaplist), (xdrproc_t)xdr_ypmaplist))
1.13      christos  469:                return FALSE;
                    470:
                    471:        return TRUE;
1.1       deraadt   472: }
                    473:
                    474: bool_t
1.31      christos  475: xdr_ypresp_order(XDR *xdrs, struct ypresp_order *objp)
1.1       deraadt   476: {
1.23      lukem     477:
                    478:        _DIAGASSERT(xdrs != NULL);
                    479:        _DIAGASSERT(objp != NULL);
                    480:
1.26      christos  481:        if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)(void *)&objp->status))
1.9       christos  482:                return FALSE;
1.12      thorpej   483:
1.14      thorpej   484:        if (!xdr_u_int(xdrs, &objp->ordernum))
1.13      christos  485:                return FALSE;
                    486:
                    487:        return TRUE;
1.12      thorpej   488: }
                    489:
                    490: bool_t
1.31      christos  491: xdr_ypreq_xfr(XDR *xdrs, struct ypreq_xfr *objp)
1.12      thorpej   492: {
1.23      lukem     493:
                    494:        _DIAGASSERT(xdrs != NULL);
                    495:        _DIAGASSERT(objp != NULL);
                    496:
1.13      christos  497:        if (!xdr_ypmap_parms(xdrs, &objp->map_parms))
1.12      thorpej   498:                return FALSE;
                    499:
1.14      thorpej   500:        if (!xdr_u_int(xdrs, &objp->transid))
1.12      thorpej   501:                return FALSE;
                    502:
1.14      thorpej   503:        if (!xdr_u_int(xdrs, &objp->proto))
1.12      thorpej   504:                return FALSE;
                    505:
1.14      thorpej   506:        if (!xdr_u_int(xdrs, &objp->port))
1.12      thorpej   507:                return FALSE;
                    508:
                    509:        return TRUE;
                    510: }
                    511:
                    512: bool_t
1.31      christos  513: xdr_ypmap_parms(XDR *xdrs, struct ypmap_parms *objp)
1.12      thorpej   514: {
1.23      lukem     515:
                    516:        _DIAGASSERT(xdrs != NULL);
                    517:        _DIAGASSERT(objp != NULL);
                    518:
1.29      christos  519:        if (!xdr_ypdomain_wrap_string(xdrs, __UNCONST(&objp->domain)))
1.12      thorpej   520:                return FALSE;
                    521:
1.29      christos  522:        if (!xdr_ypmap_wrap_string(xdrs, __UNCONST(&objp->map)))
1.12      thorpej   523:                return FALSE;
                    524:
1.14      thorpej   525:        if (!xdr_u_int(xdrs, &objp->ordernum))
1.12      thorpej   526:                return FALSE;
                    527:
1.13      christos  528:        if (!xdr_ypowner_wrap_string(xdrs, &objp->owner))
1.12      thorpej   529:                return FALSE;
                    530:
                    531:        return TRUE;
                    532: }
                    533:
                    534: bool_t
1.31      christos  535: xdr_yppushresp_xfr(XDR *xdrs, struct yppushresp_xfr *objp)
1.12      thorpej   536: {
1.23      lukem     537:
                    538:        _DIAGASSERT(xdrs != NULL);
                    539:        _DIAGASSERT(objp != NULL);
                    540:
1.14      thorpej   541:        if (!xdr_u_int(xdrs, &objp->transid))
1.12      thorpej   542:                return FALSE;
                    543:
1.14      thorpej   544:        if (!xdr_enum(xdrs, (enum_t *)&objp->status))
1.12      thorpej   545:                return FALSE;
                    546:
                    547:        return TRUE;
1.1       deraadt   548: }

CVSweb <webmaster@jp.NetBSD.org>