ReactOS 0.4.16-dev-338-g34e76ad
svc.c File Reference
#include <wintirpc.h>
#include <reentrant.h>
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
Include dependency graph for svc.c:

Go to the source code of this file.

Classes

struct  svc_callout
 

Macros

#define RQCRED_SIZE   400 /* this size is excessive */
 
#define SVC_VERSQUIET   0x0001 /* keep quiet about vers mismatch */
 
#define version_keepquiet(xp)   ((u_long)(xp)->xp_p3 & SVC_VERSQUIET)
 
#define max(a, b)   (a > b ? a : b)
 

Functions

static struct svc_calloutsvc_find (rpcprog_t, rpcvers_t, struct svc_callout **, char *)
 
static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock)
 
void xprt_register (SVCXPRT *xprt)
 
void xprt_unregister (SVCXPRT *xprt)
 
void __xprt_unregister_unlocked (SVCXPRT *xprt)
 
bool_t svc_reg (SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers, void *dispatch, const struct netconfig *nconf)
 
void svc_unreg (rpcprog_t prog, const rpcvers_t vers) const
 
bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t xdr_results, void *xdr_location)
 
void svcerr_noproc (SVCXPRT *xprt)
 
void svcerr_decode (SVCXPRT *xprt)
 
void svcerr_systemerr (SVCXPRT *xprt)
 
void svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
 
void svcerr_weakauth (SVCXPRT *xprt)
 
void svcerr_noprog (SVCXPRT *xprt)
 
void svcerr_progvers (SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers)
 
void svc_getreq (int rdfds)
 
void svc_getreqset (fd_set *readfds)
 
void svc_getreq_common (SOCKET fd)
 
void svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 
bool_t rpc_control (int what, void *arg)
 

Variables

static struct svc_calloutsvc_head
 
rwlock_t svc_lock
 
rwlock_t svc_fd_lock
 

Macro Definition Documentation

◆ max

#define max (   a,
  b 
)    (a > b ? a : b)

Definition at line 63 of file svc.c.

◆ RQCRED_SIZE

#define RQCRED_SIZE   400 /* this size is excessive */

Definition at line 57 of file svc.c.

◆ SVC_VERSQUIET

#define SVC_VERSQUIET   0x0001 /* keep quiet about vers mismatch */

Definition at line 59 of file svc.c.

◆ version_keepquiet

#define version_keepquiet (   xp)    ((u_long)(xp)->xp_p3 & SVC_VERSQUIET)

Definition at line 60 of file svc.c.

Function Documentation

◆ __xprt_do_unregister()

static void __xprt_do_unregister ( SVCXPRT xprt,
bool_t  dolock 
)
static

Definition at line 143 of file svc.c.

146{
147 SOCKET sock;
148
149 assert (xprt != NULL);
150
151 sock = xprt->xp_fd;
152
153#ifndef _WIN32
154 if (dolock)
156 if ((sock < FD_SETSIZE) && (__svc_xports[sock] == xprt)) {
159 if (sock >= svc_maxfd) {
160 for (svc_maxfd--; svc_maxfd >= 0; svc_maxfd--)
162 break;
163 }
164 }
165 if (dolock)
167#else
168 fprintf(stderr, "%s: Yikes! Figure out __svc_xports[] issue!!\n", __FUNCTION__);
169#endif
170}
#define NULL
Definition: types.h:112
#define assert(x)
Definition: debug.h:53
#define __FUNCTION__
Definition: types.h:116
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define rwlock_wrlock(l)
Definition: reentrant.h:140
#define rwlock_unlock(l)
Definition: reentrant.h:142
int svc_maxfd
fd_set svc_fdset
SVCXPRT ** __svc_xports
SOCKET xp_fd
Definition: svc.h:91
Definition: tcpcore.h:1455
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
UINT_PTR SOCKET
Definition: winsock.h:47
#define FD_SETSIZE
Definition: winsock.h:50
#define FD_CLR(fd, set)
Definition: winsock.h:74

Referenced by __xprt_unregister_unlocked(), and xprt_unregister().

◆ __xprt_unregister_unlocked()

void __xprt_unregister_unlocked ( SVCXPRT xprt)

