diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-06-01 13:10:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-06-01 13:10:54 +0000 |
commit | 26a60f90c7a143e29793cddc721b8e5427fa2a6c (patch) | |
tree | 7f0f18f83e947b927358bd86768652cd4362aa84 /sunrpc/clnt_tcp.c | |
parent | 6e607d847cc9ad50610238da03a92c4b01eb577a (diff) | |
download | glibc-26a60f90c7a143e29793cddc721b8e5427fa2a6c.tar.gz glibc-26a60f90c7a143e29793cddc721b8e5427fa2a6c.tar.xz glibc-26a60f90c7a143e29793cddc721b8e5427fa2a6c.zip |
Update.
1998-06-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nis_call.c: Make directory search faster. * nis/nis_callback.c: Insert public key of user in callback data. * nis/nis_clone_obj.c: Make size from type u_long, not u_int. * nis/nis_creategroup.c: Check for NULL pointer, fill in more fields. * nis/nis_findserv.c: Rename __pmap_getport to __pmap_getnisport. * nis/nis_intern.h: Remove duplicated prototype. 1998-06-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * sunrpc/auth_des.c: Move prototypes from here ... * sunrpc/rpc/auth.h: ... to here. * sunrpc/clnt_tcp.c: Add more control flags. * sunrpc/clnt_udp.c: Likewise. * sunrpc/netname.c (host2netname): Remove prefixing dot from domainname. * sunrpc/rpc/clnt.h: Document, which control flags are not implementable. * sunrpc/svcauth_des.c: Use key_decryptsession_pk to avoid deadlock.
Diffstat (limited to 'sunrpc/clnt_tcp.c')
-rw-r--r-- | sunrpc/clnt_tcp.c | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c index 82b34b6259..d4fd7c448c 100644 --- a/sunrpc/clnt_tcp.c +++ b/sunrpc/clnt_tcp.c @@ -365,15 +365,19 @@ clnttcp_abort () } static bool_t -clnttcp_control (cl, request, info) - CLIENT *cl; - int request; - char *info; +clnttcp_control (CLIENT *cl, int request, char *info) { struct ct_data *ct = (struct ct_data *) cl->cl_private; + switch (request) { + case CLSET_FD_CLOSE: + ct->ct_closeit = TRUE; + break; + case CLSET_FD_NCLOSE: + ct->ct_closeit = FALSE; + break; case CLSET_TIMEOUT: ct->ct_wait = *(struct timeval *) info; ct->ct_waitset = TRUE; @@ -384,6 +388,56 @@ clnttcp_control (cl, request, info) case CLGET_SERVER_ADDR: *(struct sockaddr_in *) info = ct->ct_addr; break; + case CLGET_FD: + *(int *)info = ct->ct_sock; + break; + case CLGET_XID: + /* + * use the knowledge that xid is the + * first element in the call structure *. + * This will get the xid of the PREVIOUS call + */ + *(u_long *)info = ntohl (*(u_long *)ct->ct_mcall); + break; + case CLSET_XID: + /* This will set the xid of the NEXT call */ + *(u_long *)ct->ct_mcall = htonl (*(u_long *)info - 1); + /* decrement by 1 as clnttcp_call() increments once */ + case CLGET_VERS: + /* + * This RELIES on the information that, in the call body, + * the version number field is the fifth field from the + * begining of the RPC header. MUST be changed if the + * call_struct is changed + */ + *(u_long *)info = ntohl (*(u_long *)(ct->ct_mcall + + 4 * BYTES_PER_XDR_UNIT)); + break; + case CLSET_VERS: + *(u_long *)(ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT) + = htonl (*(u_long *)info); + break; + case CLGET_PROG: + /* + * This RELIES on the information that, in the call body, + * the program number field is the field from the + * begining of the RPC header. MUST be changed if the + * call_struct is changed + */ + *(u_long *)info = ntohl(*(u_long *)(ct->ct_mcall + + 3 * BYTES_PER_XDR_UNIT)); + break; + case CLSET_PROG: + *(u_long *)(ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT) + = htonl(*(u_long *)info); + break; + /* The following are only possible with TI-RPC */ + case CLGET_RETRY_TIMEOUT: + case CLSET_RETRY_TIMEOUT: + case CLGET_SVC_ADDR: + case CLSET_SVC_ADDR: + case CLSET_PUSH_TIMOD: + case CLSET_POP_TIMOD: default: return FALSE; } |