1/* 2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights 7 * Reserved. This file contains Original Code and/or Modifications of 8 * Original Code as defined in and that are subject to the Apple Public 9 * Source License Version 1.0 (the 'License'). You may not use this file 10 * except in compliance with the License. Please obtain a copy of the 11 * License at http://www.apple.com/publicsource and read it before using 12 * this file. 13 * 14 * The Original Code and all software distributed under the License are 15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 19 * License for the specific language governing rights and limitations 20 * under the License." 21 * 22 * @APPLE_LICENSE_HEADER_END@ 23 */ 24/* 25 * Please do not edit this file. 26 * It was generated using rpcgen. 27 */ 28 29#include <sys/cdefs.h> 30#include <stdio.h> 31#include "yp.h" 32#include "ypv1.h" 33#ifndef lint 34__unused static char rcsid[] = "$OpenBSD: ypserv_xdr_v1.c,v 1.1 1997/03/30 20:51:22 maja Exp $"; 35#endif /* not lint */ 36 37bool_t 38xdr_ypreqtype(xdrs, objp) 39 XDR *xdrs; 40 ypreqtype *objp; 41{ 42 43 if (!xdr_enum(xdrs, (enum_t *)objp)) { 44 return (FALSE); 45 } 46 return (TRUE); 47} 48 49bool_t 50xdr_ypresptype(xdrs, objp) 51 XDR *xdrs; 52 ypresptype *objp; 53{ 54 55 if (!xdr_enum(xdrs, (enum_t *)objp)) { 56 return (FALSE); 57 } 58 return (TRUE); 59} 60 61bool_t 62xdr_yprequest(xdrs, objp) 63 XDR *xdrs; 64 yprequest *objp; 65{ 66 if (!xdr_ypreqtype(xdrs, &objp->yp_reqtype)) { 67 printf("error 1\n"); 68 return (FALSE); 69 } 70 switch (objp->yp_reqtype) { 71 case YPREQ_KEY: 72 if (!xdr_ypreq_key(xdrs, &objp->yp_reqbody.yp_req_keytype)) { 73 printf("error 2\n"); 74 return (FALSE); 75 } 76 break; 77 case YPREQ_NOKEY: 78 if (!xdr_ypreq_nokey(xdrs, &objp->yp_reqbody.yp_req_nokeytype)) { 79 printf("error 3\n"); 80 return (FALSE); 81 } 82 break; 83 case YPREQ_MAP_PARMS: 84 if (!xdr_ypmap_parms(xdrs, &objp->yp_reqbody.yp_req_map_parmstype)) { 85 printf("error 4\n"); 86 return (FALSE); 87 } 88 break; 89 default: 90 printf("error 5\n"); 91 return (FALSE); 92 } 93 return (TRUE); 94} 95 96bool_t 97xdr_ypresponse(xdrs, objp) 98 XDR *xdrs; 99 ypresponse *objp; 100{ 101 102 if (!xdr_ypresptype(xdrs, &objp->yp_resptype)) { 103 return (FALSE); 104 } 105 switch (objp->yp_resptype) { 106 case YPRESP_VAL: 107 if (!xdr_ypresp_val(xdrs, &objp->yp_respbody.yp_resp_valtype)) { 108 return (FALSE); 109 } 110 break; 111 case YPRESP_KEY_VAL: 112 if (!xdr_ypresp_key_val(xdrs, &objp->yp_respbody.yp_resp_key_valtype)) { 113 return (FALSE); 114 } 115 break; 116 case YPRESP_MAP_PARMS: 117 if (!xdr_ypmap_parms(xdrs, &objp->yp_respbody.yp_resp_map_parmstype)) { 118 return (FALSE); 119 } 120 break; 121 default: 122 return (FALSE); 123 } 124 return (TRUE); 125} 126 127