PMAP: allow to ask for tcp/udp port, dont assume users only ever want the tcp port
[deb_libnfs.git] / portmap / portmap.c
index 29f13d00b3d44a70db72b9c33dd7298e7f65ca70..d2ec4b883cba60c7401379a1faa2012c96451829 100644 (file)
 #include "win32_compat.h"
 #endif/*WIN32*/
 
-#if defined(WIN32)
-#include <winsock2.h>
-#endif
-
 #include <stdio.h>
 #include <rpc/rpc.h>
 #include <rpc/xdr.h>
@@ -50,7 +46,7 @@ int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
        return 0;
 }
 
-int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data)
+int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data)
 {
        struct rpc_pdu *pdu;
        struct pmap_mapping m;
@@ -63,7 +59,7 @@ int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rp
 
        m.prog = program;
        m.vers = version;
-       m.prot = IPPROTO_TCP;
+       m.prot = protocol;
        m.port = 0;
        if (xdr_pmap_mapping(&pdu->xdr, &m) == 0) {
                rpc_set_error(rpc, "XDR error: Failed to encode data for portmap/getport call");