ReactOS 0.4.16-dev-329-g9223134
rpc_soc.c
Go to the documentation of this file.
1
2/*
3 * Copyright (c) 2009, Sun Microsystems, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * - Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * - Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * - Neither the name of Sun Microsystems, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/*
31 * Copyright (c) 1986-1991 by Sun Microsystems Inc.
32 * In addition, portions of such source code were derived from Berkeley
33 * 4.3 BSD under license from the Regents of the University of
34 * California.
35 */
36
37#if defined(PORTMAP) || defined (_WIN32)
38/*
39 * rpc_soc.c
40 *
41 * The backward compatibility routines for the earlier implementation
42 * of RPC, where the only transports supported were tcp/ip and udp/ip.
43 * Based on berkeley socket abstraction, now implemented on the top
44 * of TLI/Streams
45 */
46#include <wintirpc.h>
47//#include <pthread.h>
48#include <reentrant.h>
49#include <sys/types.h>
50//#include <sys/socket.h>
51#include <stdio.h>
52#include <rpc/rpc.h>
53#include <rpc/pmap_clnt.h>
54#include <rpc/pmap_prot.h>
55#include <rpc/nettype.h>
56//#include <syslog.h>
57//#include <netinet/in.h>
58//#include <netdb.h>
59#include <errno.h>
60//#include <syslog.h>
61#include <stdlib.h>
62#include <string.h>
63//#include <unistd.h>
64
65#include "rpc_com.h"
66
67extern mutex_t rpcsoc_lock;
68
69static CLIENT *clnt_com_create(struct sockaddr_in *, rpcprog_t, rpcvers_t,
70 int *, u_int, u_int, char *);
71static SVCXPRT *svc_com_create(SOCKET, u_int, u_int, char *);
72static bool_t rpc_wrap_bcast(char *, struct netbuf *, struct netconfig *);
73
74/* XXX */
75#define IN4_LOCALHOST_STRING "127.0.0.1"
76#define IN6_LOCALHOST_STRING "::1"
77
78/*
79 * A common clnt create routine
80 */
81static CLIENT *
82clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp)
83 struct sockaddr_in *raddr;
85 rpcvers_t vers;
86#ifndef __REACTOS__
87 SOCKET *sockp;
88#else
89 int *sockp;
90#endif
91 u_int sendsz;
92 u_int recvsz;
93 char *tp;
94{
95 CLIENT *cl;
96 int madefd = FALSE;
97 SOCKET fd = *sockp;
98 struct netconfig *nconf;
99 struct netbuf bindaddr;
100
102 if ((nconf = __rpc_getconfip(tp)) == NULL) {
105 return (NULL);
106 }
107 if (fd == RPC_ANYSOCK) {
108 fd = __rpc_nconf2fd(nconf);
109 if (fd == -1)
110 goto syserror;
111 madefd = TRUE;
112 }
113
114 if (raddr->sin_port == 0) {
115 u_int proto;
116 u_short sport;
117
118 mutex_unlock(&rpcsoc_lock); /* pmap_getport is recursive */
119 proto = strcmp(tp, "udp") == 0 ? IPPROTO_UDP : IPPROTO_TCP;
120 sport = pmap_getport(raddr, (u_long)prog, (u_long)vers,
121 proto);
122 if (sport == 0) {
123 goto err;
124 }
125 raddr->sin_port = htons(sport);
126 mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */
127 }
128
129 /* Transform sockaddr_in to netbuf */
130 bindaddr.maxlen = bindaddr.len = sizeof (struct sockaddr_in);
131 bindaddr.buf = raddr;
132
134 cl = clnt_tli_create(fd, nconf, &bindaddr, prog, vers,
135 sendsz, recvsz, NULL, NULL, NULL);
136 if (cl) {
137 if (madefd == TRUE) {
138 /*
139 * The fd should be closed while destroying the handle.
140 */
142 *sockp = fd;
143 }
144 (void) freenetconfigent(nconf);
146 return (cl);
147 }
148 goto err;
149
150syserror:
152 rpc_createerr.cf_error.re_errno = errno;
153
154err: if (madefd == TRUE)
156 (void) freenetconfigent(nconf);
158 return (NULL);
159}
160
161CLIENT *
162clntudp_bufcreate(raddr, prog, vers, wait, sockp, sendsz, recvsz)
163 struct sockaddr_in *raddr;
164 u_long prog;
165 u_long vers;
166 struct timeval wait;
167 int *sockp;
168 u_int sendsz;
169 u_int recvsz;
170{
171 CLIENT *cl;
172
173 cl = clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp,
174 sendsz, recvsz, "udp");
175 if (cl == NULL) {
176 return (NULL);
177 }
179 return (cl);
180}
181
182CLIENT *
183clntudp_create(raddr, program, version, wait, sockp)
184 struct sockaddr_in *raddr;
187 struct timeval wait;
188 int *sockp;
189{
190 return clntudp_bufcreate(raddr, program, version, wait, sockp, UDPMSGSIZE, UDPMSGSIZE);
191}
192
193CLIENT *
194clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
195 struct sockaddr_in *raddr;
196 u_long prog;
197 u_long vers;
198 int *sockp;
199 u_int sendsz;
200 u_int recvsz;
201{
202 return clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp,
203 sendsz, recvsz, "tcp");
204}
205
206/* IPv6 version of clnt*_*create */
207
208#ifdef INET6_NOT_USED
209
210CLIENT *
211clntudp6_bufcreate(raddr, prog, vers, wait, sockp, sendsz, recvsz)
212 struct sockaddr_in6 *raddr;
213 u_long prog;
214 u_long vers;
215 struct timeval wait;
216 int *sockp;
217 u_int sendsz;
218 u_int recvsz;
219{
220 CLIENT *cl;
221
222 cl = clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp,
223 sendsz, recvsz, "udp6");
224 if (cl == NULL) {
225 return (NULL);
226 }
228 return (cl);
229}
230
231CLIENT *
232clntudp6_create(raddr, program, version, wait, sockp)
233 struct sockaddr_in6 *raddr;
236 struct timeval wait;
237 int *sockp;
238{
239 return clntudp6_bufcreate(raddr, program, version, wait, sockp, UDPMSGSIZE, UDPMSGSIZE);
240}
241
242CLIENT *
243clnttcp6_create(raddr, prog, vers, sockp, sendsz, recvsz)
244 struct sockaddr_in6 *raddr;
245 u_long prog;
246 u_long vers;
247 int *sockp;
248 u_int sendsz;
249 u_int recvsz;
250{
251 return clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp,
252 sendsz, recvsz, "tcp6");
253}
254
255#endif
256
257CLIENT *
258clntraw_create(prog, vers)
259 u_long prog;
260 u_long vers;
261{
262 return clnt_raw_create((rpcprog_t)prog, (rpcvers_t)vers);
263}
264
265/*
266 * A common server create routine
267 */
268static SVCXPRT *
269svc_com_create(fd, sendsize, recvsize, netid)
270 SOCKET fd;
271 u_int sendsize;
272 u_int recvsize;
273 char *netid;
274{
275 struct netconfig *nconf;
276 SVCXPRT *svc;
277 int madefd = FALSE;
278 int port;
279 struct sockaddr_in sin;
280
281 if ((nconf = __rpc_getconfip(netid)) == NULL) {
282 //(void) syslog(LOG_ERR, "Could not get %s transport", netid);
283 return (NULL);
284 }
285 if (fd == RPC_ANYSOCK) {
286 fd = __rpc_nconf2fd(nconf);
287 if (fd == -1) {
288 (void) freenetconfigent(nconf);
289 //(void) syslog(LOG_ERR,
290 //"svc%s_create: could not open connection", netid);
291 return (NULL);
292 }
293 madefd = TRUE;
294 }
295
296 memset(&sin, 0, sizeof sin);
297 sin.sin_family = AF_INET;
300 svc = svc_tli_create(fd, nconf, NULL, sendsize, recvsize);
301 (void) freenetconfigent(nconf);
302 if (svc == NULL) {
303 if (madefd)
305 return (NULL);
306 }
307 port = (((struct sockaddr_in *)svc->xp_ltaddr.buf)->sin_port);
308 svc->xp_port = ntohs((u_short)port);
309 return (svc);
310}
311
312SVCXPRT *
313svctcp_create(fd, sendsize, recvsize)
314#ifndef __REACTOS__
315 SOCKET fd;
316#else
317 int fd;
318#endif
319 u_int sendsize;
320 u_int recvsize;
321{
322
323 return svc_com_create(fd, sendsize, recvsize, "tcp");
324}
325
326
327
328SVCXPRT *
329svcudp_bufcreate(fd, sendsz, recvsz)
330#ifndef __REACTOS__
331 SOCKET fd;
332#else
333 int fd;
334#endif
335 u_int sendsz, recvsz;
336{
337
338 return svc_com_create(fd, sendsz, recvsz, "udp");
339}
340
341
342
343SVCXPRT *
344svcfd_create(fd, sendsize, recvsize)
345#ifndef __REACTOS__
346 SOCKET fd;
347#else
348 int fd;
349#endif
350 u_int sendsize;
351 u_int recvsize;
352{
353
354 return svc_fd_create(fd, sendsize, recvsize);
355}
356
357
358SVCXPRT *
360#ifndef __REACTOS__
361 SOCKET fd;
362#else
363 int fd;
364#endif
365{
366
367 return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp");
368}
369
370
371SVCXPRT *
373{
374
375 return svc_raw_create();
376}
377
378
379/* IPV6 version */
380#ifdef INET6_NOT_USED
381SVCXPRT *
382svcudp6_bufcreate(fd, sendsz, recvsz)
383 int fd;
384 u_int sendsz, recvsz;
385{
386 return svc_com_create(fd, sendsz, recvsz, "udp6");
387}
388
389
390SVCXPRT *
391svctcp6_create(fd, sendsize, recvsize)
392 int fd;
393 u_int sendsize;
394 u_int recvsize;
395{
396 return svc_com_create(fd, sendsize, recvsize, "tcp6");
397}
398
399
400SVCXPRT *
402 int fd;
403{
404 return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp6");
405}
406#endif
407
408int
410 struct sockaddr_in *addr;
411{
412
413 memset((void *) addr, 0, sizeof(*addr));
414 addr->sin_family = AF_INET;
415 addr->sin_port = htons(PMAPPORT);
416 addr->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
417 return (0);
418}
419
420/*
421 * For connectionless "udp" transport. Obsoleted by rpc_call().
422 */
423int
424callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
425 const char *host;
426 int prognum, versnum, procnum;
427 xdrproc_t inproc, outproc;
428 void *in, *out;
429{
430
431 return (int)rpc_call(host, (rpcprog_t)prognum, (rpcvers_t)versnum,
432 (rpcproc_t)procnum, inproc, in, outproc, out, "udp");
433}
434
435/*
436 * For connectionless kind of transport. Obsoleted by rpc_reg()
437 */
438int
439registerrpc(prognum, versnum, procnum, progname, inproc, outproc)
440 int prognum, versnum, procnum;
441 char *(*progname)(char [UDPMSGSIZE]);
442 xdrproc_t inproc, outproc;
443{
444
445 return rpc_reg((rpcprog_t)prognum, (rpcvers_t)versnum,
446 (rpcproc_t)procnum, progname, inproc, outproc, "udp");
447}
448
449/*
450 * All the following clnt_broadcast stuff is convulated; it supports
451 * the earlier calling style of the callback function
452 */
454
455/*
456 * Need to translate the netbuf address into sockaddr_in address.
457 * Dont care about netid here.
458 */
459/* ARGSUSED */
460static bool_t
461rpc_wrap_bcast(resultp, addr, nconf)
462 char *resultp; /* results of the call */
463 struct netbuf *addr; /* address of the guy who responded */
464 struct netconfig *nconf; /* Netconf of the transport */
465{
466 resultproc_t clnt_broadcast_result;
467
468 if (strcmp(nconf->nc_netid, "udp"))
469 return (FALSE);
470 clnt_broadcast_result = (resultproc_t)thr_getspecific(clnt_broadcast_key);
471 return (*clnt_broadcast_result)(resultp,
472 (struct sockaddr_in *)addr->buf);
473}
474
475/*
476 * Broadcasts on UDP transport. Obsoleted by rpc_broadcast().
477 */
478enum clnt_stat
479clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
480 u_long prog; /* program number */
481 u_long vers; /* version number */
482 u_long proc; /* procedure number */
483 xdrproc_t xargs; /* xdr routine for args */
484 void *argsp; /* pointer to args */
485 xdrproc_t xresults; /* xdr routine for results */
486 void *resultsp; /* pointer to results */
487 resultproc_t eachresult; /* call with each result obtained */
488{
489 extern mutex_t tsd_lock;
490
491 if (clnt_broadcast_key == -1) {
493 if (clnt_broadcast_key == -1)
496 }
497 thr_setspecific(clnt_broadcast_key, (void *) eachresult);
498 return rpc_broadcast((rpcprog_t)prog, (rpcvers_t)vers,
499 (rpcproc_t)proc, xargs, argsp, xresults, resultsp,
500 (resultproc_t) rpc_wrap_bcast, "udp");
501}
502
503#ifndef _WIN32
504/*
505 * Create the client des authentication object. Obsoleted by
506 * authdes_seccreate().
507 */
508AUTH *
509authdes_create(servername, window, syncaddr, ckey)
510 char *servername; /* network name of server */
511 u_int window; /* time to live */
512 struct sockaddr *syncaddr; /* optional hostaddr to sync with */
513 des_block *ckey; /* optional conversation key to use */
514{
515 AUTH *dummy;
516 AUTH *nauth;
517 char hostname[NI_MAXHOST];
518
519 if (syncaddr) {
520 /*
521 * Change addr to hostname, because that is the way
522 * new interface takes it.
523 */
524 if (getnameinfo(syncaddr, sizeof(syncaddr), hostname,
525 sizeof hostname, NULL, 0, 0) != 0)
526 goto fallback;
527
528 nauth = authdes_seccreate(servername, window, hostname, ckey);
529 return (nauth);
530 }
531fallback:
532 dummy = authdes_seccreate(servername, window, NULL, ckey);
533 return (dummy);
534}
535#endif
536
537/*
538 * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
539 */
540CLIENT *
541clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
542 struct sockaddr_un *raddr;
543 u_long prog;
544 u_long vers;
545#ifndef __REACTOS__
546 SOCKET *sockp;
547#else
548 int *sockp;
549#endif
550 u_int sendsz;
551 u_int recvsz;
552{
553 struct netbuf *svcaddr;
554 struct netconfig *nconf;
555 CLIENT *cl;
556 int len;
557
558 cl = NULL;
559 nconf = NULL;
560 svcaddr = NULL;
561 if (((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
562 ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) {
563 if (svcaddr != NULL)
564 free(svcaddr);
566 rpc_createerr.cf_error.re_errno = errno;
567 return(cl);
568 }
569 if (*sockp == SOCKET_ERROR) {
570 *sockp = socket(AF_UNIX, SOCK_STREAM, 0);
571 len = SUN_LEN(raddr);
572 if ((*sockp == INVALID_SOCKET) || (connect(*sockp,
573 (struct sockaddr *)raddr, len) == SOCKET_ERROR)) {
575 rpc_createerr.cf_error.re_errno = errno;
576 if (*sockp != INVALID_SOCKET)
577 (void)closesocket(*sockp);
578 goto done;
579 }
580 }
581 svcaddr->buf = raddr;
582 svcaddr->len = sizeof(raddr);
583 svcaddr->maxlen = sizeof (struct sockaddr_un);
584 cl = clnt_vc_create(*sockp, svcaddr, prog,
585 vers, sendsz, recvsz, NULL, NULL, NULL);
586done:
587 free(svcaddr->buf);
588 free(svcaddr);
589 return(cl);
590}
591
592/*
593 * Creates, registers, and returns a (rpc) unix based transporter.
594 * Obsoleted by svc_vc_create().
595 */
596SVCXPRT *
597svcunix_create(sock, sendsize, recvsize, path)
598#ifndef __REACTOS__
599 SOCKET sock;
600#else
601 int sock;
602#endif
603 u_int sendsize;
604 u_int recvsize;
605 char *path;
606{
607 struct netconfig *nconf;
608 void *localhandle;
609 struct sockaddr_un sun;
610 struct sockaddr *sa;
611 struct t_bind taddr;
612 SVCXPRT *xprt;
613 int addrlen;
614
615 xprt = (SVCXPRT *)NULL;
616 localhandle = setnetconfig();
617 while ((nconf = getnetconfig(localhandle)) != NULL) {
618 if (nconf->nc_protofmly != NULL &&
619 strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
620 break;
621 }
622 if (nconf == NULL)
623 return(xprt);
624
625 if ((sock = __rpc_nconf2fd(nconf)) == SOCKET_ERROR)
626 goto done;
627
628 memset(&sun, 0, sizeof sun);
629 sun.sun_family = AF_UNIX;
630 strncpy(sun.sun_path, path, sizeof(sun.sun_path));
631 addrlen = sizeof(struct sockaddr_un);
632 sa = (struct sockaddr *)&sun;
633
634 if (bind(sock, sa, addrlen) == SOCKET_ERROR)
635 goto done;
636
637 taddr.addr.len = taddr.addr.maxlen = addrlen;
638 taddr.addr.buf = malloc(addrlen);
639 if (taddr.addr.buf == NULL)
640 goto done;
641 memcpy(taddr.addr.buf, sa, addrlen);
642
643 if (nconf->nc_semantics != NC_TPI_CLTS) {
645 free(taddr.addr.buf);
646 goto done;
647 }
648 }
649
650 xprt = (SVCXPRT *)svc_tli_create(sock, nconf, &taddr, sendsize, recvsize);
651
652done:
653 endnetconfig(localhandle);
654 return(xprt);
655}
656
657/*
658 * Like svunix_create(), except the routine takes any *open* UNIX file
659 * descriptor as its first input. Obsoleted by svc_fd_create();
660 */
661SVCXPRT *
662svcunixfd_create(fd, sendsize, recvsize)
663#ifndef __REACTOS__
664 SOCKET fd;
665#else
666 int fd;
667#endif
668 u_int sendsize;
669 u_int recvsize;
670{
671 return (svc_fd_create(fd, sendsize, recvsize));
672}
673
674#endif /* PORTMAP */
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
__END_DECLS __BEGIN_DECLS AUTH * authdes_create(char *, u_int, struct sockaddr *, des_block *)
AUTH * authdes_seccreate(const char *servername, const u_int win, const char *timehost, const des_block *ckey)
Definition: auth_des.c:123
char * hostname
Definition: ftp.c:88
int bindresvport(SOCKET sd, struct sockaddr_in *sin)
Definition: bindresvport.c:53
static const char * progname
Definition: cjpeg.c:137
CLIENT * clntunix_create(struct sockaddr_un *, u_long, u_long, int *, u_int, u_int)
#define CLSET_RETRY_TIMEOUT
Definition: clnt.h:265
#define CLSET_FD_CLOSE
Definition: clnt.h:251
#define CLNT_CONTROL(cl, rq, in)
Definition: clnt.h:240
__END_DECLS typedef bool_t(* resultproc_t)(caddr_t,...)
Definition: clnt.h:570
enum clnt_stat rpc_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc, xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults, caddr_t resultsp, resultproc_t eachresult, const char *nettype)
Definition: clnt_bcast.c:687
CLIENT * clnt_tli_create(const SOCKET fd_in, const struct netconfig *nconf, struct netbuf *svcaddr, const rpcprog_t prog, const rpcvers_t vers, const uint sendsz, const uint recvsz, int(*callback_xdr)(void *, void *), int(*callback_function)(void *, void *, void **), void *callback_args)
Definition: clnt_generic.c:347
CLIENT * clnt_raw_create(rpcprog_t prog, rpcvers_t vers)
Definition: clnt_raw.c:81
enum clnt_stat rpc_call(char *host, rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum, xdrproc_t inproc, const char *in, xdrproc_t outproc, char *out, const char *nettype) const
Definition: clnt_simple.c:92
__END_DECLS __BEGIN_DECLS CLIENT * clntraw_create(u_long, u_long)
CLIENT * clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, struct timeval, int *, u_int, u_int)
__END_DECLS __BEGIN_DECLS CLIENT * clntudp_create(struct sockaddr_in *, u_long, u_long, struct timeval, int *)
__BEGIN_DECLS CLIENT * clnttcp_create(struct sockaddr_in *, u_long, u_long, SOCKET *, u_int, u_int)
clnt_stat
Definition: clnt_stat.h:21
@ RPC_UNKNOWNPROTO
Definition: clnt_stat.h:49
@ RPC_SYSTEMERROR
Definition: clnt_stat.h:43
CLIENT * clnt_vc_create(int fd, const struct netbuf *raddr, const rpcprog_t prog, const rpcvers_t vers, u_int sendsz, u_int recvsz, int *cb_xdr, int *cb_fn, void *cb_args)
Definition: clnt_vc.c:324
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
int callrpc(const char *, int, int, int, xdrproc_t, void *, xdrproc_t, void *)
__BEGIN_DECLS int get_myaddress(struct sockaddr_in *)
int registerrpc(int, int, int, char *(*)(char[UDPMSGSIZE]), xdrproc_t, xdrproc_t)
SVCXPRT * svcunix_create(int, u_int, u_int, char *)
#define RPC_ANYSOCK
Definition: svc.h:327
SVCXPRT * svcunixfd_create(int, u_int, u_int)
UINT32 u_int
Definition: types.h:82
#define NULL
Definition: types.h:112
u_int32_t rpcprog_t
Definition: types.h:104
int32_t bool_t
Definition: types.h:101
#define TRUE
Definition: types.h:120
unsigned short u_short
Definition: types.h:81
#define FALSE
Definition: types.h:117
u_int32_t rpcvers_t
Definition: types.h:105
u_int32_t rpcproc_t
Definition: types.h:106
static const WCHAR version[]
Definition: asmname.c:66
USHORT port
Definition: uri.c:228
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
#define IPPROTO_TCP
Definition: ip.h:196
#define IPPROTO_UDP
Definition: ip.h:197
unsigned long u_long
Definition: linux.h:269
#define SOCK_STREAM
Definition: tcpip.h:118
#define AF_INET
Definition: tcpip.h:117
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
int endnetconfig(void *handlep)
Definition: getnetconfig.c:373
struct netconfig * getnetconfig(void *handlep)
Definition: getnetconfig.c:253
void * setnetconfig()
Definition: getnetconfig.c:217
GLuint program
Definition: glext.h:6723
GLuint in
Definition: glext.h:9616
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
char * prog
Definition: isohybrid.c:47
#define INADDR_LOOPBACK
Definition: inet.h:78
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define htons(x)
Definition: module.h:215
#define ntohs(x)
Definition: module.h:210
#define htonl(x)
Definition: module.h:214
static IHTMLWindow2 * window
Definition: events.c:77
mutex_t rpcsoc_lock
Definition: mt_misc.c:80
mutex_t tsd_lock
Definition: mt_misc.c:86
thread_key_t clnt_broadcast_key
Definition: mt_misc.c:89
#define closesocket
Definition: ncftp.h:477
#define NC_LOOPBACK
Definition: netconfig.h:51
#define NC_TPI_CLTS
Definition: netconfig.h:35
static HANDLE proc()
Definition: pdb.c:34
enum clnt_stat clnt_broadcast(u_long, u_long, u_long, xdrproc_t, void *, xdrproc_t, void *, resultproc_t)
u_short pmap_getport(struct sockaddr_in *address, u_long program, u_long version, u_int protocol)
Definition: pmap_getport.c:74
#define PMAPPORT
Definition: pmap_prot.h:76
#define err(...)
#define thr_setspecific(k, p)
Definition: reentrant.h:146
#define mutex_lock(m)
Definition: reentrant.h:128
#define thr_getspecific(k)
Definition: reentrant.h:147
#define mutex_unlock(m)
Definition: reentrant.h:129
#define thr_keycreate(k, d)
Definition: reentrant.h:144
#define thread_key_t
Definition: reentrant.h:124
static FILE * out
Definition: regtests2xml.c:44
struct netconfig * __rpc_getconfip(char *nettype) const
Definition: rpc_generic.c:235
SOCKET __rpc_nconf2fd(const struct netconfig *nconf)
Definition: rpc_generic.c:562
#define errno
Definition: errno.h:18
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
Definition: sockctrl.c:123
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
Definition: auth.h:205
u_short xp_port
Definition: svc.h:92
struct netbuf xp_ltaddr
Definition: svc.h:119
Definition: module.h:456
Definition: types.h:144
void * buf
Definition: types.h:147
unsigned int len
Definition: types.h:146
unsigned int maxlen
Definition: types.h:145
unsigned long nc_semantics
Definition: netconfig.h:17
char * nc_netid
Definition: netconfig.h:16
char * nc_protofmly
Definition: netconfig.h:19
struct rpc_err cf_error
Definition: clnt.h:497
enum clnt_stat cf_stat
Definition: clnt.h:496
Definition: tcpcore.h:1455
u_short sin_port
Definition: winsock.h:511
Definition: types.h:155
SVCXPRT * svc_tli_create(SOCKET fd, const struct netconfig *nconf, const struct t_bind *bindaddr, u_int sendsz, u_int recvsz)
Definition: svc_generic.c:182
SVCXPRT * svc_raw_create()
Definition: svc_raw.c:76
#define UDPMSGSIZE
Definition: svc_raw.c:49
int rpc_reg(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum, char **progname, xdrproc_t inproc, xdrproc_t outproc, char *nettype)
Definition: svc_simple.c:92
SVCXPRT * svcudp_bufcreate(int, u_int, u_int)
SVCXPRT * svctcp6_create(int, u_int, u_int)
__END_DECLS __BEGIN_DECLS SVCXPRT * svctcp_create(int, u_int, u_int)
__END_DECLS __BEGIN_DECLS SVCXPRT * svcraw_create(void)
SVCXPRT * svcudp6_create(int)
__END_DECLS __BEGIN_DECLS SVCXPRT * svcfd_create(int, u_int, u_int)
__END_DECLS __BEGIN_DECLS SVCXPRT * svcudp_create(int)
SVCXPRT * svcudp6_bufcreate(int, u_int, u_int)
SVCXPRT * svc_fd_create(SOCKET fd, u_int sendsize, u_int recvsize)
Definition: svc_vc.c:204
char * host
Definition: whois.c:55
#define SOMAXCONN
Definition: winsock.h:399
#define AF_UNIX
Definition: winsock.h:345
#define INVALID_SOCKET
Definition: winsock.h:332
UINT_PTR SOCKET
Definition: winsock.h:47
#define SOCKET_ERROR
Definition: winsock.h:333
#define SUN_LEN(ptr)
Definition: wintirpc.h:94
#define NI_MAXHOST
Definition: ws2def.h:359
#define getnameinfo
Definition: wspiapi.h:45
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144