Definition at line 134 of file svc.c.

135{
137}
#define FALSE
Definition: types.h:117
static void __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
Definition: svc.c:143

Referenced by __svc_clean_idle().

◆ rpc_control()

bool_t rpc_control ( int  what,
void arg 
)

Definition at line 784 of file svc.c.

785{
786 int val;
787
788 switch (what)
789 {
791 val = *(int *) arg;
792 if (val <= 0)
793 return FALSE;
795 return TRUE;
797 *(int *) arg = __svc_maxrec;
798 return TRUE;
799 default:
800 break;
801 }
802 return FALSE;
803}
#define RPC_SVC_CONNMAXREC_SET
Definition: svc.h:78
#define RPC_SVC_CONNMAXREC_GET
Definition: svc.h:79
#define TRUE
Definition: types.h:120
GLuint GLfloat * val
Definition: glext.h:7180
int __svc_maxrec

◆ svc_find()

static struct svc_callout * svc_find ( rpcprog_t  prog,
rpcvers_t  vers,
struct svc_callout **  prev,
char netid 
)
static

Definition at line 370 of file svc.c.

375{
376 struct svc_callout *s, *p;
377
378 assert (prev != NULL);
379
380 p = NULL;
381 for (s = svc_head; s != NULL; s = s->sc_next)
382 {
383 if (((s->sc_prog == prog) && (s->sc_vers == vers)) &&
384 ((netid == NULL) || (s->sc_netid == NULL) ||
385 (strcmp (netid, s->sc_netid) == 0)))
386 break;
387 p = s;
388 }
389 *prev = p;
390 return (s);
391}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLdouble s
Definition: gl.h:2039
GLfloat GLfloat p
Definition: glext.h:8902
char * prog
Definition: isohybrid.c:47
static struct svc_callout * svc_head

Referenced by svc_reg(), and svc_unreg().

◆ svc_getreq()

void svc_getreq ( int  rdfds)

Definition at line 604 of file svc.c.

606{
607 fd_set readfds;
608
609 FD_ZERO (&readfds);
610 //XXX Windows!! readfds.fds_bits[0] = rdfds;
611 svc_getreqset (&readfds);
612}
Definition: winsock.h:66
void svc_getreqset(fd_set *readfds)
Definition: svc.c:615
#define FD_ZERO(set)
Definition: winsock.h:96

◆ svc_getreq_common()

void svc_getreq_common ( SOCKET  fd)

Definition at line 641 of file svc.c.

