*/
EXTERN int rpc_pmap3_uaddr2taddr_async(struct rpc_context *rpc, char *uaddr, rpc_cb cb, void *private_data);
+/*
+ * Call PORTMAPPER3/TADDR2UADDR.
+ * 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 struct pmap3_getaddr_result *.
+ * 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.
+ */
+struct pmap3_netbuf;
+EXTERN int rpc_pmap3_taddr2uaddr_async(struct rpc_context *rpc, struct pmap3_netbuf *netbuf, rpc_cb cb, void *private_data);
+
/*
* MOUNT v3 FUNCTIONS
*/
rpc_pmap3_callit_async
rpc_pmap3_gettime_async
rpc_pmap3_uaddr2taddr_async
+rpc_pmap3_taddr2uaddr_async
rpc_mount_null_async
rpc_mount_mnt_async
rpc_mount_dump_async
#define PMAP3_UADDR2TADDR 7
extern pmap3_netbuf * pmap3_uaddr2taddr_3(char **, CLIENT *);
extern pmap3_netbuf * pmap3_uaddr2taddr_3_svc(char **, struct svc_req *);
+#define PMAP3_TADDR2UADDR 8
+extern struct pmap3_getaddr_result * pmap3_taddr2uaddr_3(pmap3_netbuf *, CLIENT *);
+extern struct pmap3_getaddr_result * pmap3_taddr2uaddr_3_svc(pmap3_netbuf *, struct svc_req *);
extern int pmap_program_3_freeresult (SVCXPRT *, zdrproc_t, caddr_t);
#else /* K&R C */
#define PMAP3_UADDR2TADDR 7
extern pmap3_netbuf * pmap3_uaddr2taddr_3();
extern pmap3_netbuf * pmap3_uaddr2taddr_3_svc();
+#define PMAP3_TADDR2UADDR 8
+extern struct pmap3_getaddr_result * pmap3_taddr2uaddr_3();
+extern struct pmap3_getaddr_result * pmap3_taddr2uaddr_3_svc();
extern int pmap_program_3_freeresult ();
#endif /* K&R C */
return 0;
}
+
+int rpc_pmap3_taddr2uaddr_async(struct rpc_context *rpc, struct pmap3_netbuf *nb, rpc_cb cb, void *private_data)
+{
+ struct rpc_pdu *pdu;
+
+ pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V3, PMAP3_TADDR2UADDR, cb, private_data, (zdrproc_t)zdr_pmap3_getaddr_result, sizeof(pmap3_getaddr_result));
+ if (pdu == NULL) {
+ rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP3/TADDR2UADDR call");
+ return -1;
+ }
+
+ if (zdr_pmap3_netbuf(&pdu->zdr, nb) == 0) {
+ rpc_set_error(rpc, "ZDR error: Failed to encode data for PORTMAP3/TADDR2UADDR call");
+ rpc_free_pdu(rpc, pdu);
+ return -1;
+ }
+
+ if (rpc_queue_pdu(rpc, pdu) != 0) {
+ rpc_set_error(rpc, "Failed to queue PORTMAP3/TADDR2UADDR pdu: %s", rpc_get_error(rpc));
+ return -1;
+ }
+
+ return 0;
+}
pmap3_netbuf
PMAP3_UADDR2TADDR(string) = 7;
+
+ struct pmap3_getaddr_result
+ PMAP3_TADDR2UADDR(pmap3_netbuf) = 8;
} = 3;
} = 100000;