X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-raw.h;h=1650a8a18406621702f04c4bf0cc3bbacfddc033;hb=3847f8f6ae1ff8c10513c3f24cb43942737cc6d0;hp=b141e6156c9250a1b1b1e3310acb96e056b8f58e;hpb=1058201ef0ba4ea34e71f07a3e3582c19ee93a1e;p=deb_libnfs.git diff --git a/include/libnfs-raw.h b/include/libnfs-raw.h index b141e61..1650a8a 100644 --- a/include/libnfs-raw.h +++ b/include/libnfs-raw.h @@ -43,8 +43,6 @@ char *rpc_get_error(struct rpc_context *rpc); #define RPC_STATUS_ERROR 1 #define RPC_STATUS_CANCEL 2 -typedef void (*rpc_cb)(struct rpc_context *rpc, int status, void *data, void *private_data); - /* * Async connection to the tcp port at server:port. * Function returns @@ -66,8 +64,6 @@ int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc */ int rpc_disconnect(struct rpc_context *rpc, char *error); -void rpc_set_error(struct rpc_context *rpc, char *error_string, ...); - /* * PORTMAP FUNCTIONS @@ -107,6 +103,21 @@ int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data); +/* + * Call PORTMAPPER/CALLIT. + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon + * data is a 'pmap_call_result' pointer. + * RPC_STATUS_ERROR : An error occured 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. + */ +int rpc_pmap_callit_async(struct rpc_context *rpc, int program, int version, int procedure, const char *data, int datalen, rpc_cb cb, void *private_data); /* * MOUNT FUNCTIONS @@ -196,13 +207,17 @@ int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_da /* * Call MOUNT/EXPORT + * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the + * returned structures. + * * 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. * * 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. + * data is a pointer to an exports pointer: + * exports export = *(exports *)data; * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. * data is the error string. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. @@ -551,3 +566,146 @@ int rpc_nfs_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, + +/* + * RQUOTA FUNCTIONS + */ +char *rquotastat_to_str(int error); +int rquotastat_to_errno(int error); + +/* + * Call RQUOTA1/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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is NULL. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); + +/* + * Call RQUOTA1/GETQUOTA + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is a RQUOTA1res structure. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data); + +/* + * Call RQUOTA1/GETACTIVEQUOTA + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is a RQUOTA1res structure. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data); + + + + +/* + * Call RQUOTA2/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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is NULL. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); + +/* + * Call RQUOTA2/GETQUOTA + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is a RQUOTA1res structure. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data); + +/* + * Call RQUOTA2/GETACTIVEQUOTA + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is a RQUOTA1res structure. + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data); + + + +/* + * Call NFSACL/NULL + * Call the NULL procedure for the NFSACL + * + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is NULL + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota 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); + +/* + * Call NFSACL/GETACL + * + * 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. + * + * When the callback is invoked, status indicates the result: + * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. + * data is a GETACL3res pointer + * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. + * data is the error string. + * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. + * data is NULL. + */ +int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint32_t mask, void *private_data); +