642{
643 SVCXPRT *xprt;
644 struct svc_req r;
645 struct rpc_msg msg;
646 int prog_found;
647 rpcvers_t low_vers;
648 rpcvers_t high_vers;
649 enum xprt_stat stat;
650 char cred_area[2 * MAX_AUTH_BYTES + RQCRED_SIZE];
651
652 msg.rm_call.cb_cred.oa_base = cred_area;
653 msg.rm_call.cb_verf.oa_base = &(cred_area[MAX_AUTH_BYTES]);
654 r.rq_clntcred = &(cred_area[2 * MAX_AUTH_BYTES]);
655
657 xprt = __svc_xports[fd];
659 if (xprt == NULL)
660 /* But do we control sock? */
661 return;
662 /* now receive msgs from xprtprt (support batch calls) */
663 do
664 {
665 if (SVC_RECV (xprt, &msg))
666 {
667
668 /* now find the exported program and call it */
669 struct svc_callout *s;
670 enum auth_stat why;
671
672 r.rq_xprt = xprt;
673 r.rq_prog = msg.rm_call.cb_prog;
674 r.rq_vers = msg.rm_call.cb_vers;
675 r.rq_proc = msg.rm_call.cb_proc;
676 r.rq_cred = msg.rm_call.cb_cred;
677 /* first authenticate the message */
678 if ((why = _authenticate (&r, &msg)) != AUTH_OK)
679 {
680 svcerr_auth (xprt, why);
681 goto call_done;
682 }
683 /* now match message with a registered service */
684 prog_found = FALSE;
685 low_vers = (rpcvers_t) - 1L;
686 high_vers = (rpcvers_t) 0L;
687 for (s = svc_head; s != NULL; s = s->sc_next)
688 {
689 if (s->sc_prog == r.rq_prog)
690 {
691 if (s->sc_vers == r.rq_vers)
692 {
693 (*s->sc_dispatch) (&r, xprt);
694 goto call_done;
695 } /* found correct version */
696 prog_found = TRUE;
697 if (s->sc_vers < low_vers)
698 low_vers = s->sc_vers;
699 if (s->sc_vers > high_vers)
700 high_vers = s->sc_vers;
701 } /* found correct program */
702 }
703 /*
704 * if we got here, the program or version
705 * is not served ...
706 */
707 if (prog_found)
708 svcerr_progvers (xprt, low_vers, high_vers);
709 else
710 svcerr_noprog (xprt);
711 /* Fall through to ... */
712 }
713 /*
714 * Check if the xprt has been disconnected in a
715 * recursive call in the service dispatch routine.
716 * If so, then break.
717 */
719
720 if (xprt != __svc_xports[fd])
721 {
723 break;
724 }
726 call_done:
727 if ((stat = SVC_STAT (xprt)) == XPRT_DIED)
728 {
729 SVC_DESTROY (xprt);
730 break;
731 }
732 else if ((xprt->xp_auth != NULL)
733#ifdef HAVE_LIBGSSAPI
734 && (xprt->xp_auth->svc_ah_ops != &svc_auth_gss_ops)
735#endif
736 ) {
737 xprt->xp_auth = NULL;
738 }
739 }
740 while (stat == XPRT_MOREREQS);
741}
#define stat
Definition: acwin.h:99
auth_stat
Definition: auth.h:144
@ AUTH_OK
Definition: auth.h:145
#define MAX_AUTH_BYTES
Definition: auth.h:77
#define msg(x)
Definition: auth_time.c:54
#define SVC_STAT(xprt)
Definition: svc.h:164
#define SVC_RECV(xprt, msg)
Definition: svc.h:159
xprt_stat
Definition: svc.h:81
@ XPRT_DIED
Definition: svc.h:82
@ XPRT_MOREREQS
Definition: svc.h:83
#define SVC_DESTROY(xprt)
Definition: svc.h:184
u_int32_t rpcvers_t
Definition: types.h:105
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define L(x)
Definition: ntvdm.h:50
#define rwlock_rdlock(l)
Definition: reentrant.h:139
static int fd
Definition: io.c:51
SVCAUTH * xp_auth
Definition: svc.h:122
struct __svcauth::svc_auth_ops * svc_ah_ops
Definition: stat.h:55
Definition: svc.h:132
void svcerr_progvers(SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers)
Definition: svc.c:567
void svcerr_noprog(SVCXPRT *xprt)
Definition: svc.c:549
void svcerr_auth(SVCXPRT *xprt, enum auth_stat why)
Definition: svc.c:517
#define RQCRED_SIZE
Definition: svc.c:57
enum auth_stat _authenticate(struct svc_req *rqst, struct rpc_msg *msg)
Definition: svc_auth.c:86
struct svc_auth_ops svc_auth_gss_ops
Definition: svc_auth_gss.c:60

Referenced by svc_getreq_poll(), and svc_getreqset().

◆ svc_getreq_poll()

void svc_getreq_poll ( struct pollfd pfdp,
int  pollretval 
)

Definition at line 745 of file svc.c.

748{
749 int i;
750 int fds_found;
751
752 for (i = fds_found = 0; fds_found < pollretval; i++)
753 {
754 struct pollfd *p = &pfdp[i];
755
756 if (p->revents)
757 {
758 /* fd has input waiting */
759 fds_found++;
760 /*
761 * We assume that this function is only called
762 * via someone _select()ing from svc_fdset or
763 * _poll()ing from svc_pollset[]. Thus it's safe
764 * to handle the POLLNVAL event by simply turning
765 * the corresponding bit off in svc_fdset. The
766 * svc_pollset[] array is derived from svc_fdset
767 * and so will also be updated eventually.
768 *
769 * XXX Should we do an xprt_unregister() instead?
770 */
771 if (p->revents & POLLNVAL)
772 {
774 FD_CLR (p->fd, &svc_fdset);
776 }
777 else
778 svc_getreq_common (p->fd);
779 }
780 }
781}
#define POLLNVAL
Definition: linux.h:1858
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
Definition: linux.h:1867
void svc_getreq_common(SOCKET fd)
Definition: svc.c:641

