Hi, could you try the attached patch? I added some edge-cases to test for the existence of 64-bit, unsigned long long, XDR functions (for some reason there are multiple). Hopefully this should allow compilation on OSX.
Regards Mathias On Sun, Nov 2, 2014 at 9:13 PM, Mark Gaiser <mark...@gmail.com> wrote: > On Sun, Nov 2, 2014 at 8:59 PM, Marko Käning <mk-li...@email.de> wrote: > > Any news on this one??? > > > > > > On 22 Oct 2014, at 00:10 , Marko Käning <mk-li...@email.de> wrote: > > > >> On Linux kio-extras seems to build fine, but it doesn’t on OSX: > >> > >> --- > >> > >> [92%] Building C object nfs/CMakeFiles/kio_nfs.dir/rpc_nfs3_prot_xdr.c.o > >> /Users/marko/WC/KDECI-builds/kio-extras/nfs/rpc_nfs3_prot_xdr.c:13:8: > error: implicit declaration of function 'xdr_u_quad_t' > [-Werror,-Wimplicit-function-declaration] > >> if (!xdr_u_quad_t (xdrs, objp)) > >> ^ > >> /Users/marko/WC/KDECI-builds/kio-extras/nfs/rpc_nfs3_prot_xdr.c:11:20: > warning: unused variable 'buf' [-Wunused-variable] > >> register int32_t *buf; > >> ^ > >> /Users/marko/WC/KDECI-builds/kio-extras/nfs/rpc_nfs3_prot_xdr.c:23:8: > error: implicit declaration of function 'xdr_quad_t' > [-Werror,-Wimplicit-function-declaration] > >> if (!xdr_quad_t (xdrs, objp)) > >> ^ > >> /Users/marko/WC/KDECI-builds/kio-extras/nfs/rpc_nfs3_prot_xdr.c:23:8: > note: did you mean 'xdr_u_quad_t'? > >> /Users/marko/WC/KDECI-builds/kio-extras/nfs/rpc_nfs3_prot_xdr.c:13:8: > note: 'xdr_u_quad_t' declared here > >> if (!xdr_u_quad_t (xdrs, objp)) > >> ^ > > I think you need to ping Mathias Tillman for that. > Added him in CC. > > Also, please try to prevent top posting. >
diff --git a/nfs/CMakeLists.txt b/nfs/CMakeLists.txt index 2ed2186e113dad9e9c178cbac680d7c96dff789a..6f098952bd1a09e74273e4dce9820bc3897f7319 100644 --- a/nfs/CMakeLists.txt +++ b/nfs/CMakeLists.txt @@ -1,6 +1,18 @@ +## Check for XDR functions +include(CheckFunctionExists) + +CHECK_FUNCTION_EXISTS(xdr_u_int64_t HAVE_XDR_U_INT64_T) +CHECK_FUNCTION_EXISTS(xdr_uint64_t HAVE_XDR_UINT64_T) +CHECK_FUNCTION_EXISTS(xdr_u_hyper HAVE_XDR_U_HYPER) +CHECK_FUNCTION_EXISTS(xdr_u_longlong_t HAVE_XDR_U_LONGLONG_T) + +if (NOT HAVE_XDR_U_INT64_T AND NOT HAVE_XDR_UINT64_T AND NOT HAVE_XDR_U_HYPER AND NOT HAVE_XDR_U_LONGLONG_T) + message(WARNING "Could not find 64-bit XDR datatype functions, falling back to 32-bit datatypes.") +endif (NOT HAVE_XDR_U_INT64_T AND NOT HAVE_XDR_UINT64_T AND NOT HAVE_XDR_U_HYPER AND NOT HAVE_XDR_U_LONGLONG_T) + add_definitions(-DTRANSLATION_DOMAIN=\"kio_nfs\") -add_library(kio_nfs MODULE kio_nfs.cpp nfsv2.cpp nfsv3.cpp rpc_mnt3_xdr.c rpc_nfs3_prot_xdr.c rpc_mnt2_xdr.c rpc_nfs2_prot_xdr.c) +add_library(kio_nfs MODULE kio_nfs.cpp nfsv2.cpp nfsv3.cpp rpc_nfs3_prot_xdr.c rpc_nfs2_prot_xdr.c) target_link_libraries(kio_nfs KF5::KIOCore KF5::I18n Qt5::Network) install(TARGETS kio_nfs DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/nfs/kio_nfs.h b/nfs/kio_nfs.h index 9943daf670e665121ea51419ea77599ec4d8d4f5..017f3d15c0370188a643d14474daaa55f25a49fd 100644 --- a/nfs/kio_nfs.h +++ b/nfs/kio_nfs.h @@ -32,8 +32,6 @@ #include <QtCore/QTimer> #include <QLoggingCategory> -#include "rpc_mnt2.h" -#include "rpc_mnt3.h" #include "rpc_nfs2_prot.h" #include "rpc_nfs3_prot.h" diff --git a/nfs/nfsv3.cpp b/nfs/nfsv3.cpp index 368a61febc778688507ffb3954caaf69fc18d371..42b40a13dfea26ce28b603afe7e10b6b68ed071f 100644 --- a/nfs/nfsv3.cpp +++ b/nfs/nfsv3.cpp @@ -2009,12 +2009,12 @@ bool NFSProtocolV3::rename(const QString& src, const QString& dest, int& rpcStat memset(&args, 0, sizeof(args)); QByteArray srcByteName = QFile::encodeName(srcFileInfo.fileName()); - srcDirectoryFH.toFH(args.fromfile.dir); - args.fromfile.name = srcByteName.data(); + srcDirectoryFH.toFH(args.from.dir); + args.from.name = srcByteName.data(); QByteArray destByteName = QFile::encodeName(destFileInfo.fileName()); - destDirectoryFH.toFH(args.tofile.dir); - args.tofile.name = destByteName.data(); + destDirectoryFH.toFH(args.to.dir); + args.to.name = destByteName.data(); rpcStatus = clnt_call(m_nfsClient, NFSPROC3_RENAME, (xdrproc_t) xdr_RENAME3args, reinterpret_cast<caddr_t>(&args), diff --git a/nfs/rpc_mnt2.h b/nfs/rpc_mnt2.h deleted file mode 100644 index ed21256c4754ce861ff1f5ea5ddc4ca224a7da7e..0000000000000000000000000000000000000000 --- a/nfs/rpc_mnt2.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _MNT2_H_RPCGEN -#define _MNT2_H_RPCGEN - -#include <rpc/rpc.h> - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* - * Copyright (c) 1985, 1990 by Sun Microsystems, Inc. - */ - -/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */ -#ifndef _rpcsvc_mount_h -#define _rpcsvc_mount_h -#define MNTPATHLEN 1024 -#define MNTNAMLEN 255 -#define FHSIZE 32 - -typedef char fhandle[FHSIZE]; - -struct fhstatus { - u_int fhs_status; - union { - fhandle fhs_fhandle; - } fhstatus_u; -}; -typedef struct fhstatus fhstatus; - -typedef char *dirpath; - -typedef char *name; - -typedef struct mountbody *mountlist; - -struct mountbody { - name ml_hostname; - dirpath ml_directory; - mountlist ml_next; -}; -typedef struct mountbody mountbody; - -typedef struct groupnode *groups; - -struct groupnode { - name gr_name; - groups gr_next; -}; -typedef struct groupnode groupnode; - -typedef struct exportnode *exports; - -struct exportnode { - dirpath ex_dir; - groups ex_groups; - exports ex_next; -}; -typedef struct exportnode exportnode; - -struct ppathcnf { - int pc_link_max; - short pc_max_canon; - short pc_max_input; - short pc_name_max; - short pc_path_max; - short pc_pipe_buf; - u_char pc_vdisable; - char pc_xxx; - short pc_mask[2]; -}; -typedef struct ppathcnf ppathcnf; -#endif /*!_rpcsvc_mount_h*/ - -#define MOUNTPROG 100005 -#define MOUNTVERS 1 - -#if defined(__STDC__) || defined(__cplusplus) -#define MOUNTPROC_NULL 0 -extern void * mountproc_null_1(void *, CLIENT *); -extern void * mountproc_null_1_svc(void *, struct svc_req *); -#define MOUNTPROC_MNT 1 -extern fhstatus * mountproc_mnt_1(dirpath *, CLIENT *); -extern fhstatus * mountproc_mnt_1_svc(dirpath *, struct svc_req *); -#define MOUNTPROC_DUMP 2 -extern mountlist * mountproc_dump_1(void *, CLIENT *); -extern mountlist * mountproc_dump_1_svc(void *, struct svc_req *); -#define MOUNTPROC_UMNT 3 -extern void * mountproc_umnt_1(dirpath *, CLIENT *); -extern void * mountproc_umnt_1_svc(dirpath *, struct svc_req *); -#define MOUNTPROC_UMNTALL 4 -extern void * mountproc_umntall_1(void *, CLIENT *); -extern void * mountproc_umntall_1_svc(void *, struct svc_req *); -#define MOUNTPROC_EXPORT 5 -extern exports * mountproc_export_1(void *, CLIENT *); -extern exports * mountproc_export_1_svc(void *, struct svc_req *); -#define MOUNTPROC_EXPORTALL 6 -extern exports * mountproc_exportall_1(void *, CLIENT *); -extern exports * mountproc_exportall_1_svc(void *, struct svc_req *); -extern int mountprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define MOUNTPROC_NULL 0 -extern void * mountproc_null_1(); -extern void * mountproc_null_1_svc(); -#define MOUNTPROC_MNT 1 -extern fhstatus * mountproc_mnt_1(); -extern fhstatus * mountproc_mnt_1_svc(); -#define MOUNTPROC_DUMP 2 -extern mountlist * mountproc_dump_1(); -extern mountlist * mountproc_dump_1_svc(); -#define MOUNTPROC_UMNT 3 -extern void * mountproc_umnt_1(); -extern void * mountproc_umnt_1_svc(); -#define MOUNTPROC_UMNTALL 4 -extern void * mountproc_umntall_1(); -extern void * mountproc_umntall_1_svc(); -#define MOUNTPROC_EXPORT 5 -extern exports * mountproc_export_1(); -extern exports * mountproc_export_1_svc(); -#define MOUNTPROC_EXPORTALL 6 -extern exports * mountproc_exportall_1(); -extern exports * mountproc_exportall_1_svc(); -extern int mountprog_1_freeresult (); -#endif /* K&R C */ -#define MOUNTVERS_POSIX 2 - -#if defined(__STDC__) || defined(__cplusplus) -extern void * mountproc_null_2(void *, CLIENT *); -extern void * mountproc_null_2_svc(void *, struct svc_req *); -extern fhstatus * mountproc_mnt_2(dirpath *, CLIENT *); -extern fhstatus * mountproc_mnt_2_svc(dirpath *, struct svc_req *); -extern mountlist * mountproc_dump_2(void *, CLIENT *); -extern mountlist * mountproc_dump_2_svc(void *, struct svc_req *); -extern void * mountproc_umnt_2(dirpath *, CLIENT *); -extern void * mountproc_umnt_2_svc(dirpath *, struct svc_req *); -extern void * mountproc_umntall_2(void *, CLIENT *); -extern void * mountproc_umntall_2_svc(void *, struct svc_req *); -extern exports * mountproc_export_2(void *, CLIENT *); -extern exports * mountproc_export_2_svc(void *, struct svc_req *); -extern exports * mountproc_exportall_2(void *, CLIENT *); -extern exports * mountproc_exportall_2_svc(void *, struct svc_req *); -#define MOUNTPROC_PATHCONF 7 -extern ppathcnf * mountproc_pathconf_2(dirpath *, CLIENT *); -extern ppathcnf * mountproc_pathconf_2_svc(dirpath *, struct svc_req *); -extern int mountprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern void * mountproc_null_2(); -extern void * mountproc_null_2_svc(); -extern fhstatus * mountproc_mnt_2(); -extern fhstatus * mountproc_mnt_2_svc(); -extern mountlist * mountproc_dump_2(); -extern mountlist * mountproc_dump_2_svc(); -extern void * mountproc_umnt_2(); -extern void * mountproc_umnt_2_svc(); -extern void * mountproc_umntall_2(); -extern void * mountproc_umntall_2_svc(); -extern exports * mountproc_export_2(); -extern exports * mountproc_export_2_svc(); -extern exports * mountproc_exportall_2(); -extern exports * mountproc_exportall_2_svc(); -#define MOUNTPROC_PATHCONF 7 -extern ppathcnf * mountproc_pathconf_2(); -extern ppathcnf * mountproc_pathconf_2_svc(); -extern int mountprog_2_freeresult (); -#endif /* K&R C */ - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_fhandle (XDR *, fhandle); -extern bool_t xdr_fhstatus (XDR *, fhstatus*); -extern bool_t xdr_dirpath (XDR *, dirpath*); -extern bool_t xdr_name (XDR *, name*); -extern bool_t xdr_mountlist (XDR *, mountlist*); -extern bool_t xdr_mountbody (XDR *, mountbody*); -extern bool_t xdr_groups (XDR *, groups*); -extern bool_t xdr_groupnode (XDR *, groupnode*); -extern bool_t xdr_exports (XDR *, exports*); -extern bool_t xdr_exportnode (XDR *, exportnode*); -extern bool_t xdr_ppathcnf (XDR *, ppathcnf*); - -#else /* K&R C */ -extern bool_t xdr_fhandle (); -extern bool_t xdr_fhstatus (); -extern bool_t xdr_dirpath (); -extern bool_t xdr_name (); -extern bool_t xdr_mountlist (); -extern bool_t xdr_mountbody (); -extern bool_t xdr_groups (); -extern bool_t xdr_groupnode (); -extern bool_t xdr_exports (); -extern bool_t xdr_exportnode (); -extern bool_t xdr_ppathcnf (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_MNT2_H_RPCGEN */ diff --git a/nfs/rpc_mnt2.x b/nfs/rpc_mnt2.x deleted file mode 100644 index 4aaf97de9ade2655cd48ae460ba24ee322b57183..0000000000000000000000000000000000000000 --- a/nfs/rpc_mnt2.x +++ /dev/null @@ -1,255 +0,0 @@ -%/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. -% * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. -% * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. -% * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 -% */ - -%/* -% * Copyright (c) 1985, 1990 by Sun Microsystems, Inc. -% */ -% -%/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */ - -/* - * Protocol description for the mount program - */ - -#ifdef RPC_HDR -%#ifndef _rpcsvc_mount_h -%#define _rpcsvc_mount_h -#endif - -const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */ -const MNTNAMLEN = 255; /* maximum bytes in a name argument */ -const FHSIZE = 32; /* size in bytes of a file handle */ - -/* - * The fhandle is the file handle that the server passes to the client. - * All file operations are done using the file handles to refer to a file - * or a directory. The file handle can contain whatever information the - * server needs to distinguish an individual file. - */ -typedef opaque fhandle[FHSIZE]; - -/* - * If a status of zero is returned, the call completed successfully, and - * a file handle for the directory follows. A non-zero status indicates - * some sort of error. The status corresponds with UNIX error numbers. - */ -union fhstatus switch (unsigned fhs_status) { -case 0: - fhandle fhs_fhandle; -default: - void; -}; - -/* - * The type dirpath is the pathname of a directory - */ -typedef string dirpath<MNTPATHLEN>; - -/* - * The type name is used for arbitrary names (hostnames, groupnames) - */ -typedef string name<MNTNAMLEN>; - -/* - * A list of who has what mounted - */ -typedef struct mountbody *mountlist; -struct mountbody { - name ml_hostname; - dirpath ml_directory; - mountlist ml_next; -}; - -/* - * A list of netgroups - */ -typedef struct groupnode *groups; -struct groupnode { - name gr_name; - groups gr_next; -}; - -/* - * A list of what is exported and to whom - */ -typedef struct exportnode *exports; -struct exportnode { - dirpath ex_dir; - groups ex_groups; - exports ex_next; -}; - -/* - * POSIX pathconf information - */ -struct ppathcnf { - int pc_link_max; /* max links allowed */ - short pc_max_canon; /* max line len for a tty */ - short pc_max_input; /* input a tty can eat all at once */ - short pc_name_max; /* max file name length (dir entry) */ - short pc_path_max; /* max path name length (/x/y/x/.. ) */ - short pc_pipe_buf; /* size of a pipe (bytes) */ - u_char pc_vdisable; /* safe char to turn off c_cc[i] */ - char pc_xxx; /* alignment padding; cc_t == char */ - short pc_mask[2]; /* validity and boolean bits */ -}; - -program MOUNTPROG { - /* - * Version one of the mount protocol communicates with version two - * of the NFS protocol. The only connecting point is the fhandle - * structure, which is the same for both protocols. - */ - version MOUNTVERS { - /* - * Does no work. It is made available in all RPC services - * to allow server reponse testing and timing - */ - void - MOUNTPROC_NULL(void) = 0; - - /* - * If fhs_status is 0, then fhs_fhandle contains the - * file handle for the directory. This file handle may - * be used in the NFS protocol. This procedure also adds - * a new entry to the mount list for this client mounting - * the directory. - * Unix authentication required. - */ - fhstatus - MOUNTPROC_MNT(dirpath) = 1; - - /* - * Returns the list of remotely mounted filesystems. The - * mountlist contains one entry for each hostname and - * directory pair. - */ - mountlist - MOUNTPROC_DUMP(void) = 2; - - /* - * Removes the mount list entry for the directory - * Unix authentication required. - */ - void - MOUNTPROC_UMNT(dirpath) = 3; - - /* - * Removes all of the mount list entries for this client - * Unix authentication required. - */ - void - MOUNTPROC_UMNTALL(void) = 4; - - /* - * Returns a list of all the exported filesystems, and which - * machines are allowed to import it. - */ - exports - MOUNTPROC_EXPORT(void) = 5; - - /* - * Identical to MOUNTPROC_EXPORT above - */ - exports - MOUNTPROC_EXPORTALL(void) = 6; - } = 1; - - /* - * Version two of the mount protocol communicates with version two - * of the NFS protocol. - * The only difference from version one is the addition of a POSIX - * pathconf call. - */ - version MOUNTVERS_POSIX { - /* - * Does no work. It is made available in all RPC services - * to allow server reponse testing and timing - */ - void - MOUNTPROC_NULL(void) = 0; - - /* - * If fhs_status is 0, then fhs_fhandle contains the - * file handle for the directory. This file handle may - * be used in the NFS protocol. This procedure also adds - * a new entry to the mount list for this client mounting - * the directory. - * Unix authentication required. - */ - fhstatus - MOUNTPROC_MNT(dirpath) = 1; - - /* - * Returns the list of remotely mounted filesystems. The - * mountlist contains one entry for each hostname and - * directory pair. - */ - mountlist - MOUNTPROC_DUMP(void) = 2; - - /* - * Removes the mount list entry for the directory - * Unix authentication required. - */ - void - MOUNTPROC_UMNT(dirpath) = 3; - - /* - * Removes all of the mount list entries for this client - * Unix authentication required. - */ - void - MOUNTPROC_UMNTALL(void) = 4; - - /* - * Returns a list of all the exported filesystems, and which - * machines are allowed to import it. - */ - exports - MOUNTPROC_EXPORT(void) = 5; - - /* - * Identical to MOUNTPROC_EXPORT above - */ - exports - MOUNTPROC_EXPORTALL(void) = 6; - - /* - * POSIX pathconf info (Sun hack) - */ - ppathcnf - MOUNTPROC_PATHCONF(dirpath) = 7; - } = 2; -} = 100005; - -#ifdef RPC_HDR -%#endif /*!_rpcsvc_mount_h*/ -#endif diff --git a/nfs/rpc_mnt2_xdr.c b/nfs/rpc_mnt2_xdr.c deleted file mode 100644 index b380f4f93853ba54112a68ddf851f8f04b251312..0000000000000000000000000000000000000000 --- a/nfs/rpc_mnt2_xdr.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "rpc_mnt2.h" -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* - * Copyright (c) 1985, 1990 by Sun Microsystems, Inc. - */ - -/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */ - -bool_t -xdr_fhandle (XDR *xdrs, fhandle objp) -{ - register int32_t *buf; - - if (!xdr_opaque (xdrs, objp, FHSIZE)) - return FALSE; - return TRUE; -} - -bool_t -xdr_fhstatus (XDR *xdrs, fhstatus *objp) -{ - register int32_t *buf; - - if (!xdr_u_int (xdrs, &objp->fhs_status)) - return FALSE; - switch (objp->fhs_status) { - case 0: - if (!xdr_fhandle (xdrs, objp->fhstatus_u.fhs_fhandle)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_dirpath (XDR *xdrs, dirpath *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, MNTPATHLEN)) - return FALSE; - return TRUE; -} - -bool_t -xdr_name (XDR *xdrs, name *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, MNTNAMLEN)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountlist (XDR *xdrs, mountlist *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct mountbody), (xdrproc_t) xdr_mountbody)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountbody (XDR *xdrs, mountbody *objp) -{ - register int32_t *buf; - - if (!xdr_name (xdrs, &objp->ml_hostname)) - return FALSE; - if (!xdr_dirpath (xdrs, &objp->ml_directory)) - return FALSE; - if (!xdr_mountlist (xdrs, &objp->ml_next)) - return FALSE; - return TRUE; -} - -bool_t -xdr_groups (XDR *xdrs, groups *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct groupnode), (xdrproc_t) xdr_groupnode)) - return FALSE; - return TRUE; -} - -bool_t -xdr_groupnode (XDR *xdrs, groupnode *objp) -{ - register int32_t *buf; - - if (!xdr_name (xdrs, &objp->gr_name)) - return FALSE; - if (!xdr_groups (xdrs, &objp->gr_next)) - return FALSE; - return TRUE; -} - -bool_t -xdr_exports (XDR *xdrs, exports *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct exportnode), (xdrproc_t) xdr_exportnode)) - return FALSE; - return TRUE; -} - -bool_t -xdr_exportnode (XDR *xdrs, exportnode *objp) -{ - register int32_t *buf; - - if (!xdr_dirpath (xdrs, &objp->ex_dir)) - return FALSE; - if (!xdr_groups (xdrs, &objp->ex_groups)) - return FALSE; - if (!xdr_exports (xdrs, &objp->ex_next)) - return FALSE; - return TRUE; -} - -bool_t -xdr_ppathcnf (XDR *xdrs, ppathcnf *objp) -{ - register int32_t *buf; - - int i; - - if (xdrs->x_op == XDR_ENCODE) { - buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_int (xdrs, &objp->pc_link_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_canon)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_input)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_name_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_path_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_pipe_buf)) - return FALSE; - - } else { - IXDR_PUT_LONG(buf, objp->pc_link_max); - IXDR_PUT_SHORT(buf, objp->pc_max_canon); - IXDR_PUT_SHORT(buf, objp->pc_max_input); - IXDR_PUT_SHORT(buf, objp->pc_name_max); - IXDR_PUT_SHORT(buf, objp->pc_path_max); - IXDR_PUT_SHORT(buf, objp->pc_pipe_buf); - } - if (!xdr_u_char (xdrs, &objp->pc_vdisable)) - return FALSE; - if (!xdr_char (xdrs, &objp->pc_xxx)) - return FALSE; - buf = XDR_INLINE (xdrs, ( 2 ) * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, - sizeof (short), (xdrproc_t) xdr_short)) - return FALSE; - } else { - { - register short *genp; - - for (i = 0, genp = objp->pc_mask; - i < 2; ++i) { - IXDR_PUT_SHORT(buf, *genp++); - } - } - } - return TRUE; - } else if (xdrs->x_op == XDR_DECODE) { - buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_int (xdrs, &objp->pc_link_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_canon)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_input)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_name_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_path_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_pipe_buf)) - return FALSE; - - } else { - objp->pc_link_max = IXDR_GET_LONG(buf); - objp->pc_max_canon = IXDR_GET_SHORT(buf); - objp->pc_max_input = IXDR_GET_SHORT(buf); - objp->pc_name_max = IXDR_GET_SHORT(buf); - objp->pc_path_max = IXDR_GET_SHORT(buf); - objp->pc_pipe_buf = IXDR_GET_SHORT(buf); - } - if (!xdr_u_char (xdrs, &objp->pc_vdisable)) - return FALSE; - if (!xdr_char (xdrs, &objp->pc_xxx)) - return FALSE; - buf = XDR_INLINE (xdrs, ( 2 ) * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, - sizeof (short), (xdrproc_t) xdr_short)) - return FALSE; - } else { - { - register short *genp; - - for (i = 0, genp = objp->pc_mask; - i < 2; ++i) { - *genp++ = IXDR_GET_SHORT(buf); - } - } - } - return TRUE; - } - - if (!xdr_int (xdrs, &objp->pc_link_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_canon)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_max_input)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_name_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_path_max)) - return FALSE; - if (!xdr_short (xdrs, &objp->pc_pipe_buf)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->pc_vdisable)) - return FALSE; - if (!xdr_char (xdrs, &objp->pc_xxx)) - return FALSE; - if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, - sizeof (short), (xdrproc_t) xdr_short)) - return FALSE; - return TRUE; -} diff --git a/nfs/rpc_mnt3.h b/nfs/rpc_mnt3.h deleted file mode 100644 index cba4ff656a3d524f39cb7f607b8b4b331b41a0c5..0000000000000000000000000000000000000000 --- a/nfs/rpc_mnt3.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _MNT3_H_RPCGEN -#define _MNT3_H_RPCGEN - -#include <rpc/rpc.h> - - -#ifdef __cplusplus -extern "C" { -#endif - -#define MNTPATHLEN 1024 -#define MNTNAMLEN 255 -#define FHSIZE3 64 - -typedef struct { - u_int fhandle3_len; - char *fhandle3_val; -} fhandle3; - -typedef char *dirpath3; - -typedef char *name3; - -enum mountstat3 { - MNT3_OK = 0, - MNT3ERR_PERM = 1, - MNT3ERR_NOENT = 2, - MNT3ERR_IO = 5, - MNT3ERR_ACCES = 13, - MNT3ERR_NOTDIR = 20, - MNT3ERR_INVAL = 22, - MNT3ERR_NAMETOOLONG = 63, - MNT3ERR_NOTSUPP = 10004, - MNT3ERR_SERVERFAULT = 10006, -}; -typedef enum mountstat3 mountstat3; - -struct mountres3_ok { - fhandle3 fhandle; - struct { - u_int auth_flavors_len; - int *auth_flavors_val; - } auth_flavors; -}; -typedef struct mountres3_ok mountres3_ok; - -struct mountres3 { - mountstat3 fhs_status; - union { - mountres3_ok mountinfo; - } mountres3_u; -}; -typedef struct mountres3 mountres3; - -typedef struct mountbody3 *mountlist3; - -struct mountbody3 { - name3 ml_hostname; - dirpath3 ml_directory; - mountlist3 ml_next; -}; -typedef struct mountbody3 mountbody3; - -typedef struct groupnode3 *groups3; - -struct groupnode3 { - name3 gr_name; - groups3 gr_next; -}; -typedef struct groupnode3 groupnode3; - -typedef struct exportnode3 *exports3; - -struct exportnode3 { - dirpath3 ex_dir; - groups3 ex_groups; - exports3 ex_next; -}; -typedef struct exportnode3 exportnode3; - -#define MOUNT_PROGRAM 100005 -#define MOUNT_V3 3 - -#if defined(__STDC__) || defined(__cplusplus) -#define MOUNTPROC3_NULL 0 -extern void * mountproc3_null_3(void *, CLIENT *); -extern void * mountproc3_null_3_svc(void *, struct svc_req *); -#define MOUNTPROC3_MNT 1 -extern mountres3 * mountproc3_mnt_3(dirpath3 *, CLIENT *); -extern mountres3 * mountproc3_mnt_3_svc(dirpath3 *, struct svc_req *); -#define MOUNTPROC3_DUMP 2 -extern mountlist3 * mountproc3_dump_3(void *, CLIENT *); -extern mountlist3 * mountproc3_dump_3_svc(void *, struct svc_req *); -#define MOUNTPROC3_UMNT 3 -extern void * mountproc3_umnt_3(dirpath3 *, CLIENT *); -extern void * mountproc3_umnt_3_svc(dirpath3 *, struct svc_req *); -#define MOUNTPROC3_UMNTALL 4 -extern void * mountproc3_umntall_3(void *, CLIENT *); -extern void * mountproc3_umntall_3_svc(void *, struct svc_req *); -#define MOUNTPROC3_EXPORT 5 -extern exports3 * mountproc3_export_3(void *, CLIENT *); -extern exports3 * mountproc3_export_3_svc(void *, struct svc_req *); -extern int mount_program_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define MOUNTPROC3_NULL 0 -extern void * mountproc3_null_3(); -extern void * mountproc3_null_3_svc(); -#define MOUNTPROC3_MNT 1 -extern mountres3 * mountproc3_mnt_3(); -extern mountres3 * mountproc3_mnt_3_svc(); -#define MOUNTPROC3_DUMP 2 -extern mountlist3 * mountproc3_dump_3(); -extern mountlist3 * mountproc3_dump_3_svc(); -#define MOUNTPROC3_UMNT 3 -extern void * mountproc3_umnt_3(); -extern void * mountproc3_umnt_3_svc(); -#define MOUNTPROC3_UMNTALL 4 -extern void * mountproc3_umntall_3(); -extern void * mountproc3_umntall_3_svc(); -#define MOUNTPROC3_EXPORT 5 -extern exports3 * mountproc3_export_3(); -extern exports3 * mountproc3_export_3_svc(); -extern int mount_program_3_freeresult (); -#endif /* K&R C */ - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_fhandle3 (XDR *, fhandle3*); -extern bool_t xdr_dirpath3 (XDR *, dirpath3*); -extern bool_t xdr_name3 (XDR *, name3*); -extern bool_t xdr_mountstat3 (XDR *, mountstat3*); -extern bool_t xdr_mountres3_ok (XDR *, mountres3_ok*); -extern bool_t xdr_mountres3 (XDR *, mountres3*); -extern bool_t xdr_mountlist3 (XDR *, mountlist3*); -extern bool_t xdr_mountbody3 (XDR *, mountbody3*); -extern bool_t xdr_groups3 (XDR *, groups3*); -extern bool_t xdr_groupnode3 (XDR *, groupnode3*); -extern bool_t xdr_exports3 (XDR *, exports3*); -extern bool_t xdr_exportnode3 (XDR *, exportnode3*); - -#else /* K&R C */ -extern bool_t xdr_fhandle3 (); -extern bool_t xdr_dirpath3 (); -extern bool_t xdr_name3 (); -extern bool_t xdr_mountstat3 (); -extern bool_t xdr_mountres3_ok (); -extern bool_t xdr_mountres3 (); -extern bool_t xdr_mountlist3 (); -extern bool_t xdr_mountbody3 (); -extern bool_t xdr_groups3 (); -extern bool_t xdr_groupnode3 (); -extern bool_t xdr_exports3 (); -extern bool_t xdr_exportnode3 (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_MNT3_H_RPCGEN */ diff --git a/nfs/rpc_mnt3_xdr.c b/nfs/rpc_mnt3_xdr.c deleted file mode 100644 index 2016e688770e3753affe20923a8515f2427c5447..0000000000000000000000000000000000000000 --- a/nfs/rpc_mnt3_xdr.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "rpc_mnt3.h" - -bool_t -xdr_fhandle3 (XDR *xdrs, fhandle3 *objp) -{ - register int32_t *buf; - - if (!xdr_bytes (xdrs, (char **)&objp->fhandle3_val, (u_int *) &objp->fhandle3_len, FHSIZE3)) - return FALSE; - return TRUE; -} - -bool_t -xdr_dirpath3 (XDR *xdrs, dirpath3 *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, MNTPATHLEN)) - return FALSE; - return TRUE; -} - -bool_t -xdr_name3 (XDR *xdrs, name3 *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, MNTNAMLEN)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountstat3 (XDR *xdrs, mountstat3 *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountres3_ok (XDR *xdrs, mountres3_ok *objp) -{ - register int32_t *buf; - - if (!xdr_fhandle3 (xdrs, &objp->fhandle)) - return FALSE; - if (!xdr_array (xdrs, (char **)&objp->auth_flavors.auth_flavors_val, (u_int *) &objp->auth_flavors.auth_flavors_len, ~0, - sizeof (int), (xdrproc_t) xdr_int)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountres3 (XDR *xdrs, mountres3 *objp) -{ - register int32_t *buf; - - if (!xdr_mountstat3 (xdrs, &objp->fhs_status)) - return FALSE; - switch (objp->fhs_status) { - case MNT3_OK: - if (!xdr_mountres3_ok (xdrs, &objp->mountres3_u.mountinfo)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_mountlist3 (XDR *xdrs, mountlist3 *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct mountbody3), (xdrproc_t) xdr_mountbody3)) - return FALSE; - return TRUE; -} - -bool_t -xdr_mountbody3 (XDR *xdrs, mountbody3 *objp) -{ - register int32_t *buf; - - if (!xdr_name3 (xdrs, &objp->ml_hostname)) - return FALSE; - if (!xdr_dirpath3 (xdrs, &objp->ml_directory)) - return FALSE; - if (!xdr_mountlist3 (xdrs, &objp->ml_next)) - return FALSE; - return TRUE; -} - -bool_t -xdr_groups3 (XDR *xdrs, groups3 *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct groupnode3), (xdrproc_t) xdr_groupnode3)) - return FALSE; - return TRUE; -} - -bool_t -xdr_groupnode3 (XDR *xdrs, groupnode3 *objp) -{ - register int32_t *buf; - - if (!xdr_name3 (xdrs, &objp->gr_name)) - return FALSE; - if (!xdr_groups3 (xdrs, &objp->gr_next)) - return FALSE; - return TRUE; -} - -bool_t -xdr_exports3 (XDR *xdrs, exports3 *objp) -{ - register int32_t *buf; - - if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct exportnode3), (xdrproc_t) xdr_exportnode3)) - return FALSE; - return TRUE; -} - -bool_t -xdr_exportnode3 (XDR *xdrs, exportnode3 *objp) -{ - register int32_t *buf; - - if (!xdr_dirpath3 (xdrs, &objp->ex_dir)) - return FALSE; - if (!xdr_groups3 (xdrs, &objp->ex_groups)) - return FALSE; - if (!xdr_exports3 (xdrs, &objp->ex_next)) - return FALSE; - return TRUE; -} diff --git a/nfs/rpc_nfs2_prot.h b/nfs/rpc_nfs2_prot.h index 62ab3056a51cc0e89536081c9d5741ff136dc804..c87f2ce7538552240fc58d4182267360e1e8f6cd 100644 --- a/nfs/rpc_nfs2_prot.h +++ b/nfs/rpc_nfs2_prot.h @@ -3,8 +3,8 @@ * It was generated using rpcgen. */ -#ifndef _NFS2_PROT_H_RPCGEN -#define _NFS2_PROT_H_RPCGEN +#ifndef _RPC_NFS2_PROT_H_RPCGEN +#define _RPC_NFS2_PROT_H_RPCGEN #include <rpc/rpc.h> @@ -295,6 +295,62 @@ struct statfsres { } statfsres_u; }; typedef struct statfsres statfsres; +#define MNTPATHLEN 1024 +#define MNTNAMLEN 255 +#define FHSIZE 32 + +typedef char fhandle[FHSIZE]; + +struct fhstatus { + u_int fhs_status; + union { + fhandle fhs_fhandle; + } fhstatus_u; +}; +typedef struct fhstatus fhstatus; + +typedef char *dirpath; + +typedef char *name; + +typedef struct mountbody *mountlist; + +struct mountbody { + name ml_hostname; + dirpath ml_directory; + mountlist ml_next; +}; +typedef struct mountbody mountbody; + +typedef struct groupnode *groups; + +struct groupnode { + name gr_name; + groups gr_next; +}; +typedef struct groupnode groupnode; + +typedef struct exportnode *exports; + +struct exportnode { + dirpath ex_dir; + groups ex_groups; + exports ex_next; +}; +typedef struct exportnode exportnode; + +struct ppathcnf { + int pc_link_max; + short pc_max_canon; + short pc_max_input; + short pc_name_max; + short pc_path_max; + short pc_pipe_buf; + u_char pc_vdisable; + char pc_xxx; + short pc_mask[2]; +}; +typedef struct ppathcnf ppathcnf; #endif /*!_rpcsvc_nfs_prot_h*/ #define NFS_PROGRAM 100003 @@ -302,59 +358,59 @@ typedef struct statfsres statfsres; #if defined(__STDC__) || defined(__cplusplus) #define NFSPROC_NULL 0 -extern void * nfsproc_null_2(void *, CLIENT *); -extern void * nfsproc_null_2_svc(void *, struct svc_req *); +extern void * nfsproc_null_2(CLIENT *); +extern void * nfsproc_null_2_svc(struct svc_req *); #define NFSPROC_GETATTR 1 -extern attrstat * nfsproc_getattr_2(nfs_fh *, CLIENT *); -extern attrstat * nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *); +extern attrstat * nfsproc_getattr_2(nfs_fh , CLIENT *); +extern attrstat * nfsproc_getattr_2_svc(nfs_fh , struct svc_req *); #define NFSPROC_SETATTR 2 -extern attrstat * nfsproc_setattr_2(sattrargs *, CLIENT *); -extern attrstat * nfsproc_setattr_2_svc(sattrargs *, struct svc_req *); +extern attrstat * nfsproc_setattr_2(sattrargs , CLIENT *); +extern attrstat * nfsproc_setattr_2_svc(sattrargs , struct svc_req *); #define NFSPROC_ROOT 3 -extern void * nfsproc_root_2(void *, CLIENT *); -extern void * nfsproc_root_2_svc(void *, struct svc_req *); +extern void * nfsproc_root_2(CLIENT *); +extern void * nfsproc_root_2_svc(struct svc_req *); #define NFSPROC_LOOKUP 4 -extern diropres * nfsproc_lookup_2(diropargs *, CLIENT *); -extern diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *); +extern diropres * nfsproc_lookup_2(diropargs , CLIENT *); +extern diropres * nfsproc_lookup_2_svc(diropargs , struct svc_req *); #define NFSPROC_READLINK 5 -extern readlinkres * nfsproc_readlink_2(nfs_fh *, CLIENT *); -extern readlinkres * nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *); +extern readlinkres * nfsproc_readlink_2(nfs_fh , CLIENT *); +extern readlinkres * nfsproc_readlink_2_svc(nfs_fh , struct svc_req *); #define NFSPROC_READ 6 -extern readres * nfsproc_read_2(readargs *, CLIENT *); -extern readres * nfsproc_read_2_svc(readargs *, struct svc_req *); +extern readres * nfsproc_read_2(readargs , CLIENT *); +extern readres * nfsproc_read_2_svc(readargs , struct svc_req *); #define NFSPROC_WRITECACHE 7 -extern void * nfsproc_writecache_2(void *, CLIENT *); -extern void * nfsproc_writecache_2_svc(void *, struct svc_req *); +extern void * nfsproc_writecache_2(CLIENT *); +extern void * nfsproc_writecache_2_svc(struct svc_req *); #define NFSPROC_WRITE 8 -extern attrstat * nfsproc_write_2(writeargs *, CLIENT *); -extern attrstat * nfsproc_write_2_svc(writeargs *, struct svc_req *); +extern attrstat * nfsproc_write_2(writeargs , CLIENT *); +extern attrstat * nfsproc_write_2_svc(writeargs , struct svc_req *); #define NFSPROC_CREATE 9 -extern diropres * nfsproc_create_2(createargs *, CLIENT *); -extern diropres * nfsproc_create_2_svc(createargs *, struct svc_req *); +extern diropres * nfsproc_create_2(createargs , CLIENT *); +extern diropres * nfsproc_create_2_svc(createargs , struct svc_req *); #define NFSPROC_REMOVE 10 -extern nfsstat * nfsproc_remove_2(diropargs *, CLIENT *); -extern nfsstat * nfsproc_remove_2_svc(diropargs *, struct svc_req *); +extern nfsstat * nfsproc_remove_2(diropargs , CLIENT *); +extern nfsstat * nfsproc_remove_2_svc(diropargs , struct svc_req *); #define NFSPROC_RENAME 11 -extern nfsstat * nfsproc_rename_2(renameargs *, CLIENT *); -extern nfsstat * nfsproc_rename_2_svc(renameargs *, struct svc_req *); +extern nfsstat * nfsproc_rename_2(renameargs , CLIENT *); +extern nfsstat * nfsproc_rename_2_svc(renameargs , struct svc_req *); #define NFSPROC_LINK 12 -extern nfsstat * nfsproc_link_2(linkargs *, CLIENT *); -extern nfsstat * nfsproc_link_2_svc(linkargs *, struct svc_req *); +extern nfsstat * nfsproc_link_2(linkargs , CLIENT *); +extern nfsstat * nfsproc_link_2_svc(linkargs , struct svc_req *); #define NFSPROC_SYMLINK 13 -extern nfsstat * nfsproc_symlink_2(symlinkargs *, CLIENT *); -extern nfsstat * nfsproc_symlink_2_svc(symlinkargs *, struct svc_req *); +extern nfsstat * nfsproc_symlink_2(symlinkargs , CLIENT *); +extern nfsstat * nfsproc_symlink_2_svc(symlinkargs , struct svc_req *); #define NFSPROC_MKDIR 14 -extern diropres * nfsproc_mkdir_2(createargs *, CLIENT *); -extern diropres * nfsproc_mkdir_2_svc(createargs *, struct svc_req *); +extern diropres * nfsproc_mkdir_2(createargs , CLIENT *); +extern diropres * nfsproc_mkdir_2_svc(createargs , struct svc_req *); #define NFSPROC_RMDIR 15 -extern nfsstat * nfsproc_rmdir_2(diropargs *, CLIENT *); -extern nfsstat * nfsproc_rmdir_2_svc(diropargs *, struct svc_req *); +extern nfsstat * nfsproc_rmdir_2(diropargs , CLIENT *); +extern nfsstat * nfsproc_rmdir_2_svc(diropargs , struct svc_req *); #define NFSPROC_READDIR 16 -extern readdirres * nfsproc_readdir_2(readdirargs *, CLIENT *); -extern readdirres * nfsproc_readdir_2_svc(readdirargs *, struct svc_req *); +extern readdirres * nfsproc_readdir_2(readdirargs , CLIENT *); +extern readdirres * nfsproc_readdir_2_svc(readdirargs , struct svc_req *); #define NFSPROC_STATFS 17 -extern statfsres * nfsproc_statfs_2(nfs_fh *, CLIENT *); -extern statfsres * nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *); +extern statfsres * nfsproc_statfs_2(nfs_fh , CLIENT *); +extern statfsres * nfsproc_statfs_2_svc(nfs_fh , struct svc_req *); extern int nfs_program_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ @@ -415,6 +471,100 @@ extern statfsres * nfsproc_statfs_2_svc(); extern int nfs_program_2_freeresult (); #endif /* K&R C */ +#define MOUNTPROG 100005 +#define MOUNTVERS 1 + +#if defined(__STDC__) || defined(__cplusplus) +#define MOUNTPROC_NULL 0 +extern void * mountproc_null_1(CLIENT *); +extern void * mountproc_null_1_svc(struct svc_req *); +#define MOUNTPROC_MNT 1 +extern fhstatus * mountproc_mnt_1(dirpath , CLIENT *); +extern fhstatus * mountproc_mnt_1_svc(dirpath , struct svc_req *); +#define MOUNTPROC_DUMP 2 +extern mountlist * mountproc_dump_1(CLIENT *); +extern mountlist * mountproc_dump_1_svc(struct svc_req *); +#define MOUNTPROC_UMNT 3 +extern void * mountproc_umnt_1(dirpath , CLIENT *); +extern void * mountproc_umnt_1_svc(dirpath , struct svc_req *); +#define MOUNTPROC_UMNTALL 4 +extern void * mountproc_umntall_1(CLIENT *); +extern void * mountproc_umntall_1_svc(struct svc_req *); +#define MOUNTPROC_EXPORT 5 +extern exports * mountproc_export_1(CLIENT *); +extern exports * mountproc_export_1_svc(struct svc_req *); +#define MOUNTPROC_EXPORTALL 6 +extern exports * mountproc_exportall_1(CLIENT *); +extern exports * mountproc_exportall_1_svc(struct svc_req *); +extern int mountprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define MOUNTPROC_NULL 0 +extern void * mountproc_null_1(); +extern void * mountproc_null_1_svc(); +#define MOUNTPROC_MNT 1 +extern fhstatus * mountproc_mnt_1(); +extern fhstatus * mountproc_mnt_1_svc(); +#define MOUNTPROC_DUMP 2 +extern mountlist * mountproc_dump_1(); +extern mountlist * mountproc_dump_1_svc(); +#define MOUNTPROC_UMNT 3 +extern void * mountproc_umnt_1(); +extern void * mountproc_umnt_1_svc(); +#define MOUNTPROC_UMNTALL 4 +extern void * mountproc_umntall_1(); +extern void * mountproc_umntall_1_svc(); +#define MOUNTPROC_EXPORT 5 +extern exports * mountproc_export_1(); +extern exports * mountproc_export_1_svc(); +#define MOUNTPROC_EXPORTALL 6 +extern exports * mountproc_exportall_1(); +extern exports * mountproc_exportall_1_svc(); +extern int mountprog_1_freeresult (); +#endif /* K&R C */ +#define MOUNTVERS_POSIX 2 + +#if defined(__STDC__) || defined(__cplusplus) +extern void * mountproc_null_2(CLIENT *); +extern void * mountproc_null_2_svc(struct svc_req *); +extern fhstatus * mountproc_mnt_2(dirpath , CLIENT *); +extern fhstatus * mountproc_mnt_2_svc(dirpath , struct svc_req *); +extern mountlist * mountproc_dump_2(CLIENT *); +extern mountlist * mountproc_dump_2_svc(struct svc_req *); +extern void * mountproc_umnt_2(dirpath , CLIENT *); +extern void * mountproc_umnt_2_svc(dirpath , struct svc_req *); +extern void * mountproc_umntall_2(CLIENT *); +extern void * mountproc_umntall_2_svc(struct svc_req *); +extern exports * mountproc_export_2(CLIENT *); +extern exports * mountproc_export_2_svc(struct svc_req *); +extern exports * mountproc_exportall_2(CLIENT *); +extern exports * mountproc_exportall_2_svc(struct svc_req *); +#define MOUNTPROC_PATHCONF 7 +extern ppathcnf * mountproc_pathconf_2(dirpath , CLIENT *); +extern ppathcnf * mountproc_pathconf_2_svc(dirpath , struct svc_req *); +extern int mountprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +extern void * mountproc_null_2(); +extern void * mountproc_null_2_svc(); +extern fhstatus * mountproc_mnt_2(); +extern fhstatus * mountproc_mnt_2_svc(); +extern mountlist * mountproc_dump_2(); +extern mountlist * mountproc_dump_2_svc(); +extern void * mountproc_umnt_2(); +extern void * mountproc_umnt_2_svc(); +extern void * mountproc_umntall_2(); +extern void * mountproc_umntall_2_svc(); +extern exports * mountproc_export_2(); +extern exports * mountproc_export_2_svc(); +extern exports * mountproc_exportall_2(); +extern exports * mountproc_exportall_2_svc(); +#define MOUNTPROC_PATHCONF 7 +extern ppathcnf * mountproc_pathconf_2(); +extern ppathcnf * mountproc_pathconf_2_svc(); +extern int mountprog_2_freeresult (); +#endif /* K&R C */ + /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) @@ -447,6 +597,17 @@ extern bool_t xdr_dirlist (XDR *, dirlist*); extern bool_t xdr_readdirres (XDR *, readdirres*); extern bool_t xdr_statfsokres (XDR *, statfsokres*); extern bool_t xdr_statfsres (XDR *, statfsres*); +extern bool_t xdr_fhandle (XDR *, fhandle); +extern bool_t xdr_fhstatus (XDR *, fhstatus*); +extern bool_t xdr_dirpath (XDR *, dirpath*); +extern bool_t xdr_name (XDR *, name*); +extern bool_t xdr_mountlist (XDR *, mountlist*); +extern bool_t xdr_mountbody (XDR *, mountbody*); +extern bool_t xdr_groups (XDR *, groups*); +extern bool_t xdr_groupnode (XDR *, groupnode*); +extern bool_t xdr_exports (XDR *, exports*); +extern bool_t xdr_exportnode (XDR *, exportnode*); +extern bool_t xdr_ppathcnf (XDR *, ppathcnf*); #else /* K&R C */ extern bool_t xdr_nfsstat (); @@ -478,6 +639,17 @@ extern bool_t xdr_dirlist (); extern bool_t xdr_readdirres (); extern bool_t xdr_statfsokres (); extern bool_t xdr_statfsres (); +extern bool_t xdr_fhandle (); +extern bool_t xdr_fhstatus (); +extern bool_t xdr_dirpath (); +extern bool_t xdr_name (); +extern bool_t xdr_mountlist (); +extern bool_t xdr_mountbody (); +extern bool_t xdr_groups (); +extern bool_t xdr_groupnode (); +extern bool_t xdr_exports (); +extern bool_t xdr_exportnode (); +extern bool_t xdr_ppathcnf (); #endif /* K&R C */ @@ -485,4 +657,4 @@ extern bool_t xdr_statfsres (); } #endif -#endif /* !_NFS2_PROT_H_RPCGEN */ +#endif /* !_RPC_NFS2_PROT_H_RPCGEN */ diff --git a/nfs/rpc_nfs2_prot.x b/nfs/rpc_nfs2_prot.x index cd21123c7b57040d97245f22038153945abe88ee..030262a35d22942f6263c711ec5e013b10d1416d 100644 --- a/nfs/rpc_nfs2_prot.x +++ b/nfs/rpc_nfs2_prot.x @@ -360,6 +360,215 @@ program NFS_PROGRAM { } = 2; } = 100003; +/* Mount v2 */ + +const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */ +const MNTNAMLEN = 255; /* maximum bytes in a name argument */ +const FHSIZE = 32; /* size in bytes of a file handle */ + +/* + * The fhandle is the file handle that the server passes to the client. + * All file operations are done using the file handles to refer to a file + * or a directory. The file handle can contain whatever information the + * server needs to distinguish an individual file. + */ +typedef opaque fhandle[FHSIZE]; + +/* + * If a status of zero is returned, the call completed successfully, and + * a file handle for the directory follows. A non-zero status indicates + * some sort of error. The status corresponds with UNIX error numbers. + */ +union fhstatus switch (unsigned fhs_status) { +case 0: + fhandle fhs_fhandle; +default: + void; +}; + +/* + * The type dirpath is the pathname of a directory + */ +typedef string dirpath<MNTPATHLEN>; + +/* + * The type name is used for arbitrary names (hostnames, groupnames) + */ +typedef string name<MNTNAMLEN>; + +/* + * A list of who has what mounted + */ +typedef struct mountbody *mountlist; +struct mountbody { + name ml_hostname; + dirpath ml_directory; + mountlist ml_next; +}; + +/* + * A list of netgroups + */ +typedef struct groupnode *groups; +struct groupnode { + name gr_name; + groups gr_next; +}; + +/* + * A list of what is exported and to whom + */ +typedef struct exportnode *exports; +struct exportnode { + dirpath ex_dir; + groups ex_groups; + exports ex_next; +}; + +/* + * POSIX pathconf information + */ +struct ppathcnf { + int pc_link_max; /* max links allowed */ + short pc_max_canon; /* max line len for a tty */ + short pc_max_input; /* input a tty can eat all at once */ + short pc_name_max; /* max file name length (dir entry) */ + short pc_path_max; /* max path name length (/x/y/x/.. ) */ + short pc_pipe_buf; /* size of a pipe (bytes) */ + u_char pc_vdisable; /* safe char to turn off c_cc[i] */ + char pc_xxx; /* alignment padding; cc_t == char */ + short pc_mask[2]; /* validity and boolean bits */ +}; + +program MOUNTPROG { + /* + * Version one of the mount protocol communicates with version two + * of the NFS protocol. The only connecting point is the fhandle + * structure, which is the same for both protocols. + */ + version MOUNTVERS { + /* + * Does no work. It is made available in all RPC services + * to allow server reponse testing and timing + */ + void + MOUNTPROC_NULL(void) = 0; + + /* + * If fhs_status is 0, then fhs_fhandle contains the + * file handle for the directory. This file handle may + * be used in the NFS protocol. This procedure also adds + * a new entry to the mount list for this client mounting + * the directory. + * Unix authentication required. + */ + fhstatus + MOUNTPROC_MNT(dirpath) = 1; + + /* + * Returns the list of remotely mounted filesystems. The + * mountlist contains one entry for each hostname and + * directory pair. + */ + mountlist + MOUNTPROC_DUMP(void) = 2; + + /* + * Removes the mount list entry for the directory + * Unix authentication required. + */ + void + MOUNTPROC_UMNT(dirpath) = 3; + + /* + * Removes all of the mount list entries for this client + * Unix authentication required. + */ + void + MOUNTPROC_UMNTALL(void) = 4; + + /* + * Returns a list of all the exported filesystems, and which + * machines are allowed to import it. + */ + exports + MOUNTPROC_EXPORT(void) = 5; + + /* + * Identical to MOUNTPROC_EXPORT above + */ + exports + MOUNTPROC_EXPORTALL(void) = 6; + } = 1; + + /* + * Version two of the mount protocol communicates with version two + * of the NFS protocol. + * The only difference from version one is the addition of a POSIX + * pathconf call. + */ + version MOUNTVERS_POSIX { + /* + * Does no work. It is made available in all RPC services + * to allow server reponse testing and timing + */ + void + MOUNTPROC_NULL(void) = 0; + + /* + * If fhs_status is 0, then fhs_fhandle contains the + * file handle for the directory. This file handle may + * be used in the NFS protocol. This procedure also adds + * a new entry to the mount list for this client mounting + * the directory. + * Unix authentication required. + */ + fhstatus + MOUNTPROC_MNT(dirpath) = 1; + + /* + * Returns the list of remotely mounted filesystems. The + * mountlist contains one entry for each hostname and + * directory pair. + */ + mountlist + MOUNTPROC_DUMP(void) = 2; + + /* + * Removes the mount list entry for the directory + * Unix authentication required. + */ + void + MOUNTPROC_UMNT(dirpath) = 3; + + /* + * Removes all of the mount list entries for this client + * Unix authentication required. + */ + void + MOUNTPROC_UMNTALL(void) = 4; + + /* + * Returns a list of all the exported filesystems, and which + * machines are allowed to import it. + */ + exports + MOUNTPROC_EXPORT(void) = 5; + + /* + * Identical to MOUNTPROC_EXPORT above + */ + exports + MOUNTPROC_EXPORTALL(void) = 6; + + /* + * POSIX pathconf info (Sun hack) + */ + ppathcnf + MOUNTPROC_PATHCONF(dirpath) = 7; + } = 2; +} = 100005; + #ifdef RPC_HDR %#endif /*!_rpcsvc_nfs_prot_h*/ #endif diff --git a/nfs/rpc_nfs2_prot_xdr.c b/nfs/rpc_nfs2_prot_xdr.c index fb63b8ec2329730ef55c8f068e8abf47e865173b..67bbdf15e7bd04ede2210d1b1d552b5e4e581a76 100644 --- a/nfs/rpc_nfs2_prot_xdr.c +++ b/nfs/rpc_nfs2_prot_xdr.c @@ -697,3 +697,240 @@ xdr_statfsres (XDR *xdrs, statfsres *objp) } return TRUE; } + +bool_t +xdr_fhandle (XDR *xdrs, fhandle objp) +{ + register int32_t *buf; + + if (!xdr_opaque (xdrs, objp, FHSIZE)) + return FALSE; + return TRUE; +} + +bool_t +xdr_fhstatus (XDR *xdrs, fhstatus *objp) +{ + register int32_t *buf; + + if (!xdr_u_int (xdrs, &objp->fhs_status)) + return FALSE; + switch (objp->fhs_status) { + case 0: + if (!xdr_fhandle (xdrs, objp->fhstatus_u.fhs_fhandle)) + return FALSE; + break; + default: + break; + } + return TRUE; +} + +bool_t +xdr_dirpath (XDR *xdrs, dirpath *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, objp, MNTPATHLEN)) + return FALSE; + return TRUE; +} + +bool_t +xdr_name (XDR *xdrs, name *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, objp, MNTNAMLEN)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountlist (XDR *xdrs, mountlist *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct mountbody), (xdrproc_t) xdr_mountbody)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountbody (XDR *xdrs, mountbody *objp) +{ + register int32_t *buf; + + if (!xdr_name (xdrs, &objp->ml_hostname)) + return FALSE; + if (!xdr_dirpath (xdrs, &objp->ml_directory)) + return FALSE; + if (!xdr_mountlist (xdrs, &objp->ml_next)) + return FALSE; + return TRUE; +} + +bool_t +xdr_groups (XDR *xdrs, groups *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct groupnode), (xdrproc_t) xdr_groupnode)) + return FALSE; + return TRUE; +} + +bool_t +xdr_groupnode (XDR *xdrs, groupnode *objp) +{ + register int32_t *buf; + + if (!xdr_name (xdrs, &objp->gr_name)) + return FALSE; + if (!xdr_groups (xdrs, &objp->gr_next)) + return FALSE; + return TRUE; +} + +bool_t +xdr_exports (XDR *xdrs, exports *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct exportnode), (xdrproc_t) xdr_exportnode)) + return FALSE; + return TRUE; +} + +bool_t +xdr_exportnode (XDR *xdrs, exportnode *objp) +{ + register int32_t *buf; + + if (!xdr_dirpath (xdrs, &objp->ex_dir)) + return FALSE; + if (!xdr_groups (xdrs, &objp->ex_groups)) + return FALSE; + if (!xdr_exports (xdrs, &objp->ex_next)) + return FALSE; + return TRUE; +} + +bool_t +xdr_ppathcnf (XDR *xdrs, ppathcnf *objp) +{ + register int32_t *buf; + + int i; + + if (xdrs->x_op == XDR_ENCODE) { + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->pc_link_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_canon)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_input)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_name_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_path_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_pipe_buf)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->pc_link_max); + IXDR_PUT_SHORT(buf, objp->pc_max_canon); + IXDR_PUT_SHORT(buf, objp->pc_max_input); + IXDR_PUT_SHORT(buf, objp->pc_name_max); + IXDR_PUT_SHORT(buf, objp->pc_path_max); + IXDR_PUT_SHORT(buf, objp->pc_pipe_buf); + } + if (!xdr_u_char (xdrs, &objp->pc_vdisable)) + return FALSE; + if (!xdr_char (xdrs, &objp->pc_xxx)) + return FALSE; + buf = XDR_INLINE (xdrs, ( 2 ) * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, + sizeof (short), (xdrproc_t) xdr_short)) + return FALSE; + } else { + { + register short *genp; + + for (i = 0, genp = objp->pc_mask; + i < 2; ++i) { + IXDR_PUT_SHORT(buf, *genp++); + } + } + } + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->pc_link_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_canon)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_input)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_name_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_path_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_pipe_buf)) + return FALSE; + + } else { + objp->pc_link_max = IXDR_GET_LONG(buf); + objp->pc_max_canon = IXDR_GET_SHORT(buf); + objp->pc_max_input = IXDR_GET_SHORT(buf); + objp->pc_name_max = IXDR_GET_SHORT(buf); + objp->pc_path_max = IXDR_GET_SHORT(buf); + objp->pc_pipe_buf = IXDR_GET_SHORT(buf); + } + if (!xdr_u_char (xdrs, &objp->pc_vdisable)) + return FALSE; + if (!xdr_char (xdrs, &objp->pc_xxx)) + return FALSE; + buf = XDR_INLINE (xdrs, ( 2 ) * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, + sizeof (short), (xdrproc_t) xdr_short)) + return FALSE; + } else { + { + register short *genp; + + for (i = 0, genp = objp->pc_mask; + i < 2; ++i) { + *genp++ = IXDR_GET_SHORT(buf); + } + } + } + return TRUE; + } + + if (!xdr_int (xdrs, &objp->pc_link_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_canon)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_max_input)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_name_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_path_max)) + return FALSE; + if (!xdr_short (xdrs, &objp->pc_pipe_buf)) + return FALSE; + if (!xdr_u_char (xdrs, &objp->pc_vdisable)) + return FALSE; + if (!xdr_char (xdrs, &objp->pc_xxx)) + return FALSE; + if (!xdr_vector (xdrs, (char *)objp->pc_mask, 2, + sizeof (short), (xdrproc_t) xdr_short)) + return FALSE; + return TRUE; +} diff --git a/nfs/rpc_nfs3_prot.h b/nfs/rpc_nfs3_prot.h index 76b2f5becef9cbdc9fd3db08c540c065a43a89a6..eb593e5ecd859341a242729ec6516db7b21c96de 100644 --- a/nfs/rpc_nfs3_prot.h +++ b/nfs/rpc_nfs3_prot.h @@ -3,8 +3,8 @@ * It was generated using rpcgen. */ -#ifndef _NFS3_PROT_H_RPCGEN -#define _NFS3_PROT_H_RPCGEN +#ifndef _RPC_NFS3_PROT_H_RPCGEN +#define _RPC_NFS3_PROT_H_RPCGEN #include <rpc/rpc.h> @@ -13,18 +13,29 @@ extern "C" { #endif +#define PROGRAM 100003 +#define VERSION 3 #define NFS3_FHSIZE 64 #define NFS3_COOKIEVERFSIZE 8 #define NFS3_CREATEVERFSIZE 8 #define NFS3_WRITEVERFSIZE 8 +#if defined(HAVE_XDR_U_INT64_T) +#define xdr_uint64_t xdr_u_int64_t +#elif defined(HAVE_XDR_U_HYPER) +#define xdr_uint64_t xdr_u_hyper +#eldif defined(HAVE_XDR_U_LONGLONG_T) +#define xdr_uint64_t xdr_u_longlong_t +#elif !defined(HAVE_XDR_UINT64_T) +#define xdr_uint64_t xdr_u_long +#endif -typedef u_quad_t uint64; +typedef uint64_t uint64; -typedef quad_t int64; +typedef int64_t int64; -typedef u_int uint32; +typedef u_long uint32; -typedef int int32; +typedef long int32; typedef char *filename3; @@ -643,8 +654,8 @@ struct RMDIR3res { typedef struct RMDIR3res RMDIR3res; struct RENAME3args { - diropargs3 fromfile; - diropargs3 tofile; + diropargs3 from; + diropargs3 to; }; typedef struct RENAME3args RENAME3args; @@ -910,77 +921,146 @@ struct COMMIT3res { } COMMIT3res_u; }; typedef struct COMMIT3res COMMIT3res; +#define MNTPATHLEN3 1024 +#define MNTNAMLEN3 255 +#define FHSIZE3 64 + +typedef struct { + u_int fhandle3_len; + char *fhandle3_val; +} fhandle3; + +typedef char *dirpath3; + +typedef char *name3; + +enum mountstat3 { + MNT3_OK = 0, + MNT3ERR_PERM = 1, + MNT3ERR_NOENT = 2, + MNT3ERR_IO = 5, + MNT3ERR_ACCES = 13, + MNT3ERR_NOTDIR = 20, + MNT3ERR_INVAL = 22, + MNT3ERR_NAMETOOLONG = 63, + MNT3ERR_NOTSUPP = 10004, + MNT3ERR_SERVERFAULT = 10006, +}; +typedef enum mountstat3 mountstat3; + +struct mountres3_ok { + fhandle3 fhandle; + struct { + u_int auth_flavors_len; + int *auth_flavors_val; + } auth_flavors; +}; +typedef struct mountres3_ok mountres3_ok; + +struct mountres3 { + mountstat3 fhs_status; + union { + mountres3_ok mountinfo; + } mountres3_u; +}; +typedef struct mountres3 mountres3; + +typedef struct mountbody3 *mountlist3; + +struct mountbody3 { + name3 ml_hostname; + dirpath3 ml_directory; + mountlist3 ml_next; +}; +typedef struct mountbody3 mountbody3; + +typedef struct groupnode3 *groups3; + +struct groupnode3 { + name3 gr_name; + groups3 gr_next; +}; +typedef struct groupnode3 groupnode3; + +typedef struct exportnode3 *exports3; + +struct exportnode3 { + dirpath3 ex_dir; + groups3 ex_groups; + exports3 ex_next; +}; +typedef struct exportnode3 exportnode3; #define NFS_PROGRAM 100003 #define NFS_V3 3 #if defined(__STDC__) || defined(__cplusplus) #define NFSPROC3_NULL 0 -extern void * nfsproc3_null_3(void *, CLIENT *); -extern void * nfsproc3_null_3_svc(void *, struct svc_req *); +extern void * nfsproc3_null_3(CLIENT *); +extern void * nfsproc3_null_3_svc(struct svc_req *); #define NFSPROC3_GETATTR 1 -extern GETATTR3res * nfsproc3_getattr_3(GETATTR3args *, CLIENT *); -extern GETATTR3res * nfsproc3_getattr_3_svc(GETATTR3args *, struct svc_req *); +extern GETATTR3res * nfsproc3_getattr_3(GETATTR3args , CLIENT *); +extern GETATTR3res * nfsproc3_getattr_3_svc(GETATTR3args , struct svc_req *); #define NFSPROC3_SETATTR 2 -extern SETATTR3res * nfsproc3_setattr_3(SETATTR3args *, CLIENT *); -extern SETATTR3res * nfsproc3_setattr_3_svc(SETATTR3args *, struct svc_req *); +extern SETATTR3res * nfsproc3_setattr_3(SETATTR3args , CLIENT *); +extern SETATTR3res * nfsproc3_setattr_3_svc(SETATTR3args , struct svc_req *); #define NFSPROC3_LOOKUP 3 -extern LOOKUP3res * nfsproc3_lookup_3(LOOKUP3args *, CLIENT *); -extern LOOKUP3res * nfsproc3_lookup_3_svc(LOOKUP3args *, struct svc_req *); +extern LOOKUP3res * nfsproc3_lookup_3(LOOKUP3args , CLIENT *); +extern LOOKUP3res * nfsproc3_lookup_3_svc(LOOKUP3args , struct svc_req *); #define NFSPROC3_ACCESS 4 -extern ACCESS3res * nfsproc3_access_3(ACCESS3args *, CLIENT *); -extern ACCESS3res * nfsproc3_access_3_svc(ACCESS3args *, struct svc_req *); +extern ACCESS3res * nfsproc3_access_3(ACCESS3args , CLIENT *); +extern ACCESS3res * nfsproc3_access_3_svc(ACCESS3args , struct svc_req *); #define NFSPROC3_READLINK 5 -extern READLINK3res * nfsproc3_readlink_3(READLINK3args *, CLIENT *); -extern READLINK3res * nfsproc3_readlink_3_svc(READLINK3args *, struct svc_req *); +extern READLINK3res * nfsproc3_readlink_3(READLINK3args , CLIENT *); +extern READLINK3res * nfsproc3_readlink_3_svc(READLINK3args , struct svc_req *); #define NFSPROC3_READ 6 -extern READ3res * nfsproc3_read_3(READ3args *, CLIENT *); -extern READ3res * nfsproc3_read_3_svc(READ3args *, struct svc_req *); +extern READ3res * nfsproc3_read_3(READ3args , CLIENT *); +extern READ3res * nfsproc3_read_3_svc(READ3args , struct svc_req *); #define NFSPROC3_WRITE 7 -extern WRITE3res * nfsproc3_write_3(WRITE3args *, CLIENT *); -extern WRITE3res * nfsproc3_write_3_svc(WRITE3args *, struct svc_req *); +extern WRITE3res * nfsproc3_write_3(WRITE3args , CLIENT *); +extern WRITE3res * nfsproc3_write_3_svc(WRITE3args , struct svc_req *); #define NFSPROC3_CREATE 8 -extern CREATE3res * nfsproc3_create_3(CREATE3args *, CLIENT *); -extern CREATE3res * nfsproc3_create_3_svc(CREATE3args *, struct svc_req *); +extern CREATE3res * nfsproc3_create_3(CREATE3args , CLIENT *); +extern CREATE3res * nfsproc3_create_3_svc(CREATE3args , struct svc_req *); #define NFSPROC3_MKDIR 9 -extern MKDIR3res * nfsproc3_mkdir_3(MKDIR3args *, CLIENT *); -extern MKDIR3res * nfsproc3_mkdir_3_svc(MKDIR3args *, struct svc_req *); +extern MKDIR3res * nfsproc3_mkdir_3(MKDIR3args , CLIENT *); +extern MKDIR3res * nfsproc3_mkdir_3_svc(MKDIR3args , struct svc_req *); #define NFSPROC3_SYMLINK 10 -extern SYMLINK3res * nfsproc3_symlink_3(SYMLINK3args *, CLIENT *); -extern SYMLINK3res * nfsproc3_symlink_3_svc(SYMLINK3args *, struct svc_req *); +extern SYMLINK3res * nfsproc3_symlink_3(SYMLINK3args , CLIENT *); +extern SYMLINK3res * nfsproc3_symlink_3_svc(SYMLINK3args , struct svc_req *); #define NFSPROC3_MKNOD 11 -extern MKNOD3res * nfsproc3_mknod_3(MKNOD3args *, CLIENT *); -extern MKNOD3res * nfsproc3_mknod_3_svc(MKNOD3args *, struct svc_req *); +extern MKNOD3res * nfsproc3_mknod_3(MKNOD3args , CLIENT *); +extern MKNOD3res * nfsproc3_mknod_3_svc(MKNOD3args , struct svc_req *); #define NFSPROC3_REMOVE 12 -extern REMOVE3res * nfsproc3_remove_3(REMOVE3args *, CLIENT *); -extern REMOVE3res * nfsproc3_remove_3_svc(REMOVE3args *, struct svc_req *); +extern REMOVE3res * nfsproc3_remove_3(REMOVE3args , CLIENT *); +extern REMOVE3res * nfsproc3_remove_3_svc(REMOVE3args , struct svc_req *); #define NFSPROC3_RMDIR 13 -extern RMDIR3res * nfsproc3_rmdir_3(RMDIR3args *, CLIENT *); -extern RMDIR3res * nfsproc3_rmdir_3_svc(RMDIR3args *, struct svc_req *); +extern RMDIR3res * nfsproc3_rmdir_3(RMDIR3args , CLIENT *); +extern RMDIR3res * nfsproc3_rmdir_3_svc(RMDIR3args , struct svc_req *); #define NFSPROC3_RENAME 14 -extern RENAME3res * nfsproc3_rename_3(RENAME3args *, CLIENT *); -extern RENAME3res * nfsproc3_rename_3_svc(RENAME3args *, struct svc_req *); +extern RENAME3res * nfsproc3_rename_3(RENAME3args , CLIENT *); +extern RENAME3res * nfsproc3_rename_3_svc(RENAME3args , struct svc_req *); #define NFSPROC3_LINK 15 -extern LINK3res * nfsproc3_link_3(LINK3args *, CLIENT *); -extern LINK3res * nfsproc3_link_3_svc(LINK3args *, struct svc_req *); +extern LINK3res * nfsproc3_link_3(LINK3args , CLIENT *); +extern LINK3res * nfsproc3_link_3_svc(LINK3args , struct svc_req *); #define NFSPROC3_READDIR 16 -extern READDIR3res * nfsproc3_readdir_3(READDIR3args *, CLIENT *); -extern READDIR3res * nfsproc3_readdir_3_svc(READDIR3args *, struct svc_req *); +extern READDIR3res * nfsproc3_readdir_3(READDIR3args , CLIENT *); +extern READDIR3res * nfsproc3_readdir_3_svc(READDIR3args , struct svc_req *); #define NFSPROC3_READDIRPLUS 17 -extern READDIRPLUS3res * nfsproc3_readdirplus_3(READDIRPLUS3args *, CLIENT *); -extern READDIRPLUS3res * nfsproc3_readdirplus_3_svc(READDIRPLUS3args *, struct svc_req *); +extern READDIRPLUS3res * nfsproc3_readdirplus_3(READDIRPLUS3args , CLIENT *); +extern READDIRPLUS3res * nfsproc3_readdirplus_3_svc(READDIRPLUS3args , struct svc_req *); #define NFSPROC3_FSSTAT 18 -extern FSSTAT3res * nfsproc3_fsstat_3(FSSTAT3args *, CLIENT *); -extern FSSTAT3res * nfsproc3_fsstat_3_svc(FSSTAT3args *, struct svc_req *); +extern FSSTAT3res * nfsproc3_fsstat_3(FSSTAT3args , CLIENT *); +extern FSSTAT3res * nfsproc3_fsstat_3_svc(FSSTAT3args , struct svc_req *); #define NFSPROC3_FSINFO 19 -extern FSINFO3res * nfsproc3_fsinfo_3(FSINFO3args *, CLIENT *); -extern FSINFO3res * nfsproc3_fsinfo_3_svc(FSINFO3args *, struct svc_req *); +extern FSINFO3res * nfsproc3_fsinfo_3(FSINFO3args , CLIENT *); +extern FSINFO3res * nfsproc3_fsinfo_3_svc(FSINFO3args , struct svc_req *); #define NFSPROC3_PATHCONF 20 -extern PATHCONF3res * nfsproc3_pathconf_3(PATHCONF3args *, CLIENT *); -extern PATHCONF3res * nfsproc3_pathconf_3_svc(PATHCONF3args *, struct svc_req *); +extern PATHCONF3res * nfsproc3_pathconf_3(PATHCONF3args , CLIENT *); +extern PATHCONF3res * nfsproc3_pathconf_3_svc(PATHCONF3args , struct svc_req *); #define NFSPROC3_COMMIT 21 -extern COMMIT3res * nfsproc3_commit_3(COMMIT3args *, CLIENT *); -extern COMMIT3res * nfsproc3_commit_3_svc(COMMIT3args *, struct svc_req *); +extern COMMIT3res * nfsproc3_commit_3(COMMIT3args , CLIENT *); +extern COMMIT3res * nfsproc3_commit_3_svc(COMMIT3args , struct svc_req *); extern int nfs_program_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ @@ -1053,6 +1133,52 @@ extern COMMIT3res * nfsproc3_commit_3_svc(); extern int nfs_program_3_freeresult (); #endif /* K&R C */ +#define MOUNT_PROGRAM 100005 +#define MOUNT_V3 3 + +#if defined(__STDC__) || defined(__cplusplus) +#define MOUNTPROC3_NULL 0 +extern void * mountproc3_null_3(CLIENT *); +extern void * mountproc3_null_3_svc(struct svc_req *); +#define MOUNTPROC3_MNT 1 +extern mountres3 * mountproc3_mnt_3(dirpath3 , CLIENT *); +extern mountres3 * mountproc3_mnt_3_svc(dirpath3 , struct svc_req *); +#define MOUNTPROC3_DUMP 2 +extern mountlist3 * mountproc3_dump_3(CLIENT *); +extern mountlist3 * mountproc3_dump_3_svc(struct svc_req *); +#define MOUNTPROC3_UMNT 3 +extern void * mountproc3_umnt_3(dirpath3 , CLIENT *); +extern void * mountproc3_umnt_3_svc(dirpath3 , struct svc_req *); +#define MOUNTPROC3_UMNTALL 4 +extern void * mountproc3_umntall_3(CLIENT *); +extern void * mountproc3_umntall_3_svc(struct svc_req *); +#define MOUNTPROC3_EXPORT 5 +extern exports3 * mountproc3_export_3(CLIENT *); +extern exports3 * mountproc3_export_3_svc(struct svc_req *); +extern int mount_program_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define MOUNTPROC3_NULL 0 +extern void * mountproc3_null_3(); +extern void * mountproc3_null_3_svc(); +#define MOUNTPROC3_MNT 1 +extern mountres3 * mountproc3_mnt_3(); +extern mountres3 * mountproc3_mnt_3_svc(); +#define MOUNTPROC3_DUMP 2 +extern mountlist3 * mountproc3_dump_3(); +extern mountlist3 * mountproc3_dump_3_svc(); +#define MOUNTPROC3_UMNT 3 +extern void * mountproc3_umnt_3(); +extern void * mountproc3_umnt_3_svc(); +#define MOUNTPROC3_UMNTALL 4 +extern void * mountproc3_umntall_3(); +extern void * mountproc3_umntall_3_svc(); +#define MOUNTPROC3_EXPORT 5 +extern exports3 * mountproc3_export_3(); +extern exports3 * mountproc3_export_3_svc(); +extern int mount_program_3_freeresult (); +#endif /* K&R C */ + /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) @@ -1187,6 +1313,18 @@ extern bool_t xdr_COMMIT3args (XDR *, COMMIT3args*); extern bool_t xdr_COMMIT3resok (XDR *, COMMIT3resok*); extern bool_t xdr_COMMIT3resfail (XDR *, COMMIT3resfail*); extern bool_t xdr_COMMIT3res (XDR *, COMMIT3res*); +extern bool_t xdr_fhandle3 (XDR *, fhandle3*); +extern bool_t xdr_dirpath3 (XDR *, dirpath3*); +extern bool_t xdr_name3 (XDR *, name3*); +extern bool_t xdr_mountstat3 (XDR *, mountstat3*); +extern bool_t xdr_mountres3_ok (XDR *, mountres3_ok*); +extern bool_t xdr_mountres3 (XDR *, mountres3*); +extern bool_t xdr_mountlist3 (XDR *, mountlist3*); +extern bool_t xdr_mountbody3 (XDR *, mountbody3*); +extern bool_t xdr_groups3 (XDR *, groups3*); +extern bool_t xdr_groupnode3 (XDR *, groupnode3*); +extern bool_t xdr_exports3 (XDR *, exports3*); +extern bool_t xdr_exportnode3 (XDR *, exportnode3*); #else /* K&R C */ extern bool_t xdr_uint64 (); @@ -1320,6 +1458,18 @@ extern bool_t xdr_COMMIT3args (); extern bool_t xdr_COMMIT3resok (); extern bool_t xdr_COMMIT3resfail (); extern bool_t xdr_COMMIT3res (); +extern bool_t xdr_fhandle3 (); +extern bool_t xdr_dirpath3 (); +extern bool_t xdr_name3 (); +extern bool_t xdr_mountstat3 (); +extern bool_t xdr_mountres3_ok (); +extern bool_t xdr_mountres3 (); +extern bool_t xdr_mountlist3 (); +extern bool_t xdr_mountbody3 (); +extern bool_t xdr_groups3 (); +extern bool_t xdr_groupnode3 (); +extern bool_t xdr_exports3 (); +extern bool_t xdr_exportnode3 (); #endif /* K&R C */ @@ -1327,4 +1477,4 @@ extern bool_t xdr_COMMIT3res (); } #endif -#endif /* !_NFS3_PROT_H_RPCGEN */ +#endif /* !_RPC_NFS3_PROT_H_RPCGEN */ diff --git a/nfs/rpc_nfs3_prot.x b/nfs/rpc_nfs3_prot.x index fba417c8cd6edb955e018a89dd38942f1e788c69..d12cdff6a5843d2fce65b97446a5619026d18a32 100644 --- a/nfs/rpc_nfs3_prot.x +++ b/nfs/rpc_nfs3_prot.x @@ -15,10 +15,20 @@ const NFS3_COOKIEVERFSIZE = 8; const NFS3_CREATEVERFSIZE = 8; const NFS3_WRITEVERFSIZE = 8; -typedef u_int64_t uint64; +%#if defined(HAVE_XDR_U_INT64_T) +%#define xdr_uint64_t xdr_u_int64_t +%#elif defined(HAVE_XDR_U_HYPER) +%#define xdr_uint64_t xdr_u_hyper +%#eldif defined(HAVE_XDR_U_LONGLONG_T) +%#define xdr_uint64_t xdr_u_longlong_t +%#elif !defined(HAVE_XDR_UINT64_T) +%#define xdr_uint64_t xdr_u_long +%#endif + +typedef uint64_t uint64; typedef int64_t int64; -typedef u_int32_t uint32; -typedef int32_t int32; +typedef unsigned long uint32; +typedef long int32; typedef string filename3<>; typedef string nfspath3<>; typedef uint64 fileid3; @@ -838,13 +848,13 @@ default: }; -const MNTPATHLEN = 1024; /* Maximum bytes in a path name */ -const MNTNAMLEN = 255; /* Maximum bytes in a name */ -const FHSIZE3 = 64; /* Maximum bytes in a V3 file handle */ +const MNTPATHLEN3 = 1024; /* Maximum bytes in a path name */ +const MNTNAMLEN3 = 255; /* Maximum bytes in a name */ +const FHSIZE3 = 64; /* Maximum bytes in a V3 file handle */ typedef opaque fhandle3<FHSIZE3>; -typedef string dirpath<MNTPATHLEN>; -typedef string name<MNTNAMLEN>; +typedef string dirpath3<MNTPATHLEN3>; +typedef string name3<MNTNAMLEN3>; enum mountstat3 { MNT3_OK = 0, /* no error */ @@ -862,12 +872,12 @@ enum mountstat3 { program MOUNT_PROGRAM { version MOUNT_V3 { - void MOUNTPROC3_NULL(void) = 0; - mountres3 MOUNTPROC3_MNT(dirpath) = 1; - mountlist MOUNTPROC3_DUMP(void) = 2; - void MOUNTPROC3_UMNT(dirpath) = 3; - void MOUNTPROC3_UMNTALL(void) = 4; - exports MOUNTPROC3_EXPORT(void) = 5; + void MOUNTPROC3_NULL(void) = 0; + mountres3 MOUNTPROC3_MNT(dirpath3) = 1; + mountlist3 MOUNTPROC3_DUMP(void) = 2; + void MOUNTPROC3_UMNT(dirpath3) = 3; + void MOUNTPROC3_UMNTALL(void) = 4; + exports3 MOUNTPROC3_EXPORT(void) = 5; } = 3; } = 100005; @@ -883,26 +893,26 @@ default: void; }; -typedef struct mountbody *mountlist; +typedef struct mountbody3 *mountlist3; -struct mountbody { - name ml_hostname; - dirpath ml_directory; - mountlist ml_next; +struct mountbody3 { + name3 ml_hostname; + dirpath3 ml_directory; + mountlist3 ml_next; }; -typedef struct groupnode *groups; +typedef struct groupnode3 *groups3; -struct groupnode { - name gr_name; - groups gr_next; +struct groupnode3 { + name3 gr_name; + groups3 gr_next; }; -typedef struct exportnode *exports; +typedef struct exportnode3 *exports3; -struct exportnode { - dirpath ex_dir; - groups ex_groups; - exports ex_next; +struct exportnode3 { + dirpath3 ex_dir; + groups3 ex_groups; + exports3 ex_next; }; diff --git a/nfs/rpc_nfs3_prot_xdr.c b/nfs/rpc_nfs3_prot_xdr.c index 57f4a8546ae697f41f98efb24c01b6de739d380f..db783467354b3ef4b4541c9c000fa7014bbd3277 100644 --- a/nfs/rpc_nfs3_prot_xdr.c +++ b/nfs/rpc_nfs3_prot_xdr.c @@ -4,13 +4,22 @@ */ #include "rpc_nfs3_prot.h" +#if defined(HAVE_XDR_U_INT64_T) +#define xdr_uint64_t xdr_u_int64_t +#elif defined(HAVE_XDR_U_HYPER) +#define xdr_uint64_t xdr_u_hyper +#eldif defined(HAVE_XDR_U_LONGLONG_T) +#define xdr_uint64_t xdr_u_longlong_t +#elif !defined(HAVE_XDR_UINT64_T) +#define xdr_uint64_t xdr_u_long +#endif bool_t xdr_uint64 (XDR *xdrs, uint64 *objp) { register int32_t *buf; - if (!xdr_u_quad_t (xdrs, objp)) + if (!xdr_uint64_t (xdrs, objp)) return FALSE; return TRUE; } @@ -20,7 +29,7 @@ xdr_int64 (XDR *xdrs, int64 *objp) { register int32_t *buf; - if (!xdr_quad_t (xdrs, objp)) + if (!xdr_int64_t (xdrs, objp)) return FALSE; return TRUE; } @@ -30,7 +39,7 @@ xdr_uint32 (XDR *xdrs, uint32 *objp) { register int32_t *buf; - if (!xdr_u_int (xdrs, objp)) + if (!xdr_u_long (xdrs, objp)) return FALSE; return TRUE; } @@ -40,7 +49,7 @@ xdr_int32 (XDR *xdrs, int32 *objp) { register int32_t *buf; - if (!xdr_int (xdrs, objp)) + if (!xdr_long (xdrs, objp)) return FALSE; return TRUE; } @@ -1315,9 +1324,9 @@ xdr_RENAME3args (XDR *xdrs, RENAME3args *objp) { register int32_t *buf; - if (!xdr_diropargs3 (xdrs, &objp->fromfile)) + if (!xdr_diropargs3 (xdrs, &objp->from)) return FALSE; - if (!xdr_diropargs3 (xdrs, &objp->tofile)) + if (!xdr_diropargs3 (xdrs, &objp->to)) return FALSE; return TRUE; } @@ -1906,3 +1915,144 @@ xdr_COMMIT3res (XDR *xdrs, COMMIT3res *objp) } return TRUE; } + +bool_t +xdr_fhandle3 (XDR *xdrs, fhandle3 *objp) +{ + register int32_t *buf; + + if (!xdr_bytes (xdrs, (char **)&objp->fhandle3_val, (u_int *) &objp->fhandle3_len, FHSIZE3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_dirpath3 (XDR *xdrs, dirpath3 *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, objp, MNTPATHLEN3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_name3 (XDR *xdrs, name3 *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, objp, MNTNAMLEN3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountstat3 (XDR *xdrs, mountstat3 *objp) +{ + register int32_t *buf; + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountres3_ok (XDR *xdrs, mountres3_ok *objp) +{ + register int32_t *buf; + + if (!xdr_fhandle3 (xdrs, &objp->fhandle)) + return FALSE; + if (!xdr_array (xdrs, (char **)&objp->auth_flavors.auth_flavors_val, (u_int *) &objp->auth_flavors.auth_flavors_len, ~0, + sizeof (int), (xdrproc_t) xdr_int)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountres3 (XDR *xdrs, mountres3 *objp) +{ + register int32_t *buf; + + if (!xdr_mountstat3 (xdrs, &objp->fhs_status)) + return FALSE; + switch (objp->fhs_status) { + case MNT3_OK: + if (!xdr_mountres3_ok (xdrs, &objp->mountres3_u.mountinfo)) + return FALSE; + break; + default: + break; + } + return TRUE; +} + +bool_t +xdr_mountlist3 (XDR *xdrs, mountlist3 *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct mountbody3), (xdrproc_t) xdr_mountbody3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_mountbody3 (XDR *xdrs, mountbody3 *objp) +{ + register int32_t *buf; + + if (!xdr_name3 (xdrs, &objp->ml_hostname)) + return FALSE; + if (!xdr_dirpath3 (xdrs, &objp->ml_directory)) + return FALSE; + if (!xdr_mountlist3 (xdrs, &objp->ml_next)) + return FALSE; + return TRUE; +} + +bool_t +xdr_groups3 (XDR *xdrs, groups3 *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct groupnode3), (xdrproc_t) xdr_groupnode3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_groupnode3 (XDR *xdrs, groupnode3 *objp) +{ + register int32_t *buf; + + if (!xdr_name3 (xdrs, &objp->gr_name)) + return FALSE; + if (!xdr_groups3 (xdrs, &objp->gr_next)) + return FALSE; + return TRUE; +} + +bool_t +xdr_exports3 (XDR *xdrs, exports3 *objp) +{ + register int32_t *buf; + + if (!xdr_pointer (xdrs, (char **)objp, sizeof (struct exportnode3), (xdrproc_t) xdr_exportnode3)) + return FALSE; + return TRUE; +} + +bool_t +xdr_exportnode3 (XDR *xdrs, exportnode3 *objp) +{ + register int32_t *buf; + + if (!xdr_dirpath3 (xdrs, &objp->ex_dir)) + return FALSE; + if (!xdr_groups3 (xdrs, &objp->ex_groups)) + return FALSE; + if (!xdr_exports3 (xdrs, &objp->ex_next)) + return FALSE; + return TRUE; +}
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel