ReactOS  0.4.14-dev-608-gd495a4f
rpc_com.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RPC_MAXDATASIZE   9000
 
#define RPC_MAXADDRSIZE   1024
 
#define __RPC_GETXID(now)
 

Functions

__BEGIN_DECLS u_int __rpc_get_a_size (int)
 
int __rpc_dtbsize (void)
 
struct netconfig__rpcgettp (SOCKET)
 
int __rpc_get_default_domain (char **)
 
struct netbuf__rpc_set_netbuf (struct netbuf *, const void *, size_t)
 
char__rpc_taddr2uaddr_af (int, const struct netbuf *)
 
struct netbuf__rpc_uaddr2taddr_af (int, const char *)
 
int __rpc_fixup_addr (struct netbuf *, const struct netbuf *)
 
int __rpc_sockinfo2netid (struct __rpc_sockinfo *, const char **)
 
int __rpc_seman2socktype (int)
 
int __rpc_socktype2seman (int)
 
voidrpc_nullproc (CLIENT *)
 
int __rpc_sockisbound (SOCKET)
 
struct netbuf__rpcb_findaddr (rpcprog_t, rpcvers_t, const struct netconfig *, const char *, CLIENT **)
 
struct netbuf__rpcb_findaddr_timed (rpcprog_t, rpcvers_t, const struct netconfig *, const char *host, CLIENT **clpp, struct timeval *tp)
 
bool_t __rpc_control (int, void *)
 
char_get_next_token (char *, int)
 
bool_t __svc_clean_idle (fd_set *, int, bool_t)
 
bool_t __xdrrec_setnonblock (XDR *, int)
 
bool_t __xdrrec_setblock (XDR *)
 
bool_t __xdrrec_getrec (XDR *, enum xprt_stat *, bool_t)
 
void __xprt_unregister_unlocked (SVCXPRT *)
 
void __xprt_set_raddr (SVCXPRT *, const struct sockaddr_storage *)
 

Variables

SVCXPRT ** __svc_xports
 
int __svc_maxrec
 

Macro Definition Documentation

◆ __RPC_GETXID

