161961e0fSrobinson /* 261961e0fSrobinson * CDDL HEADER START 361961e0fSrobinson * 461961e0fSrobinson * The contents of this file are subject to the terms of the 5*36e852a1SRaja Andra * Common Development and Distribution License (the "License"). 6*36e852a1SRaja Andra * You may not use this file except in compliance with the License. 761961e0fSrobinson * 861961e0fSrobinson * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 961961e0fSrobinson * or http://www.opensolaris.org/os/licensing. 1061961e0fSrobinson * See the License for the specific language governing permissions 1161961e0fSrobinson * and limitations under the License. 1261961e0fSrobinson * 1361961e0fSrobinson * When distributing Covered Code, include this CDDL HEADER in each 1461961e0fSrobinson * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1561961e0fSrobinson * If applicable, add the following below this CDDL HEADER, with the 1661961e0fSrobinson * fields enclosed by brackets "[]" replaced with your own identifying 1761961e0fSrobinson * information: Portions Copyright [yyyy] [name of copyright owner] 1861961e0fSrobinson * 1961961e0fSrobinson * CDDL HEADER END 2061961e0fSrobinson */ 2161961e0fSrobinson 2261961e0fSrobinson /* 23*36e852a1SRaja Andra * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2461961e0fSrobinson * Use is subject to license terms. 2561961e0fSrobinson */ 2661961e0fSrobinson 2761961e0fSrobinson /* 2861961e0fSrobinson * Originally generated using rpcgen. 2961961e0fSrobinson */ 3061961e0fSrobinson 31e8031f0aSraf #include "mt.h" 3261961e0fSrobinson #include <rpc/rpc.h> 3361961e0fSrobinson #include <rpcsvc/nis.h> 3461961e0fSrobinson 3561961e0fSrobinson bool_t 3661961e0fSrobinson xdr_nis_attr(XDR *xdrs, nis_attr *objp) 3761961e0fSrobinson { 3861961e0fSrobinson if (!xdr_string(xdrs, &objp->zattr_ndx, ~0)) 3961961e0fSrobinson return (FALSE); 4061961e0fSrobinson return (xdr_bytes(xdrs, (char **)&objp->zattr_val.zattr_val_val, 4161961e0fSrobinson (uint_t *)&objp->zattr_val.zattr_val_len, ~0)); 4261961e0fSrobinson } 4361961e0fSrobinson 4461961e0fSrobinson bool_t 4561961e0fSrobinson xdr_nis_name(XDR *xdrs, nis_name *objp) 4661961e0fSrobinson { 4761961e0fSrobinson return (xdr_string(xdrs, objp, ~0)); 4861961e0fSrobinson } 4961961e0fSrobinson 5061961e0fSrobinson bool_t 5161961e0fSrobinson xdr_zotypes(XDR *xdrs, zotypes *objp) 5261961e0fSrobinson { 5361961e0fSrobinson return (xdr_enum(xdrs, (enum_t *)objp)); 5461961e0fSrobinson } 5561961e0fSrobinson 5661961e0fSrobinson bool_t 5761961e0fSrobinson xdr_nstype(XDR *xdrs, nstype *objp) 5861961e0fSrobinson { 5961961e0fSrobinson return (xdr_enum(xdrs, (enum_t *)objp)); 6061961e0fSrobinson } 6161961e0fSrobinson 6261961e0fSrobinson bool_t 6361961e0fSrobinson xdr_oar_mask(XDR *xdrs, oar_mask *objp) 6461961e0fSrobinson { 6561961e0fSrobinson if (!xdr_u_int(xdrs, &objp->oa_rights)) 6661961e0fSrobinson return (FALSE); 6761961e0fSrobinson return (xdr_zotypes(xdrs, &objp->oa_otype)); 6861961e0fSrobinson } 6961961e0fSrobinson 7061961e0fSrobinson bool_t 7161961e0fSrobinson xdr_endpoint(XDR *xdrs, endpoint *objp) 7261961e0fSrobinson { 7361961e0fSrobinson if (!xdr_string(xdrs, &objp->uaddr, ~0)) 7461961e0fSrobinson return (FALSE); 7561961e0fSrobinson if (!xdr_string(xdrs, &objp->family, ~0)) 7661961e0fSrobinson return (FALSE); 7761961e0fSrobinson return (xdr_string(xdrs, &objp->proto, ~0)); 7861961e0fSrobinson } 7961961e0fSrobinson 8061961e0fSrobinson bool_t 8161961e0fSrobinson xdr_nis_server(XDR *xdrs, nis_server *objp) 8261961e0fSrobinson { 8361961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->name)) 8461961e0fSrobinson return (FALSE); 8561961e0fSrobinson if (!xdr_array(xdrs, (char **)&objp->ep.ep_val, 8661961e0fSrobinson (uint_t *)&objp->ep.ep_len, ~0, 8761961e0fSrobinson sizeof (endpoint), (xdrproc_t)xdr_endpoint)) 8861961e0fSrobinson return (FALSE); 8961961e0fSrobinson if (!xdr_u_int(xdrs, &objp->key_type)) 9061961e0fSrobinson return (FALSE); 9161961e0fSrobinson return (xdr_netobj(xdrs, &objp->pkey)); 9261961e0fSrobinson } 9361961e0fSrobinson 9461961e0fSrobinson bool_t 9561961e0fSrobinson xdr_directory_obj(XDR *xdrs, directory_obj *objp) 9661961e0fSrobinson { 9761961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->do_name)) 9861961e0fSrobinson return (FALSE); 9961961e0fSrobinson if (!xdr_nstype(xdrs, &objp->do_type)) 10061961e0fSrobinson return (FALSE); 10161961e0fSrobinson if (!xdr_array(xdrs, (char **)&objp->do_servers.do_servers_val, 10261961e0fSrobinson (uint_t *)&objp->do_servers.do_servers_len, ~0, 10361961e0fSrobinson sizeof (nis_server), (xdrproc_t)xdr_nis_server)) 10461961e0fSrobinson return (FALSE); 10561961e0fSrobinson if (!xdr_uint32_t(xdrs, &objp->do_ttl)) 10661961e0fSrobinson return (FALSE); 10761961e0fSrobinson return (xdr_array(xdrs, (char **)&objp->do_armask.do_armask_val, 10861961e0fSrobinson (uint_t *)&objp->do_armask.do_armask_len, ~0, 10961961e0fSrobinson sizeof (oar_mask), (xdrproc_t)xdr_oar_mask)); 11061961e0fSrobinson } 11161961e0fSrobinson 11261961e0fSrobinson bool_t 11361961e0fSrobinson xdr_entry_col(XDR *xdrs, entry_col *objp) 11461961e0fSrobinson { 11561961e0fSrobinson if (!xdr_u_int(xdrs, &objp->ec_flags)) 11661961e0fSrobinson return (FALSE); 11761961e0fSrobinson return (xdr_bytes(xdrs, (char **)&objp->ec_value.ec_value_val, 11861961e0fSrobinson (uint_t *)&objp->ec_value.ec_value_len, ~0)); 11961961e0fSrobinson } 12061961e0fSrobinson 12161961e0fSrobinson bool_t 12261961e0fSrobinson xdr_entry_obj(XDR *xdrs, entry_obj *objp) 12361961e0fSrobinson { 12461961e0fSrobinson if (!xdr_string(xdrs, &objp->en_type, ~0)) 12561961e0fSrobinson return (FALSE); 12661961e0fSrobinson return (xdr_array(xdrs, (char **)&objp->en_cols.en_cols_val, 12761961e0fSrobinson (uint_t *)&objp->en_cols.en_cols_len, ~0, 12861961e0fSrobinson sizeof (entry_col), (xdrproc_t)xdr_entry_col)); 12961961e0fSrobinson } 13061961e0fSrobinson 13161961e0fSrobinson bool_t 13261961e0fSrobinson xdr_group_obj(XDR *xdrs, group_obj *objp) 13361961e0fSrobinson { 13461961e0fSrobinson if (!xdr_u_int(xdrs, &objp->gr_flags)) 13561961e0fSrobinson return (FALSE); 13661961e0fSrobinson return (xdr_array(xdrs, (char **)&objp->gr_members.gr_members_val, 13761961e0fSrobinson (uint_t *)&objp->gr_members.gr_members_len, ~0, 13861961e0fSrobinson sizeof (nis_name), (xdrproc_t)xdr_nis_name)); 13961961e0fSrobinson } 14061961e0fSrobinson 14161961e0fSrobinson bool_t 14261961e0fSrobinson xdr_link_obj(XDR *xdrs, link_obj *objp) 14361961e0fSrobinson { 14461961e0fSrobinson if (!xdr_zotypes(xdrs, &objp->li_rtype)) 14561961e0fSrobinson return (FALSE); 14661961e0fSrobinson if (!xdr_array(xdrs, (char **)&objp->li_attrs.li_attrs_val, 14761961e0fSrobinson (uint_t *)&objp->li_attrs.li_attrs_len, ~0, 14861961e0fSrobinson sizeof (nis_attr), (xdrproc_t)xdr_nis_attr)) 14961961e0fSrobinson return (FALSE); 15061961e0fSrobinson return (xdr_nis_name(xdrs, &objp->li_name)); 15161961e0fSrobinson } 15261961e0fSrobinson 15361961e0fSrobinson bool_t 15461961e0fSrobinson xdr_table_col(XDR *xdrs, table_col *objp) 15561961e0fSrobinson { 15661961e0fSrobinson if (!xdr_string(xdrs, &objp->tc_name, 64)) 15761961e0fSrobinson return (FALSE); 15861961e0fSrobinson if (!xdr_u_int(xdrs, &objp->tc_flags)) 15961961e0fSrobinson return (FALSE); 16061961e0fSrobinson return (xdr_u_int(xdrs, &objp->tc_rights)); 16161961e0fSrobinson } 16261961e0fSrobinson 16361961e0fSrobinson bool_t 16461961e0fSrobinson xdr_table_obj(XDR *xdrs, table_obj *objp) 16561961e0fSrobinson { 16661961e0fSrobinson if (!xdr_string(xdrs, &objp->ta_type, 64)) 16761961e0fSrobinson return (FALSE); 16861961e0fSrobinson if (!xdr_int(xdrs, &objp->ta_maxcol)) 16961961e0fSrobinson return (FALSE); 17061961e0fSrobinson if (!xdr_u_char(xdrs, &objp->ta_sep)) 17161961e0fSrobinson return (FALSE); 17261961e0fSrobinson if (!xdr_array(xdrs, (char **)&objp->ta_cols.ta_cols_val, 17361961e0fSrobinson (uint_t *)&objp->ta_cols.ta_cols_len, ~0, 17461961e0fSrobinson sizeof (table_col), (xdrproc_t)xdr_table_col)) 17561961e0fSrobinson return (FALSE); 17661961e0fSrobinson return (xdr_string(xdrs, &objp->ta_path, ~0)); 17761961e0fSrobinson } 17861961e0fSrobinson 17961961e0fSrobinson bool_t 18061961e0fSrobinson xdr_objdata(XDR *xdrs, objdata *objp) 18161961e0fSrobinson { 18261961e0fSrobinson if (!xdr_zotypes(xdrs, &objp->zo_type)) 18361961e0fSrobinson return (FALSE); 18461961e0fSrobinson 18561961e0fSrobinson switch (objp->zo_type) { 18661961e0fSrobinson case NIS_DIRECTORY_OBJ: 18761961e0fSrobinson return (xdr_directory_obj(xdrs, &objp->objdata_u.di_data)); 18861961e0fSrobinson case NIS_GROUP_OBJ: 18961961e0fSrobinson return (xdr_group_obj(xdrs, &objp->objdata_u.gr_data)); 19061961e0fSrobinson case NIS_TABLE_OBJ: 19161961e0fSrobinson return (xdr_table_obj(xdrs, &objp->objdata_u.ta_data)); 19261961e0fSrobinson case NIS_ENTRY_OBJ: 19361961e0fSrobinson return (xdr_entry_obj(xdrs, &objp->objdata_u.en_data)); 19461961e0fSrobinson case NIS_LINK_OBJ: 19561961e0fSrobinson return (xdr_link_obj(xdrs, &objp->objdata_u.li_data)); 19661961e0fSrobinson case NIS_PRIVATE_OBJ: 19761961e0fSrobinson return (xdr_bytes(xdrs, 19861961e0fSrobinson (char **)&objp->objdata_u.po_data.po_data_val, 19961961e0fSrobinson (uint_t *)&objp->objdata_u.po_data.po_data_len, ~0)); 20061961e0fSrobinson case NIS_NO_OBJ: 20161961e0fSrobinson return (TRUE); 20261961e0fSrobinson case NIS_BOGUS_OBJ: 20361961e0fSrobinson return (TRUE); 20461961e0fSrobinson } 20561961e0fSrobinson return (TRUE); 20661961e0fSrobinson } 20761961e0fSrobinson 20861961e0fSrobinson bool_t 20961961e0fSrobinson xdr_nis_oid(XDR *xdrs, nis_oid *objp) 21061961e0fSrobinson { 21161961e0fSrobinson if (!xdr_uint32_t(xdrs, &objp->ctime)) 21261961e0fSrobinson return (FALSE); 21361961e0fSrobinson return (xdr_uint32_t(xdrs, &objp->mtime)); 21461961e0fSrobinson } 21561961e0fSrobinson 21661961e0fSrobinson bool_t 21761961e0fSrobinson xdr_nis_object(XDR *xdrs, nis_object *objp) 21861961e0fSrobinson { 21961961e0fSrobinson if (!xdr_nis_oid(xdrs, &objp->zo_oid)) 22061961e0fSrobinson return (FALSE); 22161961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->zo_name)) 22261961e0fSrobinson return (FALSE); 22361961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->zo_owner)) 22461961e0fSrobinson return (FALSE); 22561961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->zo_group)) 22661961e0fSrobinson return (FALSE); 22761961e0fSrobinson if (!xdr_nis_name(xdrs, &objp->zo_domain)) 22861961e0fSrobinson return (FALSE); 22961961e0fSrobinson if (!xdr_u_int(xdrs, &objp->zo_access)) 23061961e0fSrobinson return (FALSE); 23161961e0fSrobinson if (!xdr_uint32_t(xdrs, &objp->zo_ttl)) 23261961e0fSrobinson return (FALSE); 23361961e0fSrobinson return (xdr_objdata(xdrs, &objp->zo_data)); 23461961e0fSrobinson } 235