◆ svc_getreqset()

void svc_getreqset ( fd_set readfds)

Definition at line 615 of file svc.c.

617{
618#ifndef _WIN32
619 int bit, fd;
620 fd_mask mask, *maskp;
621 int sock;
622
623 assert (readfds != NULL);
624
625 maskp = readfds->fds_bits;
626 for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS)
627 {
628 for (mask = *maskp++; (bit = ffs (mask)) != 0; mask ^= (1 << (bit - 1)))
629 {
630 /* sock has input waiting */
631 fd = sock + bit - 1;
633 }
634 }
635#else
636 fprintf(stderr, "%s: Yikes!\n", __FUNCTION__);
637#endif
638}
GLenum GLint GLuint mask
Definition: glext.h:6028
#define ffs
Definition: port.h:360

Referenced by svc_getreq(), and svc_run().

◆ svc_reg()

bool_t svc_reg ( SVCXPRT xprt,
const rpcprog_t  prog,
const rpcvers_t  vers,
void dispatch,
const struct netconfig nconf 
)

Definition at line 178 of file svc.c.

184{
186 struct svc_callout *prev;
187 struct svc_callout *s;
188 struct netconfig *tnconf;
189 char *netid = NULL;
190 int flag = 0;
191
192/* VARIABLES PROTECTED BY svc_lock: s, prev, svc_head */
193 if (xprt->xp_netid)
194 {
195 netid = strdup (xprt->xp_netid);
196 flag = 1;
197 }
198 else if (nconf && nconf->nc_netid)
199 {
200 netid = strdup (nconf->nc_netid);
201 flag = 1;
202 }
203 else if ((tnconf = __rpcgettp (xprt->xp_fd)) != NULL)
204 {
205 netid = strdup (tnconf->nc_netid);
206 flag = 1;
207 freenetconfigent (tnconf);
208 } /* must have been created with svc_raw_create */
209 if ((netid == NULL) && (flag == 1))
210 {
211 return (FALSE);
212 }
213
215 if ((s = svc_find (prog, vers, &prev, netid)) != NULL)
216 {
217 if (netid)
218 free (netid);
219 if (s->sc_dispatch == dispatch)
220 goto rpcb_it; /* he is registering another xptr */
222 return (FALSE);
223 }
224 s = mem_alloc (sizeof (struct svc_callout));
225 if (s == NULL)
226 {
227 if (netid)
228 free (netid);
230 return (FALSE);
231 }
232
233 s->sc_prog = prog;
234 s->sc_vers = vers;
235 s->sc_dispatch = dispatch;
236 s->sc_netid = netid;
237 s->sc_next = svc_head;
238 svc_head = s;
239
240 if ((xprt->xp_netid == NULL) && (flag == 1) && netid)
241 ((SVCXPRT *) xprt)->xp_netid = strdup (netid);
242
243rpcb_it:
245 /* now register the information with the local binder service */
246 if (nconf)
247 {
248 /*LINTED const castaway */
249 dummy = rpcb_set (prog, vers, (struct netconfig *) nconf,
250 &((SVCXPRT *) xprt)->xp_ltaddr);
251 return (dummy);
252 }
253 return (TRUE);
254}
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
#define free
Definition: debug_ros.c:5
#define mem_alloc(bsize)
Definition: types.h:123
int32_t bool_t
Definition: types.h:101
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
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 flag
Definition: glfuncs.h:52
bool_t rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, const struct netbuf *address)
Definition: rpcb_clnt.c:520
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
struct netconfig * __rpcgettp(SOCKET)
Definition: rpc_generic.c:464
char * xp_netid
Definition: svc.h:118
char * nc_netid
Definition: netconfig.h:16
rwlock_t svc_lock
Definition: mt_misc.c:19
static struct svc_callout * svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *)
Definition: svc.c:370

Referenced by rpc_reg(), svc_create(), and svc_tp_create().