#define __RPC_GETXID (   now)
Value:
((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
(u_int32_t)(now)->tv_usec)
time_t now
Definition: finger.c:65
_CRTIMP int __cdecl getpid(void)
#define u_int32_t
Definition: icmp.c:103

Definition at line 58 of file rpc_com.h.

◆ RPC_MAXADDRSIZE

#define RPC_MAXADDRSIZE   1024

Definition at line 52 of file rpc_com.h.

◆ RPC_MAXDATASIZE

#define RPC_MAXDATASIZE   9000

Definition at line 51 of file rpc_com.h.

Function Documentation

◆ __rpc_control()

bool_t __rpc_control ( int  ,
void  
)

Definition at line 108 of file rpcb_clnt.c.

111 {
112  switch (request) {
114  *(struct timeval *)info = tottimeout;
115  break;
117  tottimeout = *(struct timeval *)info;
118  break;
119  case CLCR_SET_LOWVERS:
120  __rpc_lowvers = *(int *)info;
121  break;
122  case CLCR_GET_LOWVERS:
123  *(int *)info = __rpc_lowvers;
124  break;
125  default:
126  return (FALSE);
127  }
128  return (TRUE);
129 }
#define TRUE
Definition: types.h:120
#define CLCR_SET_LOWVERS
Definition: clnt.h:176
#define CLCR_SET_RPCB_TIMEOUT
Definition: rpcb_clnt.c:87
#define CLCR_GET_RPCB_TIMEOUT
Definition: rpcb_clnt.c:86
#define CLCR_GET_LOWVERS
Definition: clnt.h:177
int __rpc_lowvers
static struct timeval tottimeout
Definition: rpcb_clnt.c:63
Definition: tftpd.h:85

◆ __rpc_dtbsize()

int __rpc_dtbsize ( void  )

Definition at line 110 of file rpc_generic.c.

111 {
112 #ifdef _WIN32
113  return (WINSOCK_HANDLE_HASH_SIZE);
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  * Something wrong. I'll try to save face by returning a
127  * pessimistic number.
128  */
129  return (32);
130 #endif
131 }
#define WINSOCK_HANDLE_HASH_SIZE
Definition: wintirpc.h:69

Referenced by clnt_dg_create(), and clnt_vc_create().

◆ __rpc_fixup_addr()

int __rpc_fixup_addr ( struct netbuf ,
const struct netbuf  
)

Definition at line 883 of file rpc_generic.c.

884 {
885 #ifdef INET6
886  struct sockaddr *sa_new, *sa_svc;
887  struct sockaddr_in6 *sin6_new, *sin6_svc;
888 
889  sa_svc = (struct sockaddr *)svc->buf;
890  sa_new = (struct sockaddr *)new->buf;
891 
892  if (sa_new->sa_family == sa_svc->sa_family &&
893  sa_new->sa_family == AF_INET6) {
894  sin6_new = (struct sockaddr_in6 *)new->buf;
895  sin6_svc = (struct sockaddr_in6 *)svc->buf;
896 
897  if ((IN6_IS_ADDR_LINKLOCAL(&sin6_new->sin6_addr) &&
898  IN6_IS_ADDR_LINKLOCAL(&sin6_svc->sin6_addr)) ||
899  (IN6_IS_ADDR_SITELOCAL(&sin6_new->sin6_addr) &&
900  IN6_IS_ADDR_SITELOCAL(&sin6_svc->sin6_addr))) {
901  sin6_new->sin6_scope_id = sin6_svc->sin6_scope_id;
902  }
903  }
904 #endif
905  return 1;
906 }
#define new(TYPE, numElems)
Definition: treelist.c:54
ULONG sin6_scope_id
Definition: ws2ipdef.h:184
#define AF_INET6
Definition: winsock.h:369
IN6_ADDR sin6_addr
Definition: ws2ipdef.h:182
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_SITELOCAL(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:371
u_short sa_family
Definition: winsock.h:217
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_LINKLOCAL(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:364

Referenced by __rpcb_findaddr_timed().

◆ __rpc_get_a_size()

__BEGIN_DECLS u_int __rpc_get_a_size ( int  )

Definition at line 172 of file rpc_generic.c.

174 {
175  switch (af) {
176  case AF_INET:
177  return sizeof (struct sockaddr_in);
178 #ifdef INET6
179  case AF_INET6:
180  return sizeof (struct sockaddr_in6);
181 #endif
182 #ifdef AF_LOCAL
183  case AF_LOCAL:
184  return sizeof (struct sockaddr_un);
185 #endif
186  default:
187  break;
188  }
189  return ((u_int)RPC_MAXADDRSIZE);
190 }
#define AF_INET6
Definition: winsock.h:369
#define RPC_MAXADDRSIZE
Definition: rpc_com.h:52
UINT32 u_int
Definition: types.h:82
#define AF_INET
Definition: tcpip.h:117

Referenced by rpc_broadcast_exp().

◆ __rpc_get_default_domain()

int __rpc_get_default_domain ( char **  )

Definition at line 72 of file rpcdname.c.

74 {
75  if ((*domain = get_default_domain()) != 0)
76  return (0);
77  return (-1);
78 }
Definition: cookie.c:41
static char * get_default_domain()
Definition: rpcdname.c:43

Referenced by host2netname(), netname2host(), netname2user(), and user2netname().

◆ __rpc_seman2socktype()

int __rpc_seman2socktype ( int  )

Definition at line 842 of file rpc_generic.c.

843 {
844  switch (semantics) {
845  case NC_TPI_CLTS:
846  return SOCK_DGRAM;
847  case NC_TPI_COTS_ORD:
848  return SOCK_STREAM;
849  case NC_TPI_RAW:
850  return SOCK_RAW;
851  default:
852  break;
853  }
854 
855  return -1;
856 }
#define NC_TPI_CLTS
Definition: netconfig.h:30
#define SOCK_RAW
Definition: winsock.h:337
#define NC_TPI_COTS_ORD
Definition: netconfig.h:32
#define NC_TPI_RAW
Definition: netconfig.h:33
#define SOCK_STREAM
Definition: tcpip.h:118
#define SOCK_DGRAM
Definition: winsock.h:336

◆ __rpc_set_netbuf()

struct netbuf* __rpc_set_netbuf ( struct netbuf ,
const void ,
size_t   
)

Definition at line 951 of file rpc_generic.c.

952 {
953  if (nb->len != len) {
954  if (nb->len)
955  mem_free(nb->buf, nb->len);
956  nb->buf = mem_alloc(len);
957  if (nb->buf == NULL)
958  return NULL;
959 
960  nb->maxlen = nb->len = len;
961  }
962  memcpy(nb->buf, ptr, len);
963  return nb;
964 }
#define mem_alloc(bsize)
Definition: types.h:123
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define mem_free(ptr, bsize)
Definition: types.h:124

Referenced by rendezvous_request(), svc_dg_create(), svc_dg_recv(), svc_fd_create(), and svc_vc_create().

◆ __rpc_sockinfo2netid()

int __rpc_sockinfo2netid ( struct __rpc_sockinfo ,
const char **   
)

Definition at line 580 of file rpc_generic.c.

581 {
582  int i;
583  struct netconfig *nconf;
584 
585  nconf = getnetconfigent("local");
586 
587  for (i = 0; i < (sizeof na_cvt) / (sizeof (struct netid_af)); i++) {
588  if (na_cvt[i].af == sip->si_af &&
589  na_cvt[i].protocol == sip->si_proto) {
590  if (strcmp(na_cvt[i].netid, "local") == 0 && nconf == NULL) {
591  if (netid)
592  *netid = "unix";
593  } else {
594  if (netid)
595  *netid = na_cvt[i].netid;
596  }
597  if (nconf != NULL)
598  freenetconfigent(nconf);
599  return 1;
600  }
601  }
602  if (nconf != NULL)
603  freenetconfigent(nconf);
604 
605  return 0;
606 }
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
Definition: glfuncs.h:248
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
smooth NULL
Definition: ftsmooth.c:416
struct netconfig * getnetconfigent(char *netid) const
Definition: getnetconfig.c:432
static const struct netid_af na_cvt[]
Definition: rpc_generic.c:88
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by makefd_xprt().

◆ __rpc_sockisbound()

int __rpc_sockisbound ( SOCKET  )

Definition at line 909 of file rpc_generic.c.

910 {
911  struct sockaddr_storage ss;
912  union {
913  struct sockaddr_in sin;
914  struct sockaddr_in6 sin6;
915 #ifdef AF_LOCAL
916  struct sockaddr_un usin;
917 #endif
918  } u_addr;
919  socklen_t slen;
920 
921  slen = sizeof (struct sockaddr_storage);
922  if (getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) == SOCKET_ERROR)
923  return 0;
924 
925  switch (ss.ss_family) {
926  case AF_INET:
927  memcpy(&u_addr.sin, &ss, sizeof(u_addr.sin));
928  return (u_addr.sin.sin_port != 0);
929 #ifdef INET6
930  case AF_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  /* XXX check this */
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 }
#define SOCKET_ERROR
Definition: winsock.h:333
static int fd
Definition: io.c:51
#define AF_INET6
Definition: winsock.h:369
int socklen_t
Definition: tcp.c:35
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define AF_INET
Definition: tcpip.h:117
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
#define ss
Definition: i386-dis.c:432
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
Definition: sockctrl.c:213

Referenced by svc_tli_create().

◆ __rpc_socktype2seman()

int __rpc_socktype2seman ( int  )

Definition at line 859 of file rpc_generic.c.

860 {
861  switch (socktype) {
862  case SOCK_DGRAM:
863  return NC_TPI_CLTS;
864  case SOCK_STREAM:
865  return NC_TPI_COTS_ORD;
866  case SOCK_RAW:
867  return NC_TPI_RAW;
868  default:
869  break;
870  }
871 
872  return -1;
873 }
#define NC_TPI_CLTS
Definition: netconfig.h:30
#define SOCK_RAW
Definition: winsock.h:337
#define NC_TPI_COTS_ORD
Definition: netconfig.h:32
#define NC_TPI_RAW
Definition: netconfig.h:33
#define SOCK_STREAM
Definition: tcpip.h:118
#define SOCK_DGRAM
Definition: winsock.h:336

Referenced by clnt_tli_create(), and svc_tli_create().

◆ __rpc_taddr2uaddr_af()

char* __rpc_taddr2uaddr_af ( int  ,
const struct netbuf  
)

Definition at line 663 of file rpc_generic.c.

664 {
665  char *ret;
666  struct sockaddr_in *sin;
667 #ifdef AF_LOCAL
668  struct sockaddr_un *sun;
669 #endif
670  char namebuf[INET_ADDRSTRLEN];
671 #ifdef INET6
672  struct sockaddr_in6 *sin6;
673  char namebuf6[INET6_ADDRSTRLEN];
674 #endif
675  u_int16_t port;
676 
677  if (nbuf->len <= 0)
678  return NULL;
679 
680  switch (af) {
681  case AF_INET:
682 #ifdef __REACTOS__ // CVE-2017-8779
683  if (nbuf->len < sizeof(*sin)) {
684  return NULL;
685  }
686 #endif
687  sin = nbuf->buf;
688  if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf)
689  == NULL)
690  return NULL;
691  port = ntohs(sin->sin_port);
692  if (asprintf(&ret, "%s.%u.%u", namebuf, ((u_int32_t)port) >> 8,
693  port & 0xff) < 0)
694  return NULL;
695  break;
696 #ifdef INET6
697  case AF_INET6:
698 #ifdef __REACTOS__ // CVE-2017-8779
699  if (nbuf->len < sizeof(*sin6)) {
700  return NULL;
701  }
702 #endif
703  sin6 = nbuf->buf;
704  if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6)
705  == NULL)
706  return NULL;
707  port = ntohs(sin6->sin6_port);
708  if (asprintf(&ret, "%s.%u.%u", namebuf6, ((u_int32_t)port) >> 8,
709  port & 0xff) < 0)
710  return NULL;
711  break;
712 #endif
713 #ifdef AF_LOCAL
714  case AF_LOCAL:
715  sun = nbuf->buf;
716  /* if (asprintf(&ret, "%.*s", (int)(sun->sun_len -
717  offsetof(struct sockaddr_un, sun_path)),
718  sun->sun_path) < 0)*/
719  if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) -
720  offsetof(struct sockaddr_un, sun_path)),
721  sun->sun_path) < 0)
722 
723  return (NULL);
724  break;
725 #endif
726  default:
727  return NULL;
728  }
729 
730  return ret;
731 }
USHORT sin6_port
Definition: ws2ipdef.h:180
char sun_path[MAX_PATH]
Definition: wintirpc.h:90
#define ntohs(x)
Definition: module.h:208
int asprintf(char **str, const char *fmt,...)
Definition: asprintf.c:95
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
#define AF_INET6
Definition: winsock.h:369
IN6_ADDR sin6_addr
Definition: ws2ipdef.h:182
unsigned short u_int16_t
Definition: rosdhcp.h:34
int ret
#define INET_ADDRSTRLEN
Definition: ws2ipdef.h:131
unsigned int u_int32_t
Definition: rosdhcp.h:35
#define INET6_ADDRSTRLEN
Definition: ws2ipdef.h:132
#define AF_INET
Definition: tcpip.h:117
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
Definition: unix_func.c:8
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
USHORT port
Definition: uri.c:228

◆ __rpc_uaddr2taddr_af()

struct netbuf* __rpc_uaddr2taddr_af ( int  ,
const char  
)

Definition at line 734 of file rpc_generic.c.

735 {
736  struct netbuf *ret = NULL;
737  char *addrstr, *p;
738  unsigned short port, portlo, porthi;
739  struct sockaddr_in *sin;
740 #ifdef INET6
741  struct sockaddr_in6 *sin6;
742 #endif
743 #ifdef AF_LOCAL
744  struct sockaddr_un *sun;
745 #endif
746 
747  port = 0;
748  sin = NULL;
749 #ifdef __REACTOS__ // CVE-2017-8779
750  if (uaddr == NULL)
751  return NULL;
752 #endif
753  addrstr = strdup(uaddr);
754  if (addrstr == NULL)
755  return NULL;
756 
757  /*
758  * AF_LOCAL addresses are expected to be absolute
759  * pathnames, anything else will be AF_INET or AF_INET6.
760  */
761  if (*addrstr != '/') {
762  p = strrchr(addrstr, '.');
763  if (p == NULL)
764  goto out;
765  portlo = (unsigned)atoi(p + 1);
766  *p = '\0';
767 
768  p = strrchr(addrstr, '.');
769  if (p == NULL)
770  goto out;
771  porthi = (unsigned)atoi(p + 1);
772  *p = '\0';
773  port = (porthi << 8) | portlo;
774  }
775 
776  ret = (struct netbuf *)malloc(sizeof *ret);
777  if (ret == NULL)
778  goto out;
779 
780  switch (af) {
781  case AF_INET:
782  sin = (struct sockaddr_in *)malloc(sizeof *sin);
783  if (sin == NULL)
784  goto out;
785  memset(sin, 0, sizeof *sin);
786  sin->sin_family = AF_INET;
787  sin->sin_port = htons(port);
788 #ifndef __REACTOS__
789  if (inet_pton(AF_INET, addrstr, &sin->sin_addr) <= 0) {
790 #else
791  sin->sin_addr.S_un.S_addr = inet_addr(addrstr);
792  if (sin->sin_addr.S_un.S_addr == INADDR_NONE) {
793 #endif
794  free(sin);
795  free(ret);
796  ret = NULL;
797  goto out;
798  }
799  ret->maxlen = ret->len = sizeof *sin;
800  ret->buf = sin;
801  break;
802 #ifdef INET6
803  case AF_INET6:
804  sin6 = (struct sockaddr_in6 *)malloc(sizeof *sin6);
805  if (sin6 == NULL)
806  goto out;
807  memset(sin6, 0, sizeof *sin6);
808  sin6->sin6_family = AF_INET6;
809  sin6->sin6_port = htons(port);
810  if (inet_pton(AF_INET6, addrstr, &sin6->sin6_addr) <= 0) {
811  free(sin6);
812  free(ret);
813  ret = NULL;
814  goto out;
815  }
816  ret->maxlen = ret->len = sizeof *sin6;
817  ret->buf = sin6;
818  break;
819 #endif
820 #ifdef AF_LOCAL
821  case AF_LOCAL:
822  sun = (struct sockaddr_un *)malloc(sizeof *sun);
823  if (sun == NULL)
824  goto out;
825  memset(sun, 0, sizeof *sun);
826  sun->sun_family = AF_LOCAL;
827  strncpy(sun->sun_path, addrstr, sizeof(sun->sun_path) - 1);
828  ret->len = SUN_LEN(sun);
829  ret->maxlen = sizeof(struct sockaddr_un);
830  ret->buf = sun;
831  break;
832 #endif
833  default:
834  break;
835  }
836 out:
837  free(addrstr);
838  return ret;
839 }
#define inet_addr(cp)
Definition: inet.h:98
ADDRESS_FAMILY sin6_family
Definition: ws2ipdef.h:179
USHORT sin6_port
Definition: ws2ipdef.h:180
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define free
Definition: debug_ros.c:5
#define INADDR_NONE
Definition: tcp.c:42
char sun_path[MAX_PATH]
Definition: wintirpc.h:90
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
smooth NULL
Definition: ftsmooth.c:416
#define AF_INET6
Definition: winsock.h:369
#define SUN_LEN(ptr)
Definition: wintirpc.h:94
IN6_ADDR sin6_addr
Definition: ws2ipdef.h:182
static FILE * out
Definition: regtests2xml.c:44
int ret
Definition: types.h:144
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
WINSOCK_API_LINKAGE INT WSAAPI inet_pton(_In_ INT Family, _In_ PCSTR pszAddrString, _Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf)
#define AF_INET
Definition: tcpip.h:117
#define malloc
Definition: debug_ros.c:4
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
int sun_family
Definition: wintirpc.h:89
GLfloat GLfloat p
Definition: glext.h:8902
#define htons(x)
Definition: module.h:213
USHORT port
Definition: uri.c:228
#define memset(x, y, z)
Definition: compat.h:39
static unsigned(__cdecl *hash_bstr)(bstr_t s)

◆ __rpcb_findaddr()

struct netbuf* __rpcb_findaddr ( rpcprog_t  ,
rpcvers_t  ,
const struct netconfig ,
const char ,
CLIENT **   
)

◆ __rpcb_findaddr_timed()

struct netbuf* __rpcb_findaddr_timed ( rpcprog_t  ,
rpcvers_t  ,
const struct netconfig ,
const char host,
CLIENT **  clpp,
struct timeval tp 
)

Definition at line 709 of file rpcb_clnt.c.

716 {
717 #ifdef NOTUSED
718  static bool_t check_rpcbind = TRUE;
719 #endif
720  CLIENT *client = NULL;
721  RPCB parms;
722  enum clnt_stat clnt_st;
723  char *ua = NULL;
724  rpcvers_t vers;
725  struct netbuf *address = NULL;
726  rpcvers_t start_vers = RPCBVERS4;
727  struct netbuf servaddr;
728 
729  /* parameter checking */
730  if (nconf == NULL) {
732  return (NULL);
733  }
734 
735  parms.r_addr = NULL;
736 
737  /*
738  * Use default total timeout if no timeout is specified.
739  */
740  if (tp == NULL)
741  tp = &tottimeout;
742 
743 #ifdef PORTMAP
744  /* Try version 2 for TCP or UDP */
745  if (strcmp(nconf->nc_protofmly, NC_INET) == 0) {
746  u_short port = 0;
747  struct netbuf remote;
748  rpcvers_t pmapvers = 2;
749  struct pmap pmapparms;
750 
751  /*
752  * Try UDP only - there are some portmappers out
753  * there that use UDP only.
754  */
755  if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
756  struct netconfig *newnconf;
757 
758  if ((newnconf = getnetconfigent("udp")) == NULL) {
760  return (NULL);
761  }
762  client = getclnthandle(host, newnconf, &parms.r_addr);
763  freenetconfigent(newnconf);
764  } else if (strcmp(nconf->nc_proto, NC_UDP) == 0)
765  client = getclnthandle(host, nconf, &parms.r_addr);
766  else
767  goto try_rpcbind;
768  if (client == NULL)
769  return (NULL);
770 
771  /*
772  * Set version and retry timeout.
773  */
775  CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers);
776 
777  pmapparms.pm_prog = program;
778  pmapparms.pm_vers = version;
779  pmapparms.pm_prot = strcmp(nconf->nc_proto, NC_TCP) ?
781  pmapparms.pm_port = 0; /* not needed */
783  (xdrproc_t) xdr_pmap, (caddr_t)(void *)&pmapparms,
784  (xdrproc_t) xdr_u_short, (caddr_t)(void *)&port,
785  *tp);
786  if (clnt_st != RPC_SUCCESS) {
787  if ((clnt_st == RPC_PROGVERSMISMATCH) ||
788  (clnt_st == RPC_PROGUNAVAIL))
789  goto try_rpcbind;
792  goto error;
793  } else if (port == 0) {
794  address = NULL;
796  goto error;
797  }
798  port = htons(port);
799  CLNT_CONTROL(client, CLGET_SVC_ADDR, (char *)&remote);
800  if (((address = (struct netbuf *)
801  malloc(sizeof (struct netbuf))) == NULL) ||
802  ((address->buf = (char *)
803  malloc(remote.len)) == NULL)) {
806  if (address) {
807  free(address);
808  address = NULL;
809  }
810  goto error;
811  }
812  memcpy(address->buf, remote.buf, remote.len);
813  memcpy(&((char *)address->buf)[sizeof (short)],
814  (char *)(void *)&port, sizeof (short));
815  address->len = address->maxlen = remote.len;
816  goto done;
817  }
818 
819 try_rpcbind:
820 #endif /* PORTMAP */
821 
822  parms.r_prog = program;
823  parms.r_vers = version;
824  parms.r_netid = nconf->nc_netid;
825 
826  /*
827  * rpcbind ignores the r_owner field in GETADDR requests, but we
828  * need to give xdr_rpcb something to gnaw on. Might as well make
829  * it something human readable for when we see these in captures.
830  */
831  parms.r_owner = RPCB_OWNER_STRING;
832 
833  /* Now the same transport is to be used to get the address */
834  if (client && ((nconf->nc_semantics == NC_TPI_COTS_ORD) ||
835  (nconf->nc_semantics == NC_TPI_COTS))) {
836  /* A CLTS type of client - destroy it */
838  client = NULL;
839  free(parms.r_addr);
840  parms.r_addr = NULL;
841  }
842 
843  if (client == NULL) {
844  client = getclnthandle(host, nconf, &parms.r_addr);
845  if (client == NULL) {
846  goto error;
847  }
848  }
849  if (parms.r_addr == NULL) {
850  /*LINTED const castaway*/
851  parms.r_addr = (char *) &nullstring[0];
852  }
853 
854  /* First try from start_vers(4) and then version 3 (RPCBVERS) */
855 
857  for (vers = start_vers; vers >= RPCBVERS; vers--) {
858  /* Set the version */
859  CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers);
861  (xdrproc_t) xdr_rpcb, (char *)(void *)&parms,
862  (xdrproc_t) xdr_wrapstring, (char *)(void *) &ua, *tp);
863  if (clnt_st == RPC_SUCCESS) {
864  if ((ua == NULL) || (ua[0] == 0)) {
865  /* address unknown */
867  goto error;
868  }
869  address = uaddr2taddr(nconf, ua);
870 #ifdef ND_DEBUG
871  fprintf(stderr, "\tRemote address is [%s]\n", ua);
872  if (!address)
873  fprintf(stderr,
874  "\tCouldn't resolve remote address!\n");
875 #endif
877  (char *)(void *)&ua);
878 
879  if (! address) {
880  /* We don't know about your universal address */
882  goto error;
883  }
885  (char *)(void *)&servaddr);
886  __rpc_fixup_addr(address, &servaddr);
887  goto done;
888  } else if (clnt_st == RPC_PROGVERSMISMATCH) {
889  struct rpc_err rpcerr;
890  clnt_geterr(client, &rpcerr);
891  if (rpcerr.re_vers.low > RPCBVERS4)
892  goto error; /* a new version, can't handle */
893  } else if (clnt_st != RPC_PROGUNAVAIL) {
894  /* Cant handle this error */
895  rpc_createerr.cf_stat = clnt_st;
897  goto error;
898  }
899  }
900 
901  if ((address == NULL) || (address->len == 0)) {
904  }
905 
906 error:
907  if (client) {
909  client = NULL;
910  }
911 done:
912  if (nconf->nc_semantics != NC_TPI_CLTS) {
913  /* This client is the connectionless one */
914  if (client) {
916  client = NULL;
917  }
918  }
919  if (clpp) {
920  *clpp = client;
921  } else if (client) {
923  }
924  if (parms.r_addr != NULL && parms.r_addr != nullstring)
925  free(parms.r_addr);
926  return (address);
927 }
int __rpc_fixup_addr(struct netbuf *, const struct netbuf *)
Definition: rpc_generic.c:883
static CLIENT * getclnthandle(const char *, const struct netconfig *, char **)
#define RPC_PMAPFAILURE
Definition: clnt_stat.h:57
bool_t xdr_wrapstring(XDR *, char **)
Definition: xdr.c:772
u_int32_t rpcproc_t
Definition: types.h:106
#define RPCB_OWNER_STRING
Definition: rpcb_clnt.c:71
#define clnt_geterr(rh, errp)
Definition: clnt.h:220
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs)
Definition: pmap_prot.c:45
#define TRUE
Definition: types.h:120
u_int32_t rpcvers_t
Definition: types.h:105
#define CLSET_RETRY_TIMEOUT
Definition: clnt.h:265
#define error(str)
Definition: mkdosfs.c:1605
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
int32_t bool_t
Definition: types.h:101
#define NC_TPI_CLTS
Definition: netconfig.h:30
#define free
Definition: debug_ros.c:5
char * host
Definition: whois.c:55
void xdr_free(xdrproc_t proc, void *objp)
Definition: xdr.c:78
#define NC_TCP
Definition: netconfig.h:74
char * r_netid
Definition: rpcb_prot.h:143
char * caddr_t
Definition: rosdhcp.h:36
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:199
#define NC_TPI_COTS_ORD
Definition: netconfig.h:32
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
smooth NULL
Definition: ftsmooth.c:416
struct netconfig * getnetconfigent(char *netid) const
Definition: getnetconfig.c:432
static const WCHAR version[]
Definition: asmname.c:66
struct netbuf * uaddr2taddr(const struct netconfig *nconf, const char *uaddr)
Definition: rpc_generic.c:619
#define RPCBPROC_GETADDR
Definition: rpcb_prot.h:688
rpcprog_t r_prog
Definition: rpcb_prot.h:141
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2855
#define PMAPPROC_GETPORT
Definition: pmap_prot.h:84
char * r_addr
Definition: rpcb_prot.h:144
enum clnt_stat cf_stat
Definition: clnt.h:496
static FILE * client
Definition: client.c:41
GLuint address
Definition: glext.h:9393
char * r_owner
Definition: rpcb_prot.h:145
unsigned short u_short
Definition: types.h:81
rpcvers_t r_vers
Definition: rpcb_prot.h:142
#define NC_UDP
Definition: netconfig.h:75
#define NC_INET
Definition: netconfig.h:47
#define NC_TPI_COTS
Definition: netconfig.h:31
static struct timeval rpcbrmttime
Definition: rpcb_clnt.c:65
static const char nullstring[]
Definition: rpcb_clnt.c:69
#define RPCBVERS
Definition: rpcb_prot.h:627
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: clnt.h:95
bool_t xdr_u_short(XDR *xdrs, u_short *usp)
Definition: xdr.c:300
#define CLNT_DESTROY(rh)
Definition: clnt.h:275
static struct timeval tottimeout
Definition: rpcb_clnt.c:63
#define CLGET_SVC_ADDR
Definition: clnt.h:250
GLuint program
Definition: glext.h:6723
#define RPCBVERS4
Definition: rpcb_prot.h:707
bool_t xdr_rpcb(XDR *xdrs, RPCB *objp)
Definition: rpcb_prot.c:50
#define CLSET_VERS
Definition: clnt.h:256
Definition: types.h:144
struct rpc_err cf_error
Definition: clnt.h:497
FILE * stderr
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define malloc
Definition: debug_ros.c:4
#define htons(x)
Definition: module.h:213
#define CLNT_CONTROL(cl, rq, in)
Definition: clnt.h:240
USHORT port
Definition: uri.c:228
clnt_stat
Definition: clnt_stat.h:21
Definition: pmap_prot.h:88

Referenced by clnt_tp_create_timed(), and rpcb_getaddr().

◆ __rpcgettp()

struct netconfig* __rpcgettp ( SOCKET  )

Definition at line 464 of file rpc_generic.c.

466 {
467  const char *netid;
468  struct __rpc_sockinfo si;
469 
470  if (!__rpc_fd2sockinfo(fd, &si))
471  return NULL;
472 
473  if (!__rpc_sockinfo2netid(&si, &netid))
474  return NULL;
475 
476  /*LINTED const castaway*/
477  return getnetconfigent((char *)netid);
478 }
static int fd
Definition: io.c:51
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
Definition: rpc_generic.c:481
smooth NULL
Definition: ftsmooth.c:416
struct netconfig * getnetconfigent(char *netid) const
Definition: getnetconfig.c:432
int __rpc_sockinfo2netid(struct __rpc_sockinfo *sip, const char **netid)
Definition: rpc_generic.c:580

Referenced by svc_reg().

◆ __svc_clean_idle()

bool_t __svc_clean_idle ( fd_set ,
int  ,
bool_t   
)

Definition at line 820 of file svc_vc.c.

821 {
822  int i, ncleaned;
823  SVCXPRT *xprt, *least_active;
824  struct timeval tv, tdiff, tmax;
825  struct cf_conn *cd;
826 
827  gettimeofday(&tv, NULL);
828  tmax.tv_sec = tmax.tv_usec = 0;
829  least_active = NULL;
831  for (i = ncleaned = 0; i <= svc_maxfd; i++) {
832  if (FD_ISSET(i, fds)) {
833  xprt = __svc_xports[i];
834  if (xprt == NULL || xprt->xp_ops == NULL ||
835  xprt->xp_ops->xp_recv != svc_vc_recv)
836  continue;
837  cd = (struct cf_conn *)xprt->xp_p1;
838  if (!cleanblock && !cd->nonblock)
839  continue;
840  if (timeout == 0) {
841  timersub(&tv, &cd->last_recv_time, &tdiff);
842  if (timercmp(&tdiff, &tmax, >)) {
843  tmax = tdiff;
844  least_active = xprt;
845  }
846  continue;
847  }
848  if (tv.tv_sec - cd->last_recv_time.tv_sec > timeout) {
850  __svc_vc_dodestroy(xprt);
851  ncleaned++;
852  }
853  }
854  }
855  if (timeout == 0 && least_active != NULL) {
856  __xprt_unregister_unlocked(least_active);
857  __svc_vc_dodestroy(least_active);
858  ncleaned++;
859  }
861  return ncleaned > 0 ? TRUE : FALSE;
862 }
#define TRUE
Definition: types.h:120
#define rwlock_wrlock(l)
Definition: reentrant.h:140
SVCXPRT ** __svc_xports
Definition: rpc_com.h:96
static struct cd_image cd
Definition: cdmake.c:182
static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *)
Definition: svc_vc.c:647
Definition: dhcpd.h:245
void __xprt_unregister_unlocked(SVCXPRT *)
Definition: svc.c:134
#define timersub(tvp1, tvp2)
Definition: time.h:116
#define gettimeofday(tv, tz)
Definition: adns_win32.h:159
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
Definition: glfuncs.h:248
#define FD_ISSET(fd, set)
Definition: winsock.h:100
#define rwlock_unlock(l)
Definition: reentrant.h:142
smooth NULL
Definition: ftsmooth.c:416
const struct __rpc_svcxprt::xp_ops * xp_ops
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
if(!(yy_init))
Definition: macro.lex.yy.c:714
Definition: svc_vc.c:94
void * xp_p1
Definition: svc.h:123
int svc_maxfd
static void __svc_vc_dodestroy(SVCXPRT *)
Definition: svc_vc.c:407
#define timercmp(tvp, uvp, cmp)
Definition: rdesktop.h:184

Referenced by rendezvous_request(), and svc_run().

◆ __xdrrec_getrec()

bool_t __xdrrec_getrec ( XDR ,
enum xprt_stat ,
bool_t   
)

Definition at line 581 of file xdr_rec.c.

585 {
586  RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
587  int n;
588  u_int fraglen;
589 
590  if (!rstrm->in_haveheader) {
591  n = rstrm->readit(rstrm->tcp_handle, rstrm->in_hdrp,
592  (int)sizeof (rstrm->in_header) - rstrm->in_hdrlen);
593  if (n == 0) {
594  *statp = expectdata ? XPRT_DIED : XPRT_IDLE;
595  return FALSE;
596  }
597  if (n < 0) {
598  *statp = XPRT_DIED;
599  return FALSE;
600  }
601  rstrm->in_hdrp += n;
602  rstrm->in_hdrlen += n;
603  if (rstrm->in_hdrlen < sizeof (rstrm->in_header)) {
604  *statp = XPRT_MOREREQS;
605  return FALSE;
606  }
607  rstrm->in_header = ntohl(rstrm->in_header);
608  fraglen = (int)(rstrm->in_header & ~LAST_FRAG);
609  if (fraglen == 0 || fraglen > rstrm->in_maxrec ||
610  (rstrm->in_reclen + fraglen) > rstrm->in_maxrec) {
611  *statp = XPRT_DIED;
612  return FALSE;
613  }
614  rstrm->fbtbc = rstrm->in_header & (~LAST_FRAG);
615  rstrm->in_reclen += fraglen;
616  if (rstrm->in_reclen > rstrm->recvsize)
617  realloc_stream(rstrm, rstrm->in_reclen);
618  if (rstrm->in_header & LAST_FRAG) {
619  rstrm->in_header &= ~LAST_FRAG;
620  rstrm->last_frag = TRUE;
621  }
622  }
623 
624  do {
625  n = rstrm->readit(rstrm->tcp_handle,
626  rstrm->in_base + rstrm->in_received,
627  (rstrm->in_reclen - rstrm->in_received));
628 
629  /* this case is needed for non-block as socket returns TIMEDOUT and -1
630  * -2 is an error case and covered by the next if() statement */
631  if (n == -1) continue;
632 
633  if (n < 0) {
634  *statp = XPRT_DIED;
635  return FALSE;
636  }
637 
638  if (n == 0) {
639  *statp = expectdata ? XPRT_DIED : XPRT_IDLE;
640  return FALSE;
641  }
642 
643  rstrm->in_received += n;
644  if (rstrm->in_received == rstrm->in_reclen) {
645  rstrm->in_haveheader = FALSE;
646  rstrm->in_hdrp = (char *)(void *)&rstrm->in_header;
647  rstrm->in_hdrlen = 0;
648  if (rstrm->last_frag) {
649  rstrm->in_boundry = rstrm->in_base + rstrm->in_reclen;
650  rstrm->in_finger = rstrm->in_base;
651  rstrm->in_reclen = rstrm->in_received = 0;
652  *statp = XPRT_MOREREQS;
653  return TRUE;
654  }
655  }
656  } while (1);
657 
658  *statp = XPRT_MOREREQS;
659  return FALSE;
660 }
#define TRUE
Definition: types.h:120
char * in_boundry
Definition: xdr_rec.c:144
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
char * in_base
Definition: xdr_rec.c:142
XDR xdrs
Definition: svc_vc.c:97
char * tcp_handle
Definition: xdr_rec.c:127
Definition: svc.h:82
GLdouble n
Definition: glext.h:7729
Definition: svc.h:84
int(* readit)(void *, void *, int)
Definition: xdr_rec.c:140
#define LAST_FRAG
Definition: xdr_rec.c:124
bool_t in_haveheader
Definition: xdr_rec.c:151
u_int in_maxrec
Definition: xdr_rec.c:157
char * in_hdrp
Definition: xdr_rec.c:153
bool_t last_frag
Definition: xdr_rec.c:146
u_int in_received
Definition: xdr_rec.c:156
u_int fbtbc
Definition: xdr_rec.c:145
static bool_t realloc_stream(RECSTREAM *, u_int)
Definition: xdr_rec.c:826
u_int in_reclen
Definition: xdr_rec.c:155
char * in_finger
Definition: xdr_rec.c:143
void * x_private
Definition: xdr.h:125
UINT32 u_int
Definition: types.h:82
u_int recvsize
Definition: xdr_rec.c:148
u_int in_hdrlen
Definition: xdr_rec.c:154
u_int32_t in_header
Definition: xdr_rec.c:152
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define ntohl(x)
Definition: module.h:203

