#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
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
/*
* 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.