2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * Portions of this source code were derived from Berkeley 2N/A * 4.3 BSD under license from the Regents of the University of 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * XDR routines for the rpcbinder version 3. 2N/A * rpcblist_ptr implements a linked list. The RPCL definition from 2N/A * struct rpcblist *rpcb_next; 2N/A * typedef rpcblist *rpcblist_ptr; 2N/A * Recall that "pointers" in XDR are encoded as a boolean, indicating whether 2N/A * there's any data behind the pointer, followed by the data (if any exists). 2N/A * The boolean can be interpreted as ``more data follows me''; if FALSE then 2N/A * nothing follows the boolean; if TRUE then the boolean is followed by an 2N/A * actual struct rpcb, and another rpcblist_ptr (declared in RPCL as "struct 2N/A * This could be implemented via the xdr_pointer type, though this would 2N/A * result in one recursive call per element in the list. Rather than do that 2N/A * we can ``unwind'' the recursion into a while loop and use xdr_reference to 2N/A * serialize the rpcb elements. 2N/A * more_elements is pre-computed in case the direction is 2N/A * XDR_ENCODE or XDR_FREE. more_elements is overwritten by 2N/A * xdr_bool when the direction is XDR_DECODE. 2N/A * the unfortunate side effect of non-recursion is that in 2N/A * the case of freeing we must remember the next object 2N/A * before we free the current object ... 2N/A * Note that in the subsequent iteration, next_copy 2N/A * gets nulled out by the xdr_reference 2N/A * but next itself survives. 2N/A * xdr_rpcblist() is specified to take a RPCBLIST **, but is identical in 2N/A * functionality to xdr_rpcblist_ptr(). 2N/A * more_elements is pre-computed in case the direction is 2N/A * XDR_ENCODE or XDR_FREE. more_elements is overwritten by 2N/A * xdr_bool when the direction is XDR_DECODE. 2N/A * the unfortunate side effect of non-recursion is that in 2N/A * the case of freeing we must remember the next object 2N/A * before we free the current object ... 2N/A * Note that in the subsequent iteration, next_copy 2N/A * gets nulled out by the xdr_reference 2N/A * but next itself survives. 2N/A * XDR remote call arguments 2N/A * written for XDR_ENCODE direction only 2N/A * All the jugglery for just getting the size of the arguments 2N/A * XDR remote call results 2N/A * written for XDR_DECODE direction only