Referenced by svc_vc_recv(), and xdrrec_skiprecord().

◆ __xdrrec_setblock()

bool_t __xdrrec_setblock ( XDR )

Definition at line 677 of file xdr_rec.c.

679 {
680  RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
681 
682  rstrm->nonblock = FALSE;
683  return TRUE;
684 }
#define TRUE
Definition: types.h:120
XDR xdrs
Definition: svc_vc.c:97
bool_t nonblock
Definition: xdr_rec.c:150
void * x_private
Definition: xdr.h:125

Referenced by clnt_cb_thread().

◆ __xdrrec_setnonblock()

bool_t __xdrrec_setnonblock ( XDR ,
int   
)

Definition at line 663 of file xdr_rec.c.

666 {
667  RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
668 
669  rstrm->nonblock = TRUE;
670  if (maxrec == 0)
671  maxrec = rstrm->recvsize;
672  rstrm->in_maxrec = maxrec;
673  return TRUE;
674 }
#define TRUE
Definition: types.h:120
XDR xdrs
Definition: svc_vc.c:97
u_int in_maxrec
Definition: xdr_rec.c:157
bool_t nonblock
Definition: xdr_rec.c:150
void * x_private
Definition: xdr.h:125
int maxrec
Definition: svc_vc.c:101
u_int recvsize
Definition: xdr_rec.c:148