◆ svc_sendreply()

bool_t svc_sendreply ( SVCXPRT xprt,
xdrproc_t  xdr_results,
void xdr_location 
)

Definition at line 399 of file svc.c.

403{
404 struct rpc_msg rply;
405
406 assert (xprt != NULL);
407
408 rply.rm_direction = REPLY;
409 rply.rm_reply.rp_stat = MSG_ACCEPTED;
410 rply.acpted_rply.ar_verf = xprt->xp_verf;
411 rply.acpted_rply.ar_stat = SUCCESS;
412 rply.acpted_rply.ar_results.where = xdr_location;
413 rply.acpted_rply.ar_results.proc = xdr_results;
414 return (SVC_REPLY (xprt, &rply));
415}
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
#define REPLY
Definition: port.c:108
#define SUCCESS
Definition: regproc.h:26
@ MSG_ACCEPTED
Definition: rpc_msg.h:83
struct opaque_auth xp_verf
Definition: svc.h:121

Referenced by _svcauth_gss(), and universal().

◆ svc_unreg()

void svc_unreg ( rpcprog_t  prog,
const rpcvers_t  vers 
) const

Definition at line 260 of file svc.c.

263{
264 struct svc_callout *prev;
265 struct svc_callout *s;
266
267 /* unregister the information anyway */
268 (void) rpcb_unset (prog, vers, NULL);
270 while ((s = svc_find (prog, vers, &prev, NULL)) != NULL)
271 {
272 if (prev == NULL)
273 {
274 svc_head = s->sc_next;
275 }
276 else
277 {
278 prev->sc_next = s->sc_next;
279 }
280 s->sc_next = NULL;
281 if (s->sc_netid)
282 mem_free (s->sc_netid, sizeof (s->sc_netid) + 1);
283 mem_free (s, sizeof (struct svc_callout));
284 }
286}
#define mem_free(ptr, bsize)
Definition: types.h:124
bool_t rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf)
Definition: rpcb_clnt.c:581
struct svc_callout * sc_next
Definition: svc.c:74
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

◆ svcerr_auth()

void svcerr_auth ( SVCXPRT xprt,
enum auth_stat  why 
)

Definition at line 517 of file svc.c.

520{
521 struct rpc_msg rply;
522
523 assert (xprt != NULL);
524
525 rply.rm_direction = REPLY;
526 rply.rm_reply.rp_stat = MSG_DENIED;
527 rply.rjcted_rply.rj_stat = AUTH_ERROR;
528 rply.rjcted_rply.rj_why = why;
529 SVC_REPLY (xprt, &rply);
530}
@ MSG_DENIED
Definition: rpc_msg.h:84
@ AUTH_ERROR
Definition: rpc_msg.h:98

Referenced by svc_getreq_common(), and svcerr_weakauth().

◆ svcerr_decode()

void svcerr_decode ( SVCXPRT xprt)

Definition at line 439 of file svc.c.

441{
442 struct rpc_msg rply;
443
444 assert (xprt != NULL);
445
446 rply.rm_direction = REPLY;
447 rply.rm_reply.rp_stat = MSG_ACCEPTED;
448 rply.acpted_rply.ar_verf = xprt->xp_verf;
449 rply.acpted_rply.ar_stat = GARBAGE_ARGS;
450 SVC_REPLY (xprt, &rply);
451}
@ GARBAGE_ARGS
Definition: rpc_msg.h:92

Referenced by universal().

◆ svcerr_noproc()

void svcerr_noproc ( SVCXPRT xprt)

Definition at line 421 of file svc.c.

423{
424 struct rpc_msg rply;
425
426 assert (xprt != NULL);
427
428 rply.rm_direction = REPLY;
429 rply.rm_reply.rp_stat = MSG_ACCEPTED;
430 rply.acpted_rply.ar_verf = xprt->xp_verf;
431 rply.acpted_rply.ar_stat = PROC_UNAVAIL;
432 SVC_REPLY (xprt, &rply);
433}
@ PROC_UNAVAIL
Definition: rpc_msg.h:91

◆ svcerr_noprog()

void svcerr_noprog ( SVCXPRT xprt)

Definition at line 549 of file svc.c.

