#include <wintirpc.h>
#include <reentrant.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <stdio.h>
#include <netconfig.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/nettype.h>
#include "rpc_com.h"
Go to the source code of this file.
|
static int | getnettype (const char *) |
|
int | __rpc_dtbsize () |
|
u_int | __rpc_get_t_size (int af, int proto, int size) |
|
u_int | __rpc_get_a_size (int af) |
|
static int | getnettype (char *nettype) const |
|
struct netconfig * | __rpc_getconfip (char *nettype) const |
|
void * | __rpc_setconf (char *nettype) const |
|
struct netconfig * | __rpc_getconf (void *vhandle) |
|
void | __rpc_endconf (void *vhandle) |
|
void * | rpc_nullproc (CLIENT *clnt) |
|
struct netconfig * | __rpcgettp (SOCKET fd) |
|
int | __rpc_fd2sockinfo (SOCKET fd, struct __rpc_sockinfo *sip) |
|
int | __rpc_nconf2sockinfo (const struct netconfig *nconf, struct __rpc_sockinfo *sip) |
|
SOCKET | __rpc_nconf2fd (const struct netconfig *nconf) |
|
int | __rpc_sockinfo2netid (struct __rpc_sockinfo *sip, const char **netid) |
|
char * | taddr2uaddr (const struct netconfig *nconf, const struct netbuf *nbuf) |
|
struct netbuf * | uaddr2taddr (const struct netconfig *nconf, const char *uaddr) |
|
void | freeuaddr (char *uaddr) |
|
void | freenetbuf (struct netbuf *nbuf) |
|
char * | __rpc_taddr2uaddr_af (int af, const struct netbuf *nbuf) |
|
struct netbuf * | __rpc_uaddr2taddr_af (int af, const char *uaddr) |
|
int | __rpc_seman2socktype (int semantics) |
|
int | __rpc_socktype2seman (int socktype) |
|
int | __rpc_fixup_addr (struct netbuf *new, const struct netbuf *svc) |
|
int | __rpc_sockisbound (SOCKET fd) |
|
struct netbuf * | __rpc_set_netbuf (struct netbuf *nb, const void *ptr, size_t len) |
|
◆ __rpc_dtbsize()
Definition at line 110 of file rpc_generic.c.
111{
112#ifdef _WIN32
114#else
115
116 static int tbsize;
117 struct rlimit rl;
118
119 if (tbsize) {
120 return (tbsize);
121 }
122 if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
123 return (tbsize = (int)rl.rlim_max);
124 }
125
126
127
128
129 return (32);
130#endif
131}
#define WINSOCK_HANDLE_HASH_SIZE
Referenced by clnt_dg_create(), and clnt_vc_create().
◆ __rpc_endconf()
◆ __rpc_fd2sockinfo()
Definition at line 481 of file rpc_generic.c.
482{
486
487#ifdef _WIN32
489 int proto_info_size = sizeof(proto_info);
491#ifndef __REACTOS__
493#endif
494 return 0;
495 }
496 len = proto_info.iMaxSockAddr;
498#else
501 return 0;
502 }
503#endif
505
508#ifndef __REACTOS__
510#endif
511 return 0;
512 }
513
514
515#ifdef AF_LOCAL
516 if (
ss.ss_family != AF_LOCAL) {
517#endif
522 else
523 return 0;
524#ifdef AF_LOCAL
525 } else
527#endif
528
532
533 return 1;
534}
GLuint GLuint GLsizei GLenum type
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI getsockopt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT INT FAR *optlen)
int PASCAL FAR WSAGetLastError(void)
Referenced by __rpcgettp(), clnt_dg_create(), clnt_tli_create(), clnt_vc_create(), makefd_xprt(), rendezvous_request(), rpc_reg(), svc_dg_create(), svc_tli_create(), and svc_vc_create().
◆ __rpc_fixup_addr()
Definition at line 883 of file rpc_generic.c.
884{
885#ifdef INET6
888
890 sa_new = (
struct sockaddr *)
new->buf;
891
896
902 }
903 }
904#endif
905 return 1;
906}
#define IN6_IS_ADDR_LINKLOCAL(a)
#define IN6_IS_ADDR_SITELOCAL(a)
#define new(TYPE, numElems)
Referenced by __rpcb_findaddr_timed().
◆ __rpc_get_a_size()
◆ __rpc_get_t_size()
◆ __rpc_getconf()
Definition at line 348 of file rpc_generic.c.
350{
353
357 }
358 for (;;) {
361 else
364 break;
368 continue;
372 continue;
373
375 break;
378 continue;
379
383 continue;
384 break;
387 continue;
388
391 continue;
392 break;
397#ifdef INET6
399#else
400 )
401#endif
402 ||
404 continue;
405 break;
409#ifdef INET6
411#else
412 )
413#endif
414 ||
416 continue;
417 break;
418 }
419 break;
420 }
421 return (nconf);
422}
int strcmp(const char *String1, const char *String2)
struct netconfig * getnetconfig(void *handlep)
struct netconfig * getnetpath(void *handlep)
unsigned long nc_semantics
Referenced by clnt_create_timed(), rpc_broadcast_exp(), rpc_reg(), rpcb_gettime(), and svc_create().
◆ __rpc_getconfip()
Definition at line 235 of file rpc_generic.c.
237{
238 char *netid;
239 char *netid_tcp = (
char *)
NULL;
240 char *netid_udp = (
char *)
NULL;
244
250 }
257 }
259 if (!netid_udp && !netid_tcp) {
261 void *confighandle;
262
264
266 }
274 (void *) netid_tcp);
275 } else
280 (void *) netid_udp);
281 }
282 }
283 }
285 }
286 if (
strcmp(nettype,
"udp") == 0)
287 netid = netid_udp;
288 else if (
strcmp(nettype,
"tcp") == 0)
289 netid = netid_tcp;
290 else {
292 }
293 if ((netid ==
NULL) || (netid[0] == 0)) {
295 }
298}
DWORD WINAPI TlsAlloc(VOID)
struct netconfig * getnetconfigent(char *netid) const
#define thr_setspecific(k, p)
#define thr_getspecific(k)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
Referenced by pmap_set(), and pmap_unset().
◆ __rpc_nconf2fd()
Definition at line 562 of file rpc_generic.c.
563{
566
568 return 0;
569
573
575 }
577}
int __rpc_nconf2sockinfo(const struct netconfig *nconf, struct __rpc_sockinfo *sip)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Referenced by clnt_tli_create(), and svc_tli_create().
◆ __rpc_nconf2sockinfo()
Definition at line 540 of file rpc_generic.c.
541{
543
553 return 0;
555 return 1;
556 }
557
558 return 0;
559}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const struct netid_af na_cvt[]
int __rpc_seman2socktype(int semantics)
u_int __rpc_get_a_size(int af)
Referenced by __rpc_nconf2fd(), getclnthandle(), rpc_broadcast_exp(), svc_tli_create(), taddr2uaddr(), and uaddr2taddr().
◆ __rpc_seman2socktype()
int __rpc_seman2socktype |
( |
int |
semantics | ) |
|
◆ __rpc_set_netbuf()
◆ __rpc_setconf()
void * __rpc_setconf |
( |
char * |
nettype | ) |
const |
◆ __rpc_sockinfo2netid()
Definition at line 580 of file rpc_generic.c.
581{
584
586
591 if (netid)
592 *netid = "unix";
593 } else {
594 if (netid)
596 }
599 return 1;
600 }
601 }
604
605 return 0;
606}
void freenetconfigent(struct netconfig *netconfigp)
Referenced by __rpcgettp(), and makefd_xprt().
◆ __rpc_sockisbound()
Definition at line 909 of file rpc_generic.c.
910{
912 union {
915#ifdef AF_LOCAL
917#endif
918 } u_addr;
920
923 return 0;
924
925 switch (
ss.ss_family) {
927 memcpy(&u_addr.sin, &
ss,
sizeof(u_addr.sin));
928 return (u_addr.sin.sin_port != 0);
929#ifdef INET6
931 memcpy(&u_addr.sin6, &
ss,
sizeof(u_addr.sin6));
932 return (u_addr.sin6.sin6_port != 0);
933#endif
934#ifdef AF_LOCAL
935 case AF_LOCAL:
936
937 memcpy(&u_addr.usin, &
ss,
sizeof(u_addr.usin));
938 return (u_addr.usin.sun_path[0] != 0);
939#endif
940 default:
941 break;
942 }
943
944 return 0;
945}
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
Referenced by svc_tli_create().
◆ __rpc_socktype2seman()
int __rpc_socktype2seman |
( |
int |
socktype | ) |
|
◆ __rpc_taddr2uaddr_af()
Definition at line 663 of file rpc_generic.c.
664{
667#ifdef AF_LOCAL
669#endif
671#ifdef INET6
674#endif
676
679
680 switch (af) {
682#ifdef __REACTOS__
683 if (nbuf->
len <
sizeof(*
sin)) {
685 }
686#endif
688 if (
inet_ntop(af, &
sin->sin_addr, namebuf,
sizeof namebuf)
695 break;
696#ifdef INET6
698#ifdef __REACTOS__
699 if (nbuf->
len <
sizeof(*sin6)) {
701 }
702#endif
711 break;
712#endif
713#ifdef AF_LOCAL
714 case AF_LOCAL:
716
717
718
722
724 break;
725#endif
726 default:
728 }
729
731}
int asprintf(char **str, const char *fmt,...)
#define offsetof(TYPE, MEMBER)
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
Referenced by taddr2uaddr().
◆ __rpc_uaddr2taddr_af()
Definition at line 734 of file rpc_generic.c.
735{
738 unsigned short port, portlo, porthi;
740#ifdef INET6
742#endif
743#ifdef AF_LOCAL
745#endif
746
749#ifdef __REACTOS__
752#endif
756
757
758
759
760
761 if (*addrstr != '/') {
767
773 port = (porthi << 8) | portlo;
774 }
775
779
780 switch (af) {
788#ifndef __REACTOS__
790#else
793#endif
798 }
801 break;
802#ifdef INET6
807 memset(sin6, 0,
sizeof *sin6);
815 }
816 ret->maxlen =
ret->len =
sizeof *sin6;
818 break;
819#endif
820#ifdef AF_LOCAL
821 case AF_LOCAL:
825 memset(sun, 0,
sizeof *sun);
831 break;
832#endif
833 default:
834 break;
835 }
839}
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
INT WSAAPI inet_pton(_In_ INT Family, _In_ PCSTR pszAddrString, _Out_writes_bytes_(sizeof(IN_ADDR6)) PVOID pAddrBuf)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static unsigned(__cdecl *hash_bstr)(bstr_t s)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
ADDRESS_FAMILY sin6_family
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Referenced by uaddr2taddr().
◆ __rpcgettp()
Definition at line 464 of file rpc_generic.c.
466{
467 const char *netid;
469
472
475
476
478}
int __rpc_sockinfo2netid(struct __rpc_sockinfo *sip, const char **netid)
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
Referenced by svc_reg().
◆ freenetbuf()
◆ freeuaddr()
◆ getnettype() [1/2]
static int getnettype |
( |
char * |
nettype | ) |
const |
|
static |
Definition at line 211 of file rpc_generic.c.
213{
215
216 if ((nettype ==
NULL) || (nettype[0] == 0)) {
218 }
219
220#if 0
221 nettype = strlocase(nettype);
222#endif
226 }
228}
static const struct _rpcnettype _rpctypelist[]
◆ getnettype() [2/2]
◆ rpc_nullproc()
Definition at line 447 of file rpc_generic.c.
449{
451
455 }
456 return ((void *) clnt);
457}
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
bool_t(* xdrproc_t)(XDR *,...)
◆ taddr2uaddr()
◆ uaddr2taddr()
◆ _rpctypelist
◆ na_cvt