Referenced by clnt_cb_thread(), and rendezvous_request().

◆ __xprt_set_raddr()

void __xprt_set_raddr ( SVCXPRT ,
const struct sockaddr_storage  
)

Definition at line 111 of file svc_vc.c.

112 {
113  switch (ss->ss_family) {
114  case AF_INET6:
115  memcpy(&xprt->xp_raddr, ss, sizeof(struct sockaddr_in6));
116  xprt->xp_addrlen = sizeof (struct sockaddr_in6);
117  break;
118  case AF_INET:
119  memcpy(&xprt->xp_raddr, ss, sizeof(struct sockaddr_in));
120  xprt->xp_addrlen = sizeof (struct sockaddr_in);
121  break;
122  default:
123  xprt->xp_raddr.sin6_family = AF_UNSPEC;
124  xprt->xp_addrlen = sizeof (struct sockaddr);
125  break;
126  }
127 }
#define AF_INET6
Definition: winsock.h:369
#define AF_UNSPEC
Definition: winsock.h:344
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define AF_INET
Definition: tcpip.h:117
#define ss
Definition: i386-dis.c:432

Referenced by rendezvous_request(), svc_dg_recv(), and svc_fd_create().

◆ __xprt_unregister_unlocked()

void __xprt_unregister_unlocked ( SVCXPRT )

