rpc.c (84221) | rpc.c (92913) |
---|---|
1/* $NetBSD: rpc.c,v 1.18 1998/01/23 19:27:45 thorpej Exp $ */ 2 3/* 4 * Copyright (c) 1992 Regents of the University of California. 5 * All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#) Header: rpc.c,v 1.12 93/09/28 08:31:56 leres Exp (LBL) 40 */ 41 42#include <sys/cdefs.h> | 1/* $NetBSD: rpc.c,v 1.18 1998/01/23 19:27:45 thorpej Exp $ */ 2 3/* 4 * Copyright (c) 1992 Regents of the University of California. 5 * All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#) Header: rpc.c,v 1.12 93/09/28 08:31:56 leres Exp (LBL) 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/lib/libstand/rpc.c 84221 2001-09-30 22:28:01Z dillon $"); | 43__FBSDID("$FreeBSD: head/lib/libstand/rpc.c 92913 2002-03-21 23:39:28Z obrien $"); |
44 45/* 46 * RPC functions used by NFS and bootparams. 47 * Note that bootparams requires the ability to find out the 48 * address of the server from which its response has come. 49 * This is supported by keeping the IP/UDP headers in the 50 * buffer space provided by the caller. (See rpc_fromaddr) 51 */ --- 56 unchanged lines hidden (view full) --- 108int rpc_port = 0x400; /* predecrement */ 109 110/* 111 * Make a rpc call; return length of answer 112 * Note: Caller must leave room for headers. 113 */ 114ssize_t 115rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen) | 44 45/* 46 * RPC functions used by NFS and bootparams. 47 * Note that bootparams requires the ability to find out the 48 * address of the server from which its response has come. 49 * This is supported by keeping the IP/UDP headers in the 50 * buffer space provided by the caller. (See rpc_fromaddr) 51 */ --- 56 unchanged lines hidden (view full) --- 108int rpc_port = 0x400; /* predecrement */ 109 110/* 111 * Make a rpc call; return length of answer 112 * Note: Caller must leave room for headers. 113 */ 114ssize_t 115rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen) |
116 register struct iodesc *d; 117 register n_long prog, vers, proc; 118 register void *sdata; 119 register size_t slen; 120 register void *rdata; 121 register size_t rlen; | 116 struct iodesc *d; 117 n_long prog, vers, proc; 118 void *sdata; 119 size_t slen; 120 void *rdata; 121 size_t rlen; |
122{ | 122{ |
123 register ssize_t cc; | 123 ssize_t cc; |
124 struct auth_info *auth; 125 struct rpc_call *call; 126 struct rpc_reply *reply; 127 char *send_head, *send_tail; 128 char *recv_head, *recv_tail; 129 n_long x; 130 int port; /* host order */ 131 --- 100 unchanged lines hidden (view full) --- 232 233/* 234 * Returns true if packet is the one we're waiting for. 235 * This just checks the XID, direction, acceptance. 236 * Remaining checks are done by callrpc 237 */ 238static ssize_t 239recvrpc(d, pkt, len, tleft) | 124 struct auth_info *auth; 125 struct rpc_call *call; 126 struct rpc_reply *reply; 127 char *send_head, *send_tail; 128 char *recv_head, *recv_tail; 129 n_long x; 130 int port; /* host order */ 131 --- 100 unchanged lines hidden (view full) --- 232 233/* 234 * Returns true if packet is the one we're waiting for. 235 * This just checks the XID, direction, acceptance. 236 * Remaining checks are done by callrpc 237 */ 238static ssize_t 239recvrpc(d, pkt, len, tleft) |
240 register struct iodesc *d; 241 register void *pkt; 242 register size_t len; | 240 struct iodesc *d; 241 void *pkt; 242 size_t len; |
243 time_t tleft; 244{ | 243 time_t tleft; 244{ |
245 register struct rpc_reply *reply; | 245 struct rpc_reply *reply; |
246 ssize_t n; 247 int x; 248 249 errno = 0; 250#ifdef RPC_DEBUG 251 if (debug) 252 printf("recvrpc: called len=%lu\n", (u_long)len); 253#endif --- 123 unchanged lines hidden (view full) --- 377 378 379/* 380 * Request a port number from the port mapper. 381 * Returns the port in host order. 382 */ 383int 384rpc_getport(d, prog, vers) | 246 ssize_t n; 247 int x; 248 249 errno = 0; 250#ifdef RPC_DEBUG 251 if (debug) 252 printf("recvrpc: called len=%lu\n", (u_long)len); 253#endif --- 123 unchanged lines hidden (view full) --- 377 378 379/* 380 * Request a port number from the port mapper. 381 * Returns the port in host order. 382 */ 383int 384rpc_getport(d, prog, vers) |
385 register struct iodesc *d; | 385 struct iodesc *d; |
386 n_long prog; /* host order */ 387 n_long vers; /* host order */ 388{ 389 struct args { 390 n_long prog; /* call program */ 391 n_long vers; /* call version */ 392 n_long proto; /* call protocol */ 393 n_long port; /* call port (unused) */ --- 50 unchanged lines hidden --- | 386 n_long prog; /* host order */ 387 n_long vers; /* host order */ 388{ 389 struct args { 390 n_long prog; /* call program */ 391 n_long vers; /* call version */ 392 n_long proto; /* call protocol */ 393 n_long port; /* call port (unused) */ --- 50 unchanged lines hidden --- |