#include <wintirpc.h>
#include <reentrant.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/svc_dg.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rpc_com.h"
Go to the source code of this file.
|
#define | su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) |
|
#define | rpc_buffer(xprt) ((xprt)->xp_p1) |
|
#define | MAX(a, b) (((a) > (b)) ? (a) : (b)) |
|
#define | SPARSENESS 4 /* 75% sparse */ |
|
#define | ALLOC(type, size) (type *) mem_alloc((sizeof (type) * (size))) |
|
#define | MEMZERO(addr, type, size) (void) memset((void *) (addr), 0, sizeof (type) * (int) (size)) |
|
#define | FREE(addr, type, size) mem_free((addr), (sizeof (type) * (size))) |
|
#define | CACHE_LOC(transp, xid) |
|
|
static void | svc_dg_ops (SVCXPRT *) |
|
static enum xprt_stat | svc_dg_stat (SVCXPRT *) |
|
static bool_t | svc_dg_recv (SVCXPRT *, struct rpc_msg *) |
|
static bool_t | svc_dg_reply (SVCXPRT *, struct rpc_msg *) |
|
static bool_t | svc_dg_getargs (SVCXPRT *, xdrproc_t, void *) |
|
static bool_t | svc_dg_freeargs (SVCXPRT *, xdrproc_t, void *) |
|
static void | svc_dg_destroy (SVCXPRT *) |
|
static bool_t | svc_dg_control (SVCXPRT *, const u_int, void *) |
|
static int | cache_get (SVCXPRT *, struct rpc_msg *, char **, size_t *) |
|
static void | cache_set (SVCXPRT *, size_t) |
|
int | svc_dg_enablecache (SVCXPRT *, u_int) |
|
SVCXPRT * | svc_dg_create (int fd, u_int sendsize, u_int recvsize) |
|
◆ ALLOC
◆ CACHE_LOC
◆ FREE
◆ MAX
◆ MEMZERO
◆ rpc_buffer
#define rpc_buffer |
( |
|
xprt | ) |
((xprt)->xp_p1) |
◆ SPARSENESS
#define SPARSENESS 4 /* 75% sparse */ |
◆ su_data
◆ cache_ptr
◆ cache_get()
Definition at line 533 of file svc_dg.c.
538{
543#ifdef RPC_CACHE_DEBUG
545 char *uaddr;
546#endif
547
558#ifdef RPC_CACHE_DEBUG
563 "cache entry found for xid=%x prog=%d vers=%d proc=%d for rmtaddr=%s\n",
565 msg->rm_call.cb_vers,
566 msg->rm_call.cb_proc, uaddr);
568 }
569#endif
573 return (1);
574 }
575 }
576
577
578
579
584 return (0);
585}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void freenetconfigent(struct netconfig *netconfigp)
struct netconfig * getnetconfigent(char *netid) const
char * taddr2uaddr(const struct netconfig *nconf, const struct netbuf *nbuf)
#define CACHE_LOC(transp, xid)
Referenced by svc_dg_recv().
◆ cache_set()
Definition at line 443 of file svc_dg.c.
446{
452 char *newbuf;
453#ifdef RPC_CACHE_DEBUG
455 char *uaddr;
456#endif
457
459
460
461
462
464 if (victim !=
NULL) {
467 *vicp !=
NULL && *vicp != victim;
468 vicp = &(*vicp)->cache_next)
469 ;
471
473 return;
474 }
477 } else {
479 if (victim ==
NULL) {
480
482 return;
483 }
485 if (newbuf ==
NULL) {
486
489 return;
490 }
491 }
492
493
494
495
496#ifdef RPC_CACHE_DEBUG
501 "cache set for xid= %x prog=%d vers=%d proc=%d for rmtaddr=%s\n",
505 }
506#endif
526}
#define memcpy(s1, s2, n)
#define FREE(addr, type, size)
#define ALLOC(type, size)
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Referenced by svc_dg_reply().
◆ svc_dg_control()
◆ svc_dg_create()
Definition at line 95 of file svc_dg.c.
99{
105
107
109 }
110
111
112
115 if ((sendsize == 0) || (recvsize == 0)) {
116
118 }
119
122 goto freedata;
124
127 goto freedata;
128 su->
su_iosz = ((
MAX(sendsize, recvsize) + 3) / 4) * 4;
130 goto freedata;
139
142 goto freedata;
144
146 return (xprt);
147freedata:
148
149 if (xprt) {
150 if (su)
153 }
155}
#define mem_free(ptr, bsize)
u_int __rpc_get_t_size(int af, int proto, int size)
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
struct netbuf * __rpc_set_netbuf(struct netbuf *, const void *, size_t)
struct opaque_auth xp_verf
char su_verfbody[MAX_AUTH_BYTES]
void xprt_register(SVCXPRT *xprt)
static void svc_dg_ops(SVCXPRT *)
Referenced by svc_tli_create().
◆ svc_dg_destroy()
Definition at line 253 of file svc_dg.c.
255{
257
259 if (xprt->
xp_fd != -1)
271}
void xprt_unregister(SVCXPRT *xprt)
#define XDR_DESTROY(xdrs)
Referenced by svc_dg_ops().
◆ svc_dg_enablecache()
Definition at line 386 of file svc_dg.c.
389{
392
395
397 return (0);
398 }
401
403 return (0);
404 }
409
412 return (0);
413 }
417
421 return (0);
422 }
426 return (1);
427}
#define MEMZERO(addr, type, size)
◆ svc_dg_freeargs()
Definition at line 241 of file svc_dg.c.
245{
247
249 return (*xdr_args)(xdrs, args_ptr);
250}
Referenced by svc_dg_ops().
◆ svc_dg_getargs()
◆ svc_dg_ops()
Definition at line 284 of file svc_dg.c.
286{
287 static struct xp_ops ops;
288 static struct xp_ops2 ops2;
290
291
292
294 if (ops.xp_recv ==
NULL) {
302 }
306}
const struct __rpc_svcxprt::xp_ops2 * xp_ops2
const struct __rpc_svcxprt::xp_ops * xp_ops
static bool_t svc_dg_recv(SVCXPRT *, struct rpc_msg *)
static bool_t svc_dg_freeargs(SVCXPRT *, xdrproc_t, void *)
static bool_t svc_dg_control(SVCXPRT *, const u_int, void *)
static bool_t svc_dg_reply(SVCXPRT *, struct rpc_msg *)
static void svc_dg_destroy(SVCXPRT *)
static bool_t svc_dg_getargs(SVCXPRT *, xdrproc_t, void *)
static enum xprt_stat svc_dg_stat(SVCXPRT *)
Referenced by svc_dg_create().
◆ svc_dg_recv()
Definition at line 166 of file svc_dg.c.
169{
172 char *reply;
175 size_t replylen;
177
178again:
183 goto again;
187
193 }
200 }
201 }
203}
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg)
void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *)
static int cache_get(SVCXPRT *, struct rpc_msg *, char **, size_t *)
#define XDR_SETPOS(xdrs, pos)
Referenced by svc_dg_ops().
◆ svc_dg_reply()
Definition at line 206 of file svc_dg.c.
209{
213 size_t slen;
214
226 }
227 }
229}
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
static void cache_set(SVCXPRT *, size_t)
Referenced by svc_dg_ops().
◆ svc_dg_stat()
◆ __no_mem_str
◆ alloc_err
◆ cache_enable_str
const char cache_enable_str[] = "svc_enablecache: %s %s" |
|
static |
◆ cache_set_err1
const char cache_set_err1[] = "victim not found" |
|
static |
◆ cache_set_err2
◆ cache_set_err3
const char cache_set_err3[] = "could not allocate new rpc buffer" |
|
static |
◆ cache_set_str
◆ dupreq_lock
◆ enable_err
const char enable_err[] = "cache already enabled" |
|
static |
◆ svc_dg_err1
const char svc_dg_err1[] = "could not get transport information" |
|
static |
◆ svc_dg_err2
const char svc_dg_err2[] = " transport does not support data transfer" |
|
static |
◆ svc_dg_str
const char svc_dg_str[] = "svc_dg_create: %s" |
|
static |