ZDR: New builtin replacement for RPC/XDR called ZDR
[deb_libnfs.git] / nlm / nlm.c
index b8f5b312f5ef343555e9fa754beed0f9085efdab..46ddbb7e22de9d8fe8269c7ff0893d818f1c9306 100644 (file)
--- a/nlm/nlm.c
+++ b/nlm/nlm.c
@@ -21,8 +21,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include <rpc/rpc.h>
-#include <rpc/xdr.h>
+#include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
 #include "libnfs-private.h"
@@ -32,7 +31,7 @@ int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
 {
        struct rpc_pdu *pdu;
 
-       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_NULL, cb, private_data, (xdrproc_t)xdr_void, 0);
+       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_NULL, cb, private_data, (zdrproc_t)zdr_void, 0);
        if (pdu == NULL) {
                rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nlm/null call");
                return -1;
@@ -51,14 +50,14 @@ int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs
 {
        struct rpc_pdu *pdu;
 
-       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_TEST, cb, private_data, (xdrproc_t)xdr_NLM4_TESTres, sizeof(NLM4_TESTres));
+       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_TEST, cb, private_data, (zdrproc_t)zdr_NLM4_TESTres, sizeof(NLM4_TESTres));
        if (pdu == NULL) {
                rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nlm/test call");
                return -1;
        }
 
-       if (xdr_NLM4_TESTargs(&pdu->xdr, args) == 0) {
-               rpc_set_error(rpc, "XDR error: Failed to encode NLM4_TESTargs");
+       if (zdr_NLM4_TESTargs(&pdu->zdr, args) == 0) {
+               rpc_set_error(rpc, "ZDR error: Failed to encode NLM4_TESTargs");
                rpc_free_pdu(rpc, pdu);
                return -2;
        }
@@ -76,14 +75,14 @@ int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs
 {
        struct rpc_pdu *pdu;
 
-       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_LOCK, cb, private_data, (xdrproc_t)xdr_NLM4_LOCKres, sizeof(NLM4_LOCKres));
+       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_LOCK, cb, private_data, (zdrproc_t)zdr_NLM4_LOCKres, sizeof(NLM4_LOCKres));
        if (pdu == NULL) {
                rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nlm/lock call");
                return -1;
        }
 
-       if (xdr_NLM4_LOCKargs(&pdu->xdr, args) == 0) {
-               rpc_set_error(rpc, "XDR error: Failed to encode NLM4_LOCKargs");
+       if (zdr_NLM4_LOCKargs(&pdu->zdr, args) == 0) {
+               rpc_set_error(rpc, "ZDR error: Failed to encode NLM4_LOCKargs");
                rpc_free_pdu(rpc, pdu);
                return -2;
        }
@@ -101,14 +100,14 @@ int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCar
 {
        struct rpc_pdu *pdu;
 
-       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_CANCEL, cb, private_data, (xdrproc_t)xdr_NLM4_CANCres, sizeof(NLM4_CANCres));
+       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_CANCEL, cb, private_data, (zdrproc_t)zdr_NLM4_CANCres, sizeof(NLM4_CANCres));
        if (pdu == NULL) {
                rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nlm/cancel call");
                return -1;
        }
 
-       if (xdr_NLM4_CANCargs(&pdu->xdr, args) == 0) {
-               rpc_set_error(rpc, "XDR error: Failed to encode NLM4_CANCargs");
+       if (zdr_NLM4_CANCargs(&pdu->zdr, args) == 0) {
+               rpc_set_error(rpc, "ZDR error: Failed to encode NLM4_CANCargs");
                rpc_free_pdu(rpc, pdu);
                return -2;
        }
@@ -126,14 +125,14 @@ int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCK
 {
        struct rpc_pdu *pdu;
 
-       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_UNLOCK, cb, private_data, (xdrproc_t)xdr_NLM4_UNLOCKres, sizeof(NLM4_UNLOCKres));
+       pdu = rpc_allocate_pdu(rpc, NLM_PROGRAM, NLM_V4, NLM4_UNLOCK, cb, private_data, (zdrproc_t)zdr_NLM4_UNLOCKres, sizeof(NLM4_UNLOCKres));
        if (pdu == NULL) {
                rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nlm/unlock call");
                return -1;
        }
 
-       if (xdr_NLM4_UNLOCKargs(&pdu->xdr, args) == 0) {
-               rpc_set_error(rpc, "XDR error: Failed to encode NLM4_UNLOCKargs");
+       if (zdr_NLM4_UNLOCKargs(&pdu->zdr, args) == 0) {
+               rpc_set_error(rpc, "ZDR error: Failed to encode NLM4_UNLOCKargs");
                rpc_free_pdu(rpc, pdu);
                return -2;
        }