Definition at line 134 of file svc.c.

135 {
136  __xprt_do_unregister (xprt, FALSE);
137 }
static void __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
Definition: svc.c:143

Referenced by __svc_clean_idle().

◆ _get_next_token()

char* _get_next_token ( char ,
int   
)

Definition at line 228 of file getnetpath.c.

231 {
232  char *cp; /* char pointer */
233  char *np; /* netpath pointer */
234  char *ep; /* escape pointer */
235 
236  if ((cp = strchr(npp, token)) == NULL) {
237  return (NULL);
238  }
239  /*
240  * did find a token, but it might be escaped.
241  */
242  if ((cp > npp) && (cp[-1] == '\\')) {
243  /* if slash was also escaped, carry on, otherwise find next token */
244  if ((cp > npp + 1) && (cp[-2] != '\\')) {
245  /* shift r-o-s onto the escaped token */
246  strcpy(&cp[-1], cp); /* XXX: overlapping string copy */
247  /*
248  * Do a recursive call.
249  * We don't know how many escaped tokens there might be.
250  */
251  return (_get_next_token(cp, token));
252  }
253  }
254 
255  *cp++ = '\0'; /* null-terminate token */
256  /* get rid of any backslash escapes */
257  ep = npp;
258  while ((np = strchr(ep, '\\')) != 0) {
259  if (np[1] == '\\')
260  np++;
261  strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */
262  }
263  return (cp); /* return ptr to r-o-s */
264 }
char * _get_next_token(char *, int)
Definition: getnetpath.c:228
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 token
Definition: glfuncs.h:210
smooth NULL
Definition: ftsmooth.c:416
char * strchr(const char *String, int ch)
Definition: utclib.c:501
POINT cp
Definition: magnifier.c:59
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

◆ rpc_nullproc()

void* rpc_nullproc ( CLIENT )

Definition at line 447 of file rpc_generic.c.

449 {
450  struct timeval TIMEOUT = {25, 0};
451 
452  if (clnt_call(clnt, NULLPROC, (xdrproc_t) xdr_void, NULL,
454  return (NULL);
455  }
456  return ((void *) clnt);
457 }
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
smooth NULL
Definition: ftsmooth.c:416
#define TIMEOUT
Definition: ntpclient.c:12
#define NULLPROC
Definition: clnt.h:294
bool_t xdr_void(void)
Definition: xdr.c:92
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:202

Variable Documentation

◆ __svc_maxrec

int __svc_maxrec

Definition at line 97 of file rpc_com.h.

Referenced by rpc_control(), and svc_vc_create().

◆ __svc_xports

SVCXPRT** __svc_xports

Definition at line 96 of file rpc_com.h.

Referenced by __svc_clean_idle(), __xprt_do_unregister(), svc_getreq_common(), and xprt_register().