551{
552 struct rpc_msg rply;
553
554 assert (xprt != NULL);
555
556 rply.rm_direction = REPLY;
557 rply.rm_reply.rp_stat = MSG_ACCEPTED;
558 rply.acpted_rply.ar_verf = xprt->xp_verf;
559 rply.acpted_rply.ar_stat = PROG_UNAVAIL;
560 SVC_REPLY (xprt, &rply);
561}
@ PROG_UNAVAIL
Definition: rpc_msg.h:89

Referenced by svc_getreq_common().

◆ svcerr_progvers()

void svcerr_progvers ( SVCXPRT xprt,
rpcvers_t  low_vers,
rpcvers_t  high_vers 
)

Definition at line 567 of file svc.c.

571{
572 struct rpc_msg rply;
573
574 assert (xprt != NULL);
575
576 rply.rm_direction = REPLY;
577 rply.rm_reply.rp_stat = MSG_ACCEPTED;
578 rply.acpted_rply.ar_verf = xprt->xp_verf;
579 rply.acpted_rply.ar_stat = PROG_MISMATCH;
580 rply.acpted_rply.ar_vers.low = (u_int32_t) low_vers;
581 rply.acpted_rply.ar_vers.high = (u_int32_t) high_vers;
582 SVC_REPLY (xprt, &rply);
583}
unsigned int u_int32_t
Definition: rosdhcp.h:35
@ PROG_MISMATCH
Definition: rpc_msg.h:90

Referenced by svc_getreq_common().

◆ svcerr_systemerr()

void svcerr_systemerr ( SVCXPRT xprt)

Definition at line 457 of file svc.c.

459{
460 struct rpc_msg rply;
461
462 assert (xprt != NULL);
463
464 rply.rm_direction = REPLY;
465 rply.rm_reply.rp_stat = MSG_ACCEPTED;
466 rply.acpted_rply.ar_verf = xprt->xp_verf;
467 rply.acpted_rply.ar_stat = SYSTEM_ERR;
468 SVC_REPLY (xprt, &rply);
469}
@ SYSTEM_ERR
Definition: rpc_msg.h:93

◆ svcerr_weakauth()

void svcerr_weakauth ( SVCXPRT xprt)

Definition at line 536 of file svc.c.

538{
539
540 assert (xprt != NULL);
541
543}
@ AUTH_TOOWEAK
Definition: auth.h:153

◆ xprt_register()

void xprt_register ( SVCXPRT xprt)

Definition at line 97 of file svc.c.

99{
100 SOCKET sock;
101
102 assert (xprt != NULL);
103
104 sock = xprt->xp_fd;
105
107 if (__svc_xports == NULL) {
108 __svc_xports = (SVCXPRT **) mem_alloc (FD_SETSIZE * sizeof (SVCXPRT *));
109 if (__svc_xports == NULL) {
110 // XXX Give an error indication?
111 return;
112 }
113 memset (__svc_xports, 0, FD_SETSIZE * sizeof (SVCXPRT *));
114 }
115#ifndef _WIN32
116 if (sock < FD_SETSIZE) {
117 __svc_xports[sock] = xprt;
120 }
121#else
122 fprintf(stderr, "%s: Yikes! Figure out __svc_xports[] issue!!\n", __FUNCTION__);
123#endif
125}
#define memset(x, y, z)
Definition: compat.h:39
#define max(a, b)
Definition: svc.c:63
#define FD_SET(fd, set)
Definition: winsock.h:89

Referenced by makefd_xprt(), svc_dg_create(), svc_raw_create(), and svc_vc_create().

◆ xprt_unregister()

void xprt_unregister ( SVCXPRT xprt)

Definition at line 128 of file svc.c.

129{
131}

Referenced by svc_dg_destroy(), and svc_vc_destroy().

Variable Documentation

◆ svc_fd_lock

rwlock_t svc_fd_lock
extern

Definition at line 22 of file mt_misc.c.

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

◆ svc_head

struct svc_callout * svc_head
static

◆ svc_lock

rwlock_t svc_lock
extern

Definition at line 19 of file mt_misc.c.

Referenced by svc_reg(), and svc_unreg().