X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fnfs%2Flibnfs-raw.h;h=e855b15b9d1e668484779f4507db1314f20ca417;hp=c4589cb5a1b0708da80fd4c64ae25860750190b1;hb=56023cca5f66a40646a1e807c3d10af6e5913623;hpb=f91748e6a99dfd3b6565aed4e98e84b4365eb9c2 diff --git a/ccan/nfs/libnfs-raw.h b/ccan/nfs/libnfs-raw.h index c4589cb5..e855b15b 100644 --- a/ccan/nfs/libnfs-raw.h +++ b/ccan/nfs/libnfs-raw.h @@ -1,4 +1,6 @@ -/* +#ifndef CCAN_NFS_LIBNFS_RAW_H +#define CCAN_NFS_LIBNFS_RAW_H +/* Copyright (C) by Ronnie Sahlberg 2010 This program is free software; you can redistribute it and/or modify @@ -49,7 +51,7 @@ typedef void (*rpc_cb)(struct rpc_context *rpc, int status, void *data, void *pr * Async connection to the tcp port at server:port. * Function returns * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. - * <0 : An error occured when trying to set up the connection. The callback will not be invoked. + * <0 : An error occurred when trying to set up the connection. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : The tcp connection was successfully established. @@ -69,7 +71,7 @@ int rpc_disconnect(struct rpc_context *rpc, char *error); void rpc_set_error(struct rpc_context *rpc, char *error_string, ...); -/* +/* * PORTMAP FUNCTIONS */ @@ -77,12 +79,12 @@ void rpc_set_error(struct rpc_context *rpc, char *error_string, ...); * Call PORTMAPPER/NULL * Function returns * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. - * <0 : An error occured when trying to set up the connection. The callback will not be invoked. + * <0 : An error occurred when trying to set up the connection. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon. * data is NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper. + * RPC_STATUS_ERROR : An error occurred when trying to contact the portmapper. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -94,12 +96,12 @@ int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); * Call PORTMAPPER/GETPORT. * Function returns * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. - * <0 : An error occured when trying to set up the connection. The callback will not be invoked. + * <0 : An error occurred when trying to set up the connection. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon. * data is a (uint32_t *), containing the port returned. - * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper. + * RPC_STATUS_ERROR : An error occurred when trying to contact the portmapper. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -108,7 +110,7 @@ int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rp -/* +/* * MOUNT FUNCTIONS */ char *mountstat3_to_str(int stat); @@ -118,12 +120,12 @@ int mountstat3_to_errno(int error); * Call MOUNT/NULL * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data is NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -134,12 +136,12 @@ int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data) * Call MOUNT/MNT * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data is mountres3 *. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -150,12 +152,12 @@ int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void * * Call MOUNT/DUMP * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data is a mountlist. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -166,12 +168,12 @@ int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data) * Call MOUNT/UMNT * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -182,12 +184,12 @@ int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void * Call MOUNT/UMNTALL * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -198,12 +200,12 @@ int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_da * Call MOUNT/EXPORT * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. * data is an exports. - * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -213,7 +215,7 @@ int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_dat -/* +/* * NFS FUNCTIONS */ struct nfs_fh3; @@ -224,12 +226,12 @@ int nfsstat3_to_errno(int error); * Call NFS/NULL * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -240,12 +242,12 @@ int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); * Call NFS/GETATTR * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is GETATTR3res - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -256,12 +258,12 @@ int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh * Call NFS/LOOKUP * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is LOOKUP3res - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -272,12 +274,12 @@ int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/ACCESS * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is ACCESS3res - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -288,44 +290,44 @@ int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/READ * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is ACCESS3res - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. */ -int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, off_t offset, size_t count, void *private_data); +int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, nfs_off_t offset, size_t count, void *private_data); /* * Call NFS/WRITE * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is WRITE3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. */ -int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, off_t offset, size_t count, int stable_how, void *private_data); +int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, nfs_off_t offset, size_t count, int stable_how, void *private_data); /* * Call NFS/COMMIT * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is COMMIT3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -337,12 +339,12 @@ int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/SETATTR * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is SETATTR3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -356,12 +358,12 @@ int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3arg * Call NFS/MKDIR * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is MKDIR3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -376,12 +378,12 @@ int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/RMDIR * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is RMDIR3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -395,12 +397,12 @@ int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/CREATE * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is CREATE3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -414,12 +416,12 @@ int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/REMOVE * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is REMOVE3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -432,12 +434,12 @@ int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/REMOVE * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is READDIR3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -448,12 +450,12 @@ int rpc_nfs_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh * Call NFS/FSSTAT * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is FSSTAT3res - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -467,12 +469,12 @@ int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, * Call NFS/READLINK * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is READLINK3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -485,12 +487,12 @@ int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *f * Call NFS/SYMLINK * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is SYMLINK3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -502,12 +504,12 @@ int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh * Call NFS/RENAME * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is RENAME3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -520,12 +522,12 @@ int rpc_nfs_rename_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *old * Call NFS/LINK * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is LINK3res * - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. @@ -538,22 +540,23 @@ int rpc_nfs_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, -/* +/* * NFSACL FUNCTIONS */ /* * Call NFSACL/NULL * Function returns * 0 : The call was initiated. The callback will be invoked when the call completes. - * <0 : An error occured when trying to set up the call. The callback will not be invoked. + * <0 : An error occurred when trying to set up the call. The callback will not be invoked. * * When the callback is invoked, status indicates the result: * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. * data is NULL. - * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. + * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. * data is NULL. */ int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); +#endif /* CCAN_NFS_LIBNFS_RAW_H */