94#define MCALL_MSG_SIZE 24
129static int read_vc(
void *,
void *,
int);
165#define release_fd_lock(fd, mask) { \
166 mutex_lock(&clnt_fd_lock); \
167 vc_fd_locks[fd] = 0; \
168 mutex_unlock(&clnt_fd_lock); \
169 thr_sigsetmask(SIG_SETMASK, &(mask), (sigset_t *) NULL); \
170 cond_signal(&vc_cv[fd]); \
174#define release_fd_lock(fd, mask) { \
175 mutex_lock(&clnt_fd_lock); \
176 vc_fd_locks[WINSOCK_HANDLE_HASH(fd)] = 0; \
177 mutex_unlock(&clnt_fd_lock); \
179 cond_broadcast(&vc_cv[WINSOCK_HANDLE_HASH(fd)]); \
183#define acquire_fd_lock(fd) { \
184 mutex_lock(&clnt_fd_lock); \
185 while (vc_fd_locks[WINSOCK_HANDLE_HASH(fd)] && \
186 vc_fd_locks[WINSOCK_HANDLE_HASH(fd)] != GetCurrentThreadId()) \
187 cond_wait(&vc_cv[WINSOCK_HANDLE_HASH(fd)], &clnt_fd_lock); \
188 vc_fd_locks[WINSOCK_HANDLE_HASH(fd)] = GetCurrentThreadId(); \
189 mutex_unlock(&clnt_fd_lock); \
198#define CALLBACK_TIMEOUT 5000
199#define RQCRED_SIZE 400
206 long saved_timeout_sec = ct->
ct_wait.tv_sec;
207 long saved_timeout_usec = ct->
ct_wait.tv_usec;
235 saved_timeout_sec = ct->
ct_wait.tv_sec;
236 saved_timeout_usec = ct->
ct_wait.tv_usec;
239 goto process_rpc_call;
249 goto process_rpc_call;
253 goto skip_setlastfrag;
256 goto skip_setlastfrag;
261 ct->
reply_msg.rm_call.cb_cred.oa_base = cred_area;
267 fprintf(
stdout,
"%04x: callbody: rpcvers %d cb_prog %d cb_vers %d cb_proc %d\n",
289 reply_msg.acpted_rply.ar_stat =
status;
290 reply_msg.acpted_rply.ar_results.where =
NULL;
305 ct->
ct_wait.tv_sec = saved_timeout_sec;
306 ct->
ct_wait.tv_usec = saved_timeout_usec;
326 const struct netbuf *raddr;
331 int (*cb_xdr)(
void *,
void *);
332 int (*cb_fn)(
void *,
void *,
void **);
364 sigfillset(&newmask);
371 int cv_allocsz, fd_allocsz;
374 fd_allocsz = dtbsize *
sizeof (
int);
384 cv_allocsz = dtbsize *
sizeof (
cond_t);
395 for (
i = 0;
i < dtbsize;
i++)
451 call_msg.rm_call.cb_vers = (
u_int32_t)vers;
479 if (cb_xdr && cb_fn && cb_args) {
523 static int refreshes = 2;
525 time_t start_send, time_now;
527 sigset_t
mask, newmask;
536 sigfillset(&newmask);
558 x_id =
ntohl(--(*msg_x_id));
609 if (time_now - start_send >=
timeout.tv_sec) {
654 if (time_now - start_send >=
timeout.tv_sec) {
673 &ct->
reply_msg.acpted_rply.ar_verf, seq)) {
741 sigfillset(&newmask);
750 dummy = (*xdr_res)(xdrs, res_ptr);
785 sigfillset(&newmask);
913 sigfillset(&newmask);
924 fprintf(
stdout,
"%04x: sending shutdown to callback thread %04x\n",
970 int milliseconds = ct->
ct_wait.tv_usec;
978 switch (
poll(&
fd, 1, milliseconds)) {
988 timeout.tv_usec = milliseconds * 1000;
1047 for (cnt =
len; cnt > 0; cnt -=
i,
buf +=
i) {
1057static struct clnt_ops *
1060 static struct clnt_ops ops;
1063 sigset_t
mask, newmask;
1067 sigfillset(&newmask);
1073 if (ops.cl_call ==
NULL) {
1094 return (
t->tv_sec <= -1 ||
t->tv_sec > 100000000 ||
1095 t->tv_usec <= -1 ||
t->tv_usec > 1000000);
ACPI_SIZE strlen(const char *String)
#define gettimeofday(tv, tz)
#define AUTH_WRAP(auth, xdrs, xfunc, xwhere)
#define AUTH_MARSHALL(auth, xdrs, seq)
#define AUTH_VALIDATE(auth, verfp, seq)
#define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere, seq)
#define AUTH_REFRESH(auth, msg)
#define CLGET_SERVER_ADDR
static unsigned int WINAPI clnt_cb_thread(void *args)
static bool_t clnt_vc_control(CLIENT *, u_int, void *)
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)
static void clnt_vc_geterr(CLIENT *, struct rpc_err *)
static struct clnt_ops * clnt_vc_ops(void)
static bool_t clnt_vc_freeres(CLIENT *, xdrproc_t, void *)
static const char clnt_read_vc_str[]
static const char clnt_vc_str[]
static int read_vc(void *, void *, int)
static const char clnt_vc_errstr[]
#define release_fd_lock(fd, mask)
static enum clnt_stat clnt_vc_call(CLIENT *, rpcproc_t, xdrproc_t, void *, xdrproc_t, void *, struct timeval)
static const char __no_mem_str[]
static void clnt_vc_abort(CLIENT *)
static bool_t time_not_ok(struct timeval *)
static int write_vc(void *, void *, int)
#define acquire_fd_lock(fd)
static void clnt_vc_destroy(CLIENT *)
#define mem_free(ptr, bsize)
#define INVALID_HANDLE_VALUE
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
GLenum GLuint GLenum GLsizei const GLchar * buf
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
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define memcpy(s1, s2, n)
#define thr_sigsetmask(f, n, o)
#define cond_wait_timed(c, m, t)
#define cond_init(c, a, p)
struct opaque_auth _null_auth
u_int __rpc_get_t_size(int af, int proto, int size)
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
bool_t xdr_getreplyunion(XDR *xdrs, struct rpc_msg *rmsg)
bool_t xdr_getcallbody(XDR *xdrs, struct rpc_msg *rmsg)
bool_t xdr_getxiddir(XDR *xdrs, struct rpc_msg *rmsg)
bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
void _seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
INT WSAAPI getpeername(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
bool_t __xdrrec_setnonblock(XDR *, int)
bool_t __xdrrec_setblock(XDR *)
#define __RPC_GETXID(now)
int(* cb_fn)(void *, void *, void **)
int(* cb_xdr)(void *, void *)
struct __rpc_client::clnt_ops * cl_ops
gid_t cmcred_groups[CMGROUP_MAX]
bool_t use_stored_reply_msg
char ct_mcallc[MCALL_MSG_SIZE]
enum msg_type rm_direction
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
BOOL WINAPI SwitchToThread(void)
int PASCAL FAR WSAGetLastError(void)
#define WINSOCK_HANDLE_HASH(x)
#define XDR_PUTINT32(xdrs, int32p)
#define XDR_PUTBYTES(xdrs, addr, len)
#define XDR_DESTROY(xdrs)
bool_t(* xdrproc_t)(XDR *,...)
#define BYTES_PER_XDR_UNIT
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
bool_t xdrrec_endofrecord(XDR *xdrs, bool_t sendnow)
void xdrrec_setlastfrag(XDR *xdrs)
void xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, int *void *, int *readit, int *writeit)
bool_t xdrrec_skiprecord(XDR *xdrs)