Merge pull request #30 from theuni/android
[deb_libnfs.git] / include / libnfs-raw.h
index 5c901d18395128da521f65c34aaaf0c22f296659..b2275062f765f972f227b5c373dc4accb3ac4078 100644 (file)
@@ -20,8 +20,6 @@
  * protocol as well as the XDR encoded/decoded structures.
  */
 #include <stdint.h>
-#include <rpc/rpc.h>
-#include <rpc/auth.h>
 
 struct rpc_data {
        int size;
@@ -32,7 +30,7 @@ struct rpc_context;
 struct rpc_context *rpc_init_context(void);
 void rpc_destroy_context(struct rpc_context *rpc);
 
-void rpc_set_auth(struct rpc_context *rpc, AUTH *auth);
+void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
 
 int rpc_get_fd(struct rpc_context *rpc);
 int rpc_which_events(struct rpc_context *rpc);
@@ -160,7 +158,7 @@ int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int
  * 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);
+int rpc_pmap_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data);
 
 /* 
  * MOUNT FUNCTIONS
@@ -839,4 +837,80 @@ char *nlmstat4_to_str(int stat);
  * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  *                     data is NULL.
  */
-int rpc_nlm_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
+int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
+
+/*
+ * Call NLM/TEST
+ * Call the TEST procedure for the NLM protocol
+ *
+ * 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 nlm daemon.
+ *                      data is NLM4_TESTres
+ * RPC_STATUS_ERROR   : An error occured when trying to contact the nlm daemon.
+ *                      data is the error string.
+ * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
+ *                     data is NULL.
+ */
+struct NLM4_TESTargs;
+int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
+
+/*
+ * Call NLM/LOCK
+ * Call the LOCK procedure for the NLM protocol
+ *
+ * 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 nlm daemon.
+ *                      data is NLM4_LOCKres
+ * RPC_STATUS_ERROR   : An error occured when trying to contact the nlm daemon.
+ *                      data is the error string.
+ * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
+ *                     data is NULL.
+ */
+struct NLM4_LOCKargs;
+int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
+
+/*
+ * Call NLM/CANCEL
+ * Call the CANCEL procedure for the NLM protocol
+ *
+ * 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 nlm daemon.
+ *                      data is NLM4_CANCres
+ * RPC_STATUS_ERROR   : An error occured when trying to contact the nlm daemon.
+ *                      data is the error string.
+ * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
+ *                     data is NULL.
+ */
+struct NLM4_CANCargs;
+int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
+
+/*
+ * Call NLM/UNLOCK
+ * Call the UNLOCK procedure for the NLM protocol
+ *
+ * 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 nlm daemon.
+ *                      data is NLM4_UNLOCKres
+ * RPC_STATUS_ERROR   : An error occured when trying to contact the nlm daemon.
+ *                      data is the error string.
+ * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
+ *                     data is NULL.
+ */
+struct NLM4_UNLOCKargs;
+int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);