PORTMAP: Rename the functions in PMAP to PMAP2 to desribe the version of PMAP we use.
Future patches will add PMAP3 which we will need for IPv6 support.libnfs-4.0.0-vitalif
parent
1c1e09ad51
commit
0f0e352f49
|
@ -212,7 +212,7 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
exit(10);
|
||||
}
|
||||
|
||||
if (rpc_pmap_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, pm_cb, &data) < 0) {
|
||||
if (rpc_pmap2_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, pm_cb, &data) < 0) {
|
||||
printf("Failed to set up callit function\n");
|
||||
exit(10);
|
||||
}
|
||||
|
|
|
@ -340,7 +340,7 @@ void pmap_getport1_cb(struct rpc_context *rpc, int status, void *data, void *pri
|
|||
}
|
||||
|
||||
printf("Send getport request asking for MOUNT port\n");
|
||||
if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, pmap_getport2_cb, client) != 0) {
|
||||
if (rpc_pmap2_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, pmap_getport2_cb, client) != 0) {
|
||||
printf("Failed to send getport request\n");
|
||||
exit(10);
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void pmap_dump_cb(struct rpc_context *rpc, int status, void *data, void *private
|
|||
}
|
||||
|
||||
printf("Send getport request asking for MOUNT port\n");
|
||||
if (rpc_pmap_getport_async(rpc, RQUOTA_PROGRAM, RQUOTA_V1, IPPROTO_TCP, pmap_getport1_cb, client) != 0) {
|
||||
if (rpc_pmap2_getport_async(rpc, RQUOTA_PROGRAM, RQUOTA_V1, IPPROTO_TCP, pmap_getport1_cb, client) != 0) {
|
||||
printf("Failed to send getport request\n");
|
||||
exit(10);
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ void pmap_null_cb(struct rpc_context *rpc, int status, void *data, void *private
|
|||
|
||||
printf("Got reply from server for PORTMAP/NULL procedure.\n");
|
||||
printf("Send PMAP/DUMP command\n");
|
||||
if (rpc_pmap_dump_async(rpc, pmap_dump_cb, client) != 0) {
|
||||
if (rpc_pmap2_dump_async(rpc, pmap_dump_cb, client) != 0) {
|
||||
printf("Failed to send getport request\n");
|
||||
exit(10);
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ void pmap_connect_cb(struct rpc_context *rpc, int status, void *data _U_, void *
|
|||
}
|
||||
|
||||
printf("Send NULL request to check if portmapper is actually running\n");
|
||||
if (rpc_pmap_null_async(rpc, pmap_null_cb, client) != 0) {
|
||||
if (rpc_pmap2_null_async(rpc, pmap_null_cb, client) != 0) {
|
||||
printf("Failed to send null request\n");
|
||||
exit(10);
|
||||
}
|
||||
|
|
|
@ -119,11 +119,11 @@ int rpc_disconnect(struct rpc_context *rpc, char *error);
|
|||
|
||||
|
||||
/*
|
||||
* PORTMAP FUNCTIONS
|
||||
* PORTMAP v2 FUNCTIONS
|
||||
*/
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/NULL
|
||||
* Call PORTMAPPER2/NULL
|
||||
* 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.
|
||||
|
@ -136,11 +136,11 @@ int rpc_disconnect(struct rpc_context *rpc, char *error);
|
|||
* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
|
||||
* data is NULL.
|
||||
*/
|
||||
EXTERN int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
|
||||
EXTERN int rpc_pmap2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
|
||||
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/GETPORT.
|
||||
* Call PORTMAPPER2/GETPORT.
|
||||
* 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.
|
||||
|
@ -153,10 +153,10 @@ EXTERN int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private
|
|||
* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
|
||||
* data is NULL.
|
||||
*/
|
||||
EXTERN int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
|
||||
EXTERN int rpc_pmap2_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/SET
|
||||
* Call PORTMAPPER2/SET
|
||||
* 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.
|
||||
|
@ -169,10 +169,10 @@ EXTERN int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int vers
|
|||
* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
|
||||
* data is NULL.
|
||||
*/
|
||||
EXTERN int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
|
||||
EXTERN int rpc_pmap2_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/UNSET
|
||||
* Call PORTMAPPER2/UNSET
|
||||
* 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.
|
||||
|
@ -185,26 +185,26 @@ EXTERN int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version,
|
|||
* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
|
||||
* data is NULL.
|
||||
*/
|
||||
EXTERN int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
|
||||
EXTERN int rpc_pmap2_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/DUMP.
|
||||
* Call PORTMAPPER2/DUMP.
|
||||
* 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 struct *pmap_mapping_list.
|
||||
* data is struct pmap_dump_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.
|
||||
*/
|
||||
EXTERN int rpc_pmap_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
|
||||
EXTERN int rpc_pmap2_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
|
||||
|
||||
/*
|
||||
* Call PORTMAPPER/CALLIT.
|
||||
* Call PORTMAPPER2/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.
|
||||
|
@ -217,7 +217,7 @@ EXTERN int rpc_pmap_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private
|
|||
* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
|
||||
* data is NULL.
|
||||
*/
|
||||
EXTERN 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);
|
||||
EXTERN int rpc_pmap2_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data);
|
||||
|
||||
/*
|
||||
* MOUNT v3 FUNCTIONS
|
||||
|
|
|
@ -1437,7 +1437,7 @@ static int send_nfsd_probes(struct rpc_context *rpc, INTERFACE_INFO *InterfaceLi
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_pmap_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0)
|
||||
if (rpc_pmap2_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@ -1571,7 +1571,7 @@ static int send_nfsd_probes(struct rpc_context *rpc, struct ifconf *ifc, struct
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_pmap_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) {
|
||||
if (rpc_pmap2_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,12 +96,12 @@ rpc_disconnect
|
|||
rpc_get_error
|
||||
rpc_get_fd
|
||||
rpc_init_context
|
||||
rpc_pmap_null_async
|
||||
rpc_pmap_getport_async
|
||||
rpc_pmap_set_async
|
||||
rpc_pmap_unset_async
|
||||
rpc_pmap_dump_async
|
||||
rpc_pmap_callit_async
|
||||
rpc_pmap2_null_async
|
||||
rpc_pmap2_getport_async
|
||||
rpc_pmap2_set_async
|
||||
rpc_pmap2_unset_async
|
||||
rpc_pmap2_dump_async
|
||||
rpc_pmap2_callit_async
|
||||
rpc_mount_null_async
|
||||
rpc_mount_mnt_async
|
||||
rpc_mount_dump_async
|
||||
|
|
12
lib/libnfs.c
12
lib/libnfs.c
|
@ -469,7 +469,7 @@ static void rpc_connect_program_2_cb(struct rpc_context *rpc, int status, void *
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_getport_async(rpc, data->program, data->version, IPPROTO_TCP, rpc_connect_program_3_cb, private_data) != 0) {
|
||||
if (rpc_pmap2_getport_async(rpc, data->program, data->version, IPPROTO_TCP, rpc_connect_program_3_cb, private_data) != 0) {
|
||||
data->cb(rpc, status, command_data, data->private_data);
|
||||
free_rpc_cb_data(data);
|
||||
return;
|
||||
|
@ -496,7 +496,7 @@ static void rpc_connect_program_1_cb(struct rpc_context *rpc, int status, void *
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_null_async(rpc, rpc_connect_program_2_cb, data) != 0) {
|
||||
if (rpc_pmap2_null_async(rpc, rpc_connect_program_2_cb, data) != 0) {
|
||||
data->cb(rpc, status, command_data, data->private_data);
|
||||
free_rpc_cb_data(data);
|
||||
return;
|
||||
|
@ -812,7 +812,7 @@ static void nfs_mount_2_cb(struct rpc_context *rpc, int status, void *command_da
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, nfs_mount_3_cb, private_data) != 0) {
|
||||
if (rpc_pmap2_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, nfs_mount_3_cb, private_data) != 0) {
|
||||
data->cb(-ENOMEM, nfs, command_data, data->private_data);
|
||||
free_nfs_cb_data(data);
|
||||
return;
|
||||
|
@ -840,7 +840,7 @@ static void nfs_mount_1_cb(struct rpc_context *rpc, int status, void *command_da
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_null_async(rpc, nfs_mount_2_cb, data) != 0) {
|
||||
if (rpc_pmap2_null_async(rpc, nfs_mount_2_cb, data) != 0) {
|
||||
data->cb(-ENOMEM, nfs, command_data, data->private_data);
|
||||
free_nfs_cb_data(data);
|
||||
return;
|
||||
|
@ -4368,7 +4368,7 @@ static void mount_export_2_cb(struct rpc_context *rpc, int status, void *command
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, mount_export_3_cb, private_data) != 0) {
|
||||
if (rpc_pmap2_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, mount_export_3_cb, private_data) != 0) {
|
||||
data->cb(rpc, -ENOMEM, command_data, data->private_data);
|
||||
free_mount_cb_data(data);
|
||||
return;
|
||||
|
@ -4395,7 +4395,7 @@ static void mount_export_1_cb(struct rpc_context *rpc, int status, void *command
|
|||
return;
|
||||
}
|
||||
|
||||
if (rpc_pmap_null_async(rpc, mount_export_2_cb, data) != 0) {
|
||||
if (rpc_pmap2_null_async(rpc, mount_export_2_cb, data) != 0) {
|
||||
data->cb(rpc, -ENOMEM, command_data, data->private_data);
|
||||
free_mount_cb_data(data);
|
||||
return;
|
||||
|
|
|
@ -58,45 +58,45 @@ typedef struct pmap_dump_result pmap_dump_result;
|
|||
#define PMAP_V2 2
|
||||
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#define PMAP_NULL 0
|
||||
extern void * pmap_null_2(void *, CLIENT *);
|
||||
extern void * pmap_null_2_svc(void *, struct svc_req *);
|
||||
#define PMAP_SET 1
|
||||
extern bool_t * pmap_set_2(pmap_mapping *, CLIENT *);
|
||||
extern bool_t * pmap_set_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP_UNSET 2
|
||||
extern bool_t * pmap_unset_2(pmap_mapping *, CLIENT *);
|
||||
extern bool_t * pmap_unset_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP_GETPORT 3
|
||||
extern u_int * pmap_getport_2(pmap_mapping *, CLIENT *);
|
||||
extern u_int * pmap_getport_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP_DUMP 4
|
||||
extern pmap_mapping_list * pmap_dump_2(void *, CLIENT *);
|
||||
extern pmap_mapping_list * pmap_dump_2_svc(void *, struct svc_req *);
|
||||
#define PMAP_CALLIT 5
|
||||
extern pmap_call_result * pmap_callit_2(pmap_call_args *, CLIENT *);
|
||||
extern pmap_call_result * pmap_callit_2_svc(pmap_call_args *, struct svc_req *);
|
||||
#define PMAP2_NULL 0
|
||||
extern void * pmap2_null_2(void *, CLIENT *);
|
||||
extern void * pmap2_null_2_svc(void *, struct svc_req *);
|
||||
#define PMAP2_SET 1
|
||||
extern bool_t * pmap2_set_2(pmap_mapping *, CLIENT *);
|
||||
extern bool_t * pmap2_set_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP2_UNSET 2
|
||||
extern bool_t * pmap2_unset_2(pmap_mapping *, CLIENT *);
|
||||
extern bool_t * pmap2_unset_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP2_GETPORT 3
|
||||
extern u_int * pmap2_getport_2(pmap_mapping *, CLIENT *);
|
||||
extern u_int * pmap2_getport_2_svc(pmap_mapping *, struct svc_req *);
|
||||
#define PMAP2_DUMP 4
|
||||
extern pmap_dump_result * pmap2_dump_2(void *, CLIENT *);
|
||||
extern pmap_dump_result * pmap2_dump_2_svc(void *, struct svc_req *);
|
||||
#define PMAP2_CALLIT 5
|
||||
extern pmap_call_result * pmap2_callit_2(pmap_call_args *, CLIENT *);
|
||||
extern pmap_call_result * pmap2_callit_2_svc(pmap_call_args *, struct svc_req *);
|
||||
extern int pmap_program_2_freeresult (SVCXPRT *, zdrproc_t, caddr_t);
|
||||
|
||||
#else /* K&R C */
|
||||
#define PMAP_NULL 0
|
||||
extern void * pmap_null_2();
|
||||
extern void * pmap_null_2_svc();
|
||||
#define PMAP_SET 1
|
||||
extern bool_t * pmap_set_2();
|
||||
extern bool_t * pmap_set_2_svc();
|
||||
#define PMAP_UNSET 2
|
||||
extern bool_t * pmap_unset_2();
|
||||
extern bool_t * pmap_unset_2_svc();
|
||||
#define PMAP_GETPORT 3
|
||||
extern u_int * pmap_getport_2();
|
||||
extern u_int * pmap_getport_2_svc();
|
||||
#define PMAP_DUMP 4
|
||||
extern pmap_mapping_list * pmap_dump_2();
|
||||
extern pmap_mapping_list * pmap_dump_2_svc();
|
||||
#define PMAP_CALLIT 5
|
||||
extern pmap_call_result * pmap_callit_2();
|
||||
extern pmap_call_result * pmap_callit_2_svc();
|
||||
#define PMAP2_NULL 0
|
||||
extern void * pmap2_null_2();
|
||||
extern void * pmap2_null_2_svc();
|
||||
#define PMAP2_SET 1
|
||||
extern bool_t * pmap2_set_2();
|
||||
extern bool_t * pmap2_set_2_svc();
|
||||
#define PMAP2_UNSET 2
|
||||
extern bool_t * pmap2_unset_2();
|
||||
extern bool_t * pmap2_unset_2_svc();
|
||||
#define PMAP2_GETPORT 3
|
||||
extern u_int * pmap2_getport_2();
|
||||
extern u_int * pmap2_getport_2_svc();
|
||||
#define PMAP2_DUMP 4
|
||||
extern pmap_dump_result * pmap2_dump_2();
|
||||
extern pmap_dump_result * pmap2_dump_2_svc();
|
||||
#define PMAP2_CALLIT 5
|
||||
extern pmap_call_result * pmap2_callit_2();
|
||||
extern pmap_call_result * pmap2_callit_2_svc();
|
||||
extern int pmap_program_2_freeresult ();
|
||||
#endif /* K&R C */
|
||||
|
||||
|
|
|
@ -26,18 +26,18 @@
|
|||
#include "libnfs-raw-portmap.h"
|
||||
|
||||
|
||||
int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
|
||||
int rpc_pmap2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
|
||||
{
|
||||
struct rpc_pdu *pdu;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_NULL, cb, private_data, (zdrproc_t)zdr_void, 0);
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_NULL, cb, private_data, (zdrproc_t)zdr_void, 0);
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/null call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/NULL call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to queue pdu for portmap/null call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to queue pdu for PORTMAP2/NULL call");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
@ -45,14 +45,14 @@ 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, int protocol, rpc_cb cb, void *private_data)
|
||||
int rpc_pmap2_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;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_GETPORT, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_GETPORT, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/getport call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/GETPORT call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -61,13 +61,13 @@ int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, in
|
|||
m.prot = protocol;
|
||||
m.port = 0;
|
||||
if (zdr_pmap_mapping(&pdu->zdr, &m) == 0) {
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for portmap/getport call");
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for PORTMAP2/GETPORT call");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Failed to queue portmap/getport pdu");
|
||||
rpc_set_error(rpc, "Failed to queue PORTMAP2/GETPORT pdu");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
@ -75,14 +75,14 @@ int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, in
|
|||
return 0;
|
||||
}
|
||||
|
||||
int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data)
|
||||
int rpc_pmap2_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data)
|
||||
{
|
||||
struct rpc_pdu *pdu;
|
||||
struct pmap_mapping m;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_SET, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_SET, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/set call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/SET call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -91,13 +91,13 @@ int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int pr
|
|||
m.prot = protocol;
|
||||
m.port = port;
|
||||
if (zdr_pmap_mapping(&pdu->zdr, &m) == 0) {
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for portmap/set call");
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for PORTMAP2/SET call");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Failed to queue portmap/set pdu");
|
||||
rpc_set_error(rpc, "Failed to queue PORTMAP2/SET pdu");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
@ -105,14 +105,14 @@ int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int pr
|
|||
return 0;
|
||||
}
|
||||
|
||||
int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data)
|
||||
int rpc_pmap2_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data)
|
||||
{
|
||||
struct rpc_pdu *pdu;
|
||||
struct pmap_mapping m;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_UNSET, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_UNSET, cb, private_data, (zdrproc_t)zdr_int, sizeof(uint32_t));
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/unset call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/UNSET call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -121,13 +121,13 @@ int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int
|
|||
m.prot = protocol;
|
||||
m.port = port;
|
||||
if (zdr_pmap_mapping(&pdu->zdr, &m) == 0) {
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for portmap/unset call");
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for PORTMAP2/UNSET call");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Failed to queue portmap/unset pdu");
|
||||
rpc_set_error(rpc, "Failed to queue PORTMAP2/UNSET pdu");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
@ -135,18 +135,18 @@ int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int
|
|||
return 0;
|
||||
}
|
||||
|
||||
int rpc_pmap_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
|
||||
int rpc_pmap2_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
|
||||
{
|
||||
struct rpc_pdu *pdu;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_DUMP, cb, private_data, (zdrproc_t)zdr_pmap_dump_result, sizeof(pmap_dump_result));
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_DUMP, cb, private_data, (zdrproc_t)zdr_pmap_dump_result, sizeof(pmap_dump_result));
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/dump call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/DUMP call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Failed to queue portmap/dump pdu");
|
||||
rpc_set_error(rpc, "Failed to queue PORTMAP2/DUMP pdu");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
@ -154,14 +154,14 @@ int rpc_pmap_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
int rpc_pmap2_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data)
|
||||
{
|
||||
struct rpc_pdu *pdu;
|
||||
struct pmap_call_args ca;
|
||||
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_CALLIT, cb, private_data, (zdrproc_t)zdr_pmap_call_result, sizeof(pmap_call_result));
|
||||
pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP2_CALLIT, cb, private_data, (zdrproc_t)zdr_pmap_call_result, sizeof(pmap_call_result));
|
||||
if (pdu == NULL) {
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for portmap/callit call");
|
||||
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for PORTMAP2/CALLIT call");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -172,13 +172,13 @@ int rpc_pmap_callit_async(struct rpc_context *rpc, int program, int version, int
|
|||
ca.args.args_val = data;
|
||||
|
||||
if (zdr_pmap_call_args(&pdu->zdr, &ca) == 0) {
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for portmap/callit call");
|
||||
rpc_set_error(rpc, "ZDR error: Failed to encode data for PORTMAP2/CALLIT call");
|
||||
rpc_free_pdu(rpc, pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_queue_pdu(rpc, pdu) != 0) {
|
||||
rpc_set_error(rpc, "Failed to queue portmap/callit pdu: %s", rpc_get_error(rpc));
|
||||
rpc_set_error(rpc, "Failed to queue PORTMAP2/CALLIT pdu: %s", rpc_get_error(rpc));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,22 +35,22 @@ struct pmap_dump_result {
|
|||
program PMAP_PROGRAM {
|
||||
version PMAP_V2 {
|
||||
void
|
||||
PMAP_NULL(void) = 0;
|
||||
PMAP2_NULL(void) = 0;
|
||||
|
||||
bool
|
||||
PMAP_SET(pmap_mapping) = 1;
|
||||
PMAP2_SET(pmap_mapping) = 1;
|
||||
|
||||
bool
|
||||
PMAP_UNSET(pmap_mapping) = 2;
|
||||
PMAP2_UNSET(pmap_mapping) = 2;
|
||||
|
||||
unsigned int
|
||||
PMAP_GETPORT(pmap_mapping) = 3;
|
||||
PMAP2_GETPORT(pmap_mapping) = 3;
|
||||
|
||||
pmap_mapping_list
|
||||
PMAP_DUMP(void) = 4;
|
||||
pmap_dump_result
|
||||
PMAP2_DUMP(void) = 4;
|
||||
|
||||
pmap_call_result
|
||||
PMAP_CALLIT(pmap_call_args) = 5;
|
||||
PMAP2_CALLIT(pmap_call_args) = 5;
|
||||
} = 2;
|
||||
} = 100000;
|
||||
|
||||
|
|
Loading…
Reference in New Issue