ReactOS 0.4.15-dev-7788-g1ad9096
xdr.h File Reference
#include <stdio.h>
#include <rpc/types.h>
Include dependency graph for xdr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __rpc_xdr
 
struct  __rpc_xdr::xdr_ops
 
struct  xdr_discrim
 
struct  netobj
 

Macros

#define BYTES_PER_XDR_UNIT   (4)
 
#define RNDUP(x)
 
#define XDR_GETLONG(xdrs, longp)    (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
 
#define xdr_getlong(xdrs, longp)    (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
 
#define XDR_PUTLONG(xdrs, longp)    (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
 
#define xdr_putlong(xdrs, longp)    (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
 
#define XDR_GETINT32(xdrs, int32p)   xdr_getint32(xdrs, int32p)
 
#define XDR_PUTINT32(xdrs, int32p)   xdr_putint32(xdrs, int32p)
 
#define XDR_GETBYTES(xdrs, addr, len)    (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
 
#define xdr_getbytes(xdrs, addr, len)    (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
 
#define XDR_PUTBYTES(xdrs, addr, len)    (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
 
#define xdr_putbytes(xdrs, addr, len)    (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
 
#define XDR_GETPOS(xdrs)    (*(xdrs)->x_ops->x_getpostn)(xdrs)
 
#define xdr_getpos(xdrs)    (*(xdrs)->x_ops->x_getpostn)(xdrs)
 
#define XDR_SETPOS(xdrs, pos)    (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
 
#define xdr_setpos(xdrs, pos)    (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
 
#define XDR_INLINE(xdrs, len)    (*(xdrs)->x_ops->x_inline)(xdrs, len)
 
#define xdr_inline(xdrs, len)    (*(xdrs)->x_ops->x_inline)(xdrs, len)
 
#define XDR_DESTROY(xdrs)
 
#define xdr_destroy(xdrs)
 
#define XDR_CONTROL(xdrs, req, op)
 
#define xdr_control(xdrs, req, op)   XDR_CONTROL(xdrs, req, op)
 
#define xdr_rpcvers(xdrs, versp)   xdr_u_int32(xdrs, versp)
 
#define xdr_rpcprog(xdrs, progp)   xdr_u_int32(xdrs, progp)
 
#define xdr_rpcproc(xdrs, procp)   xdr_u_int32(xdrs, procp)
 
#define xdr_rpcprot(xdrs, protp)   xdr_u_int32(xdrs, protp)
 
#define xdr_rpcport(xdrs, portp)   xdr_u_int32(xdrs, portp)
 
#define NULL_xdrproc_t   ((xdrproc_t)0)
 
#define IXDR_GET_INT32(buf)   ((int32_t)ntohl((u_int32_t)*(buf)++))
 
#define IXDR_PUT_INT32(buf, v)   (*(buf)++ =(int32_t)htonl((u_int32_t)v))
 
#define IXDR_GET_U_INT32(buf)   ((u_int32_t)IXDR_GET_INT32(buf))
 
#define IXDR_PUT_U_INT32(buf, v)   IXDR_PUT_INT32((buf), ((int32_t)(v)))
 
#define IXDR_GET_LONG(buf)   ((long)ntohl((u_int32_t)*(buf)++))
 
#define IXDR_PUT_LONG(buf, v)   (*(buf)++ =(int32_t)htonl((u_int32_t)v))
 
#define IXDR_GET_BOOL(buf)   ((bool_t)IXDR_GET_LONG(buf))
 
#define IXDR_GET_ENUM(buf, t)   ((t)IXDR_GET_LONG(buf))
 
#define IXDR_GET_U_LONG(buf)   ((u_long)IXDR_GET_LONG(buf))
 
#define IXDR_GET_SHORT(buf)   ((short)IXDR_GET_LONG(buf))
 
#define IXDR_GET_U_SHORT(buf)   ((u_short)IXDR_GET_LONG(buf))
 
#define IXDR_PUT_BOOL(buf, v)   IXDR_PUT_LONG((buf), (v))
 
#define IXDR_PUT_ENUM(buf, v)   IXDR_PUT_LONG((buf), (v))
 
#define IXDR_PUT_U_LONG(buf, v)   IXDR_PUT_LONG((buf), (v))
 
#define IXDR_PUT_SHORT(buf, v)   IXDR_PUT_LONG((buf), (v))
 
#define IXDR_PUT_U_SHORT(buf, v)   IXDR_PUT_LONG((buf), (v))
 
#define MAX_NETOBJ_SZ   1024
 

Typedefs

typedef struct __rpc_xdr XDR
 
typedef bool_t(* xdrproc_t) (XDR *,...)
 
typedef struct netobj netobj
 

Enumerations

enum  xdr_op { XDR_ENCODE =0 , XDR_DECODE =1 , XDR_FREE =2 }
 

Functions

static __inline int xdr_getint32 (XDR *xdrs, int32_t *ip)
 
static __inline int xdr_putint32 (XDR *xdrs, int32_t *ip)
 
__BEGIN_DECLS bool_t xdr_void (void)
 
bool_t xdr_int (XDR *, int *)
 
bool_t xdr_u_int (XDR *, u_int *)
 
bool_t xdr_long (XDR *, long *)
 
bool_t xdr_u_long (XDR *, u_long *)
 
bool_t xdr_short (XDR *, short *)
 
bool_t xdr_u_short (XDR *, u_short *)
 
bool_t xdr_int16_t (XDR *, int16_t *)
 
bool_t xdr_u_int16_t (XDR *, u_int16_t *)
 
bool_t xdr_int32_t (XDR *, int32_t *)
 
bool_t xdr_u_int32_t (XDR *, u_int32_t *)
 
bool_t xdr_int64_t (XDR *, int64_t *)
 
bool_t xdr_u_int64_t (XDR *, u_int64_t *)
 
bool_t xdr_bool (XDR *, bool_t *)
 
bool_t xdr_enum (XDR *, enum_t *)
 
bool_t xdr_array (XDR *, char **, u_int *, u_int, u_int, xdrproc_t)
 
bool_t xdr_bytes (XDR *, char **, u_int *, u_int)
 
bool_t xdr_opaque (XDR *, char *, u_int)
 
bool_t xdr_string (XDR *, char **, u_int)
 
bool_t xdr_union (XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t)
 
bool_t xdr_char (XDR *, char *)
 
bool_t xdr_u_char (XDR *, u_char *)
 
bool_t xdr_vector (XDR *, char *, u_int, u_int, xdrproc_t)
 
bool_t xdr_float (XDR *, float *)
 
bool_t xdr_double (XDR *, double *)
 
bool_t xdr_quadruple (XDR *, long double *)
 
bool_t xdr_reference (XDR *, char **, u_int, xdrproc_t)
 
bool_t xdr_pointer (XDR *, char **, u_int, xdrproc_t)
 
bool_t xdr_wrapstring (XDR *, char **)
 
void xdr_free (xdrproc_t, void *)
 
bool_t xdr_hyper (XDR *, quad_t *)
 
bool_t xdr_u_hyper (XDR *, u_quad_t *)
 
bool_t xdr_longlong_t (XDR *, quad_t *)
 
bool_t xdr_u_longlong_t (XDR *, u_quad_t *)
 
bool_t xdr_netobj (XDR *, struct netobj *)
 
__BEGIN_DECLS void xdrmem_create (XDR *, char *, u_int, enum xdr_op)
 
void xdrstdio_create (XDR *, FILE *, enum xdr_op)
 
void xdrrec_create (XDR *, u_int, u_int, void *, int(*)(void *, void *, int), int(*)(void *, void *, int))
 
bool_t xdrrec_endofrecord (XDR *, int)
 
int32_txdrrec_getoutbase (XDR *)
 
bool_t xdrrec_skiprecord (XDR *)
 
void xdrrec_setlastfrag (XDR *)
 
bool_t xdrrec_eof (XDR *)
 
u_int xdrrec_readbytes (XDR *, caddr_t, u_int)
 

Macro Definition Documentation

◆ BYTES_PER_XDR_UNIT

#define BYTES_PER_XDR_UNIT   (4)

Definition at line 93 of file xdr.h.

◆ IXDR_GET_BOOL

#define IXDR_GET_BOOL (   buf)    ((bool_t)IXDR_GET_LONG(buf))

Definition at line 275 of file xdr.h.

◆ IXDR_GET_ENUM

#define IXDR_GET_ENUM (   buf,
  t 
)    ((t)IXDR_GET_LONG(buf))

Definition at line 276 of file xdr.h.

◆ IXDR_GET_INT32

#define IXDR_GET_INT32 (   buf)    ((int32_t)ntohl((u_int32_t)*(buf)++))

Definition at line 267 of file xdr.h.

◆ IXDR_GET_LONG

#define IXDR_GET_LONG (   buf)    ((long)ntohl((u_int32_t)*(buf)++))

Definition at line 272 of file xdr.h.

◆ IXDR_GET_SHORT

#define IXDR_GET_SHORT (   buf)    ((short)IXDR_GET_LONG(buf))

Definition at line 278 of file xdr.h.

◆ IXDR_GET_U_INT32

#define IXDR_GET_U_INT32 (   buf)    ((u_int32_t)IXDR_GET_INT32(buf))

Definition at line 269 of file xdr.h.

◆ IXDR_GET_U_LONG

#define IXDR_GET_U_LONG (   buf)    ((u_long)IXDR_GET_LONG(buf))

Definition at line 277 of file xdr.h.

◆ IXDR_GET_U_SHORT

#define IXDR_GET_U_SHORT (   buf)    ((u_short)IXDR_GET_LONG(buf))

Definition at line 279 of file xdr.h.

◆ IXDR_PUT_BOOL

#define IXDR_PUT_BOOL (   buf,
  v 
)    IXDR_PUT_LONG((buf), (v))

Definition at line 281 of file xdr.h.

◆ IXDR_PUT_ENUM

#define IXDR_PUT_ENUM (   buf,
  v 
)    IXDR_PUT_LONG((buf), (v))

Definition at line 282 of file xdr.h.

◆ IXDR_PUT_INT32

#define IXDR_PUT_INT32 (   buf,
  v 
)    (*(buf)++ =(int32_t)htonl((u_int32_t)v))

Definition at line 268 of file xdr.h.

◆ IXDR_PUT_LONG

#define IXDR_PUT_LONG (   buf,
  v 
)    (*(buf)++ =(int32_t)htonl((u_int32_t)v))

Definition at line 273 of file xdr.h.

◆ IXDR_PUT_SHORT

#define IXDR_PUT_SHORT (   buf,
  v 
)    IXDR_PUT_LONG((buf), (v))

Definition at line 284 of file xdr.h.

◆ IXDR_PUT_U_INT32

#define IXDR_PUT_U_INT32 (   buf,
  v 
)    IXDR_PUT_INT32((buf), ((int32_t)(v)))

Definition at line 270 of file xdr.h.

◆ IXDR_PUT_U_LONG

#define IXDR_PUT_U_LONG (   buf,
  v 
)    IXDR_PUT_LONG((buf), (v))

Definition at line 283 of file xdr.h.

◆ IXDR_PUT_U_SHORT

#define IXDR_PUT_U_SHORT (   buf,
  v 
)    IXDR_PUT_LONG((buf), (v))

Definition at line 285 of file xdr.h.

◆ MAX_NETOBJ_SZ

#define MAX_NETOBJ_SZ   1024

Definition at line 331 of file xdr.h.

◆ NULL_xdrproc_t

#define NULL_xdrproc_t   ((xdrproc_t)0)

Definition at line 246 of file xdr.h.

◆ RNDUP

#define RNDUP (   x)
Value:
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define BYTES_PER_XDR_UNIT
Definition: xdr.h:93

Definition at line 94 of file xdr.h.

◆ XDR_CONTROL

#define XDR_CONTROL (   xdrs,
  req,
  op 
)
Value:
if ((xdrs)->x_ops->x_control) \
(*(xdrs)->x_ops->x_control)(xdrs, req, op)
UINT op
Definition: effect.c:236

Definition at line 221 of file xdr.h.

◆ xdr_control

#define xdr_control (   xdrs,
  req,
  op 
)    XDR_CONTROL(xdrs, req, op)

Definition at line 224 of file xdr.h.

◆ XDR_DESTROY

#define XDR_DESTROY (   xdrs)
Value:
if ((xdrs)->x_ops->x_destroy) \
(*(xdrs)->x_ops->x_destroy)(xdrs)

Definition at line 214 of file xdr.h.

◆ xdr_destroy

#define xdr_destroy (   xdrs)
Value:
if ((xdrs)->x_ops->x_destroy) \
(*(xdrs)->x_ops->x_destroy)(xdrs)

Definition at line 217 of file xdr.h.

◆ XDR_GETBYTES

#define XDR_GETBYTES (   xdrs,
  addr,
  len 
)     (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)

Definition at line 189 of file xdr.h.

◆ xdr_getbytes

#define xdr_getbytes (   xdrs,
  addr,
  len 
)     (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)

Definition at line 191 of file xdr.h.

◆ XDR_GETINT32

#define XDR_GETINT32 (   xdrs,
  int32p 
)    xdr_getint32(xdrs, int32p)

Definition at line 186 of file xdr.h.

◆ XDR_GETLONG

#define XDR_GETLONG (   xdrs,
  longp 
)     (*(xdrs)->x_ops->x_getlong)(xdrs, longp)

Definition at line 156 of file xdr.h.

◆ xdr_getlong

#define xdr_getlong (   xdrs,
  longp 
)     (*(xdrs)->x_ops->x_getlong)(xdrs, longp)

Definition at line 158 of file xdr.h.

◆ XDR_GETPOS

#define XDR_GETPOS (   xdrs)     (*(xdrs)->x_ops->x_getpostn)(xdrs)

Definition at line 199 of file xdr.h.

◆ xdr_getpos

#define xdr_getpos (   xdrs)     (*(xdrs)->x_ops->x_getpostn)(xdrs)

Definition at line 201 of file xdr.h.

◆ XDR_INLINE

#define XDR_INLINE (   xdrs,
  len 
)     (*(xdrs)->x_ops->x_inline)(xdrs, len)

Definition at line 209 of file xdr.h.

◆ xdr_inline

#define xdr_inline (   xdrs,
  len 
)     (*(xdrs)->x_ops->x_inline)(xdrs, len)

Definition at line 211 of file xdr.h.

◆ XDR_PUTBYTES

#define XDR_PUTBYTES (   xdrs,
  addr,
  len 
)     (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)

Definition at line 194 of file xdr.h.

◆ xdr_putbytes

#define xdr_putbytes (   xdrs,
  addr,
  len 
)     (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)

Definition at line 196 of file xdr.h.

◆ XDR_PUTINT32

#define XDR_PUTINT32 (   xdrs,
  int32p 
)    xdr_putint32(xdrs, int32p)

Definition at line 187 of file xdr.h.

◆ XDR_PUTLONG

#define XDR_PUTLONG (   xdrs,
  longp 
)     (*(xdrs)->x_ops->x_putlong)(xdrs, longp)

Definition at line 161 of file xdr.h.

◆ xdr_putlong

#define xdr_putlong (   xdrs,
  longp 
)     (*(xdrs)->x_ops->x_putlong)(xdrs, longp)

Definition at line 163 of file xdr.h.

◆ xdr_rpcport

#define xdr_rpcport (   xdrs,
  portp 
)    xdr_u_int32(xdrs, portp)

Definition at line 234 of file xdr.h.

◆ xdr_rpcproc

#define xdr_rpcproc (   xdrs,
  procp 
)    xdr_u_int32(xdrs, procp)

Definition at line 232 of file xdr.h.

◆ xdr_rpcprog

#define xdr_rpcprog (   xdrs,
  progp 
)    xdr_u_int32(xdrs, progp)

Definition at line 231 of file xdr.h.

◆ xdr_rpcprot

#define xdr_rpcprot (   xdrs,
  protp 
)    xdr_u_int32(xdrs, protp)

Definition at line 233 of file xdr.h.

◆ xdr_rpcvers

#define xdr_rpcvers (   xdrs,
  versp 
)    xdr_u_int32(xdrs, versp)

Definition at line 230 of file xdr.h.

◆ XDR_SETPOS

#define XDR_SETPOS (   xdrs,
  pos 
)     (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)

Definition at line 204 of file xdr.h.

◆ xdr_setpos

#define xdr_setpos (   xdrs,
  pos 
)     (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)

Definition at line 206 of file xdr.h.

Typedef Documentation

◆ netobj

typedef struct netobj netobj

Definition at line 336 of file xdr.h.

◆ XDR

typedef struct __rpc_xdr XDR

◆ xdrproc_t

typedef bool_t(* xdrproc_t) (XDR *,...)

Definition at line 144 of file xdr.h.

Enumeration Type Documentation

◆ xdr_op

Enumerator
XDR_ENCODE 
XDR_DECODE 
XDR_FREE 

Definition at line 84 of file xdr.h.

84 {
85 XDR_ENCODE=0,
86 XDR_DECODE=1,
87 XDR_FREE=2
88};
@ XDR_DECODE
Definition: xdr.h:86
@ XDR_FREE
Definition: xdr.h:87
@ XDR_ENCODE
Definition: xdr.h:85

Function Documentation

◆ xdr_array()

bool_t xdr_array ( XDR ,
char **  ,
u_int ,
u_int  ,
u_int  ,
xdrproc_t   
)

◆ xdr_bool()

bool_t xdr_bool ( XDR xdrs,
bool_t bp 
)

Definition at line 428 of file xdr.c.

431{
432 long lb;
433
434 switch (xdrs->x_op) {
435
436 case XDR_ENCODE:
437 lb = *bp ? XDR_TRUE : XDR_FALSE;
438 return (XDR_PUTLONG(xdrs, &lb));
439
440 case XDR_DECODE:
441 if (!XDR_GETLONG(xdrs, &lb)) {
442 return (FALSE);
443 }
444 *bp = (lb == XDR_FALSE) ? FALSE : TRUE;
445 return (TRUE);
446
447 case XDR_FREE:
448 return (TRUE);
449 }
450 /* NOTREACHED */
451 return (FALSE);
452}
#define XDR_TRUE
Definition: xdr.c:63
#define XDR_FALSE
Definition: xdr.c:62
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
enum xdr_op x_op
Definition: xdr.h:104
#define XDR_PUTLONG(xdrs, longp)
Definition: xdr.h:161
#define XDR_GETLONG(xdrs, longp)
Definition: xdr.h:156

Referenced by cb_notify_deviceid_change(), decode_file_attrs(), decode_layout_res_ok(), decode_op_bind_conn_to_session(), decode_op_layoutcommit(), decode_op_layoutget(), decode_op_layoutreturn(), decode_open_none_delegation4(), decode_open_read_delegation4(), decode_open_write_delegation4(), decode_read_res_ok(), decode_readdir_entry(), decode_readdir_list(), encode_file_attrs(), encode_op_layoutcommit(), encode_op_layoutget(), encode_op_layoutreturn(), encode_op_lock(), encode_op_openattr(), encode_op_reclaim_complete(), encode_op_sequence(), op_cb_layoutrecall_args(), op_cb_recall_args(), op_cb_sequence_args(), rpcb_set(), rpcb_unset(), xdr_change_info4(), xdr_locker4(), xdr_pmaplist(), xdr_pointer(), xdr_rpcb_entry_list_ptr(), and xdr_rpcblist_ptr().

◆ xdr_bytes()

bool_t xdr_bytes ( XDR xdrs,
char **  cpp,
u_int sizep,
u_int  maxsize 
)

Definition at line 536 of file xdr.c.

541{
542 char *sp = *cpp; /* sp is the actual string pointer */
543 u_int nodesize;
544#ifdef __REACTOS__ // CVE-2017-8779
545 bool_t ret, allocated = FALSE;
546#endif
547
548 /*
549 * first deal with the length since xdr bytes are counted
550 */
551 if (! xdr_u_int(xdrs, sizep)) {
552 return (FALSE);
553 }
554 nodesize = *sizep;
555 if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) {
556 return (FALSE);
557 }
558
559 /*
560 * now deal with the actual bytes
561 */
562 switch (xdrs->x_op) {
563
564 case XDR_DECODE:
565 if (nodesize == 0) {
566 return (TRUE);
567 }
568 if (sp == NULL) {
569 *cpp = sp = mem_alloc(nodesize);
570#ifdef __REACTOS__ // CVE-2017-8779
571 allocated = TRUE;
572#endif
573 }
574 if (sp == NULL) {
575 //warnx("xdr_bytes: out of memory");
576 return (FALSE);
577 }
578 /* FALLTHROUGH */
579
580 case XDR_ENCODE:
581#ifndef __REACTOS__ // CVE-2017-8779
582 return (xdr_opaque(xdrs, sp, nodesize));
583#else
584 ret = xdr_opaque(xdrs, sp, nodesize);
585 if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
586 if (allocated == TRUE) {
587 free(sp);
588 *cpp = NULL;
589 }
590 }
591 return (ret);
592#endif
593
594 case XDR_FREE:
595 if (sp != NULL) {
596 mem_free(sp, nodesize);
597 *cpp = NULL;
598 }
599 return (TRUE);
600 }
601 /* NOTREACHED */
602 return (FALSE);
603}
bool_t xdr_u_int(XDR *xdrs, u_int *up)
Definition: xdr.c:133
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
#define free
Definition: debug_ros.c:5
UINT32 u_int
Definition: types.h:82
#define mem_free(ptr, bsize)
Definition: types.h:124
#define NULL
Definition: types.h:112
#define mem_alloc(bsize)
Definition: types.h:123
int32_t bool_t
Definition: types.h:101
static const WCHAR sp[]
Definition: suminfo.c:287
int ret

Referenced by common_notify4(), decode_component(), decode_file_attrs(), decode_fs_location4(), decode_op_exchange_id(), decode_op_readlink(), decode_pathname4(), decode_read_res_ok(), decode_readdir_entry(), encode_component(), encode_createtype4(), encode_file_attrs(), encode_op_write(), nfs_decode_compound(), nfs_encode_compound(), xdr_client_owner4(), xdr_fattr4(), xdr_fh(), xdr_netbuf(), xdr_netobj(), xdr_nfs_impl_id4(), xdr_opaque_auth(), xdr_pnfs_addr(), xdr_rpc_gss_cred(), xdr_rpc_gss_init_args(), xdr_rpc_gss_init_res(), xdr_rpc_gss_unwrap_data(), xdr_rpc_gss_wrap_data(), xdr_rpc_sspi_cred(), xdr_rpc_sspi_init_args(), xdr_rpc_sspi_init_res(), xdr_rpc_sspi_unwrap_data(), xdr_rpc_sspi_wrap_data(), xdr_secinfo(), xdr_server_owner4(), and xdr_state_owner4().

◆ xdr_char()

bool_t xdr_char ( XDR xdrs,
char cp 
)

Definition at line 392 of file xdr.c.

395{
396 int i;
397
398 i = (*cp);
399 if (!xdr_int(xdrs, &i)) {
400 return (FALSE);
401 }
402 *cp = (char)i;
403 return (TRUE);
404}
bool_t xdr_int(XDR *xdrs, int *ip)
Definition: xdr.c:103
unsigned char
Definition: typeof.h:29
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
POINT cp
Definition: magnifier.c:59

◆ xdr_double()

bool_t xdr_double ( XDR xdrs,
double dp 
)

Definition at line 197 of file xdr_float.c.

200{
201#ifdef IEEEFP
202 int32_t *i32p;
203 bool_t rv;
204#else
205 int32_t *lp;
206 struct ieee_double id;
207 struct vax_double vd;
208 struct dbl_limits *lim;
209 int i;
210#endif
211
212 switch (xdrs->x_op) {
213
214 case XDR_ENCODE:
215#ifdef IEEEFP
216 i32p = (int32_t *)(void *)dp;
217#if BYTE_ORDER == BIG_ENDIAN
218 rv = XDR_PUTINT32(xdrs, i32p);
219 if (!rv)
220 return (rv);
221 rv = XDR_PUTINT32(xdrs, i32p+1);
222#else
223 rv = XDR_PUTINT32(xdrs, i32p+1);
224 if (!rv)
225 return (rv);
226 rv = XDR_PUTINT32(xdrs, i32p);
227#endif
228 return (rv);
229#else
230 vd = *((struct vax_double *)dp);
231 for (i = 0, lim = dbl_limits;
232 i < sizeof(dbl_limits)/sizeof(struct dbl_limits);
233 i++, lim++) {
234 if ((vd.mantissa4 == lim->d.mantissa4) &&
235 (vd.mantissa3 == lim->d.mantissa3) &&
236 (vd.mantissa2 == lim->d.mantissa2) &&
237 (vd.mantissa1 == lim->d.mantissa1) &&
238 (vd.exp == lim->d.exp)) {
239 id = lim->ieee;
240 goto shipit;
241 }
242 }
243 id.exp = vd.exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
244 id.mantissa1 = (vd.mantissa1 << 13) | (vd.mantissa2 >> 3);
245 id.mantissa2 = ((vd.mantissa2 & MASK(3)) << 29) |
246 (vd.mantissa3 << 13) |
247 ((vd.mantissa4 >> 3) & MASK(13));
248 shipit:
249 id.sign = vd.sign;
250 lp = (int32_t *)&id;
251 return (XDR_PUTINT32(xdrs, lp++) && XDR_PUTINT32(xdrs, lp));
252#endif
253
254 case XDR_DECODE:
255#ifdef IEEEFP
256 i32p = (int32_t *)(void *)dp;
257#if BYTE_ORDER == BIG_ENDIAN
258 rv = XDR_GETINT32(xdrs, i32p);
259 if (!rv)
260 return (rv);
261 rv = XDR_GETINT32(xdrs, i32p+1);
262#else
263 rv = XDR_GETINT32(xdrs, i32p+1);
264 if (!rv)
265 return (rv);
266 rv = XDR_GETINT32(xdrs, i32p);
267#endif
268 return (rv);
269#else
270 lp = (int32_t *)&id;
271 if (!XDR_GETINT32(xdrs, lp++) || !XDR_GETINT32(xdrs, lp))
272 return (FALSE);
273 for (i = 0, lim = dbl_limits;
274 i < sizeof(dbl_limits)/sizeof(struct dbl_limits);
275 i++, lim++) {
276 if ((id.mantissa2 == lim->ieee.mantissa2) &&
277 (id.mantissa1 == lim->ieee.mantissa1) &&
278 (id.exp == lim->ieee.exp)) {
279 vd = lim->d;
280 goto doneit;
281 }
282 }
283 vd.exp = id.exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
284 vd.mantissa1 = (id.mantissa1 >> 13);
285 vd.mantissa2 = ((id.mantissa1 & MASK(13)) << 3) |
286 (id.mantissa2 >> 29);
287 vd.mantissa3 = (id.mantissa2 >> 13);
288 vd.mantissa4 = (id.mantissa2 << 3);
289 doneit:
290 vd.sign = id.sign;
291 *dp = *((double *)&vd);
292 return (TRUE);
293#endif
294
295 case XDR_FREE:
296 return (TRUE);
297 }
298 /* NOTREACHED */
299 return (FALSE);
300}
INT32 int32_t
Definition: types.h:71
GLuint id
Definition: glext.h:5910
#define MASK
Definition: options.h:31
DWORD exp
Definition: msg.c:16058
#define XDR_PUTINT32(xdrs, int32p)
Definition: xdr.h:187
#define XDR_GETINT32(xdrs, int32p)
Definition: xdr.h:186

◆ xdr_enum()

bool_t xdr_enum ( XDR xdrs,
enum_t ep 
)

Definition at line 458 of file xdr.c.

461{
462 enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
463
464 /*
465 * enums are treated as ints
466 */
467 /* LINTED */ if (sizeof (enum sizecheck) == sizeof (long)) {
468 return (xdr_long(xdrs, (long *)(void *)ep));
469 } else /* LINTED */ if (sizeof (enum sizecheck) == sizeof (int)) {
470 return (xdr_int(xdrs, (int *)(void *)ep));
471 } else /* LINTED */ if (sizeof (enum sizecheck) == sizeof (short)) {
472 return (xdr_short(xdrs, (short *)(void *)ep));
473 } else {
474 return (FALSE);
475 }
476}
bool_t xdr_short(XDR *xdrs, short *sp)
Definition: xdr.c:270
bool_t xdr_long(XDR *xdrs, long *lp)
Definition: xdr.c:165

Referenced by decode_getdeviceinfo_ok(), decode_layout(), decode_op_bind_conn_to_session(), decode_op_reclaim_complete(), decode_op_want_delegation(), decode_open_none_delegation4(), decode_open_res_ok(), encode_op_bind_conn_to_session(), encode_op_getdeviceinfo(), encode_op_layoutcommit(), encode_op_layoutreturn(), encode_op_secinfo_noname(), op_cb_getattr_res(), op_cb_layoutrecall_args(), op_cb_layoutrecall_res(), op_cb_notify_deviceid_res(), op_cb_notify_lock_res(), op_cb_notify_res(), op_cb_push_deleg_res(), op_cb_recall_any_res(), op_cb_recall_res(), op_cb_recall_slot_res(), op_cb_recallable_obj_avail_res(), op_cb_wants_cancelled_res(), proc_cb_compound_res(), xdr_accepted_reply(), xdr_authdes_cred(), xdr_callhdr(), xdr_callmsg(), xdr_getxiddir(), xdr_keystatus(), xdr_opaque_auth(), xdr_rejected_reply(), xdr_replymsg(), xdr_rpc_gss_cred(), xdr_rpc_sspi_cred(), xdr_secinfo(), xdr_union(), and xdr_write_verf().

◆ xdr_float()

bool_t xdr_float ( XDR xdrs,
float fp 
)

Definition at line 95 of file xdr_float.c.

98{
99#ifndef IEEEFP
100 struct ieee_single is;
101 struct vax_single vs, *vsp;
102 struct sgl_limits *lim;
103 int i;
104#endif
105 switch (xdrs->x_op) {
106
107 case XDR_ENCODE:
108#ifdef IEEEFP
109 return (XDR_PUTINT32(xdrs, (int32_t *)fp));
110#else
111 vs = *((struct vax_single *)fp);
112 for (i = 0, lim = sgl_limits;
113 i < sizeof(sgl_limits)/sizeof(struct sgl_limits);
114 i++, lim++) {
115 if ((vs.mantissa2 == lim->s.mantissa2) &&
116 (vs.exp == lim->s.exp) &&
117 (vs.mantissa1 == lim->s.mantissa1)) {
118 is = lim->ieee;
119 goto shipit;
120 }
121 }
122 is.exp = vs.exp - VAX_SNG_BIAS + IEEE_SNG_BIAS;
123 is.mantissa = (vs.mantissa1 << 16) | vs.mantissa2;
124 shipit:
125 is.sign = vs.sign;
126 return (XDR_PUTINT32(xdrs, (int32_t *)&is));
127#endif
128
129 case XDR_DECODE:
130#ifdef IEEEFP
131 return (XDR_GETINT32(xdrs, (int32_t *)fp));
132#else
133 vsp = (struct vax_single *)fp;
134 if (!XDR_GETINT32(xdrs, (int32_t *)&is))
135 return (FALSE);
136 for (i = 0, lim = sgl_limits;
137 i < sizeof(sgl_limits)/sizeof(struct sgl_limits);
138 i++, lim++) {
139 if ((is.exp == lim->ieee.exp) &&
140 (is.mantissa == lim->ieee.mantissa)) {
141 *vsp = lim->s;
142 goto doneit;
143 }
144 }
145 vsp->exp = is.exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
146 vsp->mantissa2 = is.mantissa;
147 vsp->mantissa1 = (is.mantissa >> 16);
148 doneit:
149 vsp->sign = is.sign;
150 return (TRUE);
151#endif
152
153 case XDR_FREE:
154 return (TRUE);
155 }
156 /* NOTREACHED */
157 return (FALSE);
158}
return
Definition: dirsup.c:529
static vector_t * vs
Definition: server.c:127

◆ xdr_free()

void xdr_free ( xdrproc_t  proc,
void objp 
)

Definition at line 78 of file xdr.c.

81{
82 XDR x;
83
84 x.x_op = XDR_FREE;
85 (*proc)(&x, objp);
86}
Definition: xdr.h:103

Referenced by __rpcb_findaddr_timed().

◆ xdr_getint32()

static __inline int xdr_getint32 ( XDR xdrs,
int32_t ip 
)
static

Definition at line 167 of file xdr.h.

168{
169 long l;
170
171 if (!xdr_getlong(xdrs, &l))
172 return (FALSE);
173 *ip = (int32_t)l;
174 return (TRUE);
175}
r l[0]
Definition: byte_order.h:168
#define int32_t
Definition: nsiface.idl:56
Definition: dhcpd.h:62
#define xdr_getlong(xdrs, longp)
Definition: xdr.h:158

◆ xdr_hyper()

bool_t xdr_hyper ( XDR xdrs,
quad_t llp 
)

Definition at line 861 of file xdr.c.

864{
865
866 /*
867 * Don't bother open-coding this; it's a fair amount of code. Just
868 * call xdr_int64_t().
869 */
870 return (xdr_int64_t(xdrs, (int64_t *)llp));
871}
bool_t xdr_int64_t(XDR *xdrs, int64_t *llp)
Definition: xdr.c:795
INT64 int64_t
Definition: types.h:72

Referenced by xdr_nfstime4().

◆ xdr_int()

bool_t xdr_int ( XDR xdrs,
int ip 
)

Definition at line 103 of file xdr.c.

106{
107 long l;
108
109 switch (xdrs->x_op) {
110
111 case XDR_ENCODE:
112 l = (long) *ip;
113 return (XDR_PUTLONG(xdrs, &l));
114
115 case XDR_DECODE:
116 if (!XDR_GETLONG(xdrs, &l)) {
117 return (FALSE);
118 }
119 *ip = (int) l;
120 return (TRUE);
121
122 case XDR_FREE:
123 return (TRUE);
124 }
125 /* NOTREACHED */
126 return (FALSE);
127}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define long
Definition: qsort.c:33

Referenced by rpcb_gettime(), xdr_authunix_parms(), xdr_char(), xdr_enum(), xdr_rpcb_stat(), xdr_rpcbs_addrlist(), xdr_rpcbs_proc(), and xdr_rpcbs_rmtcalllist().

◆ xdr_int16_t()

bool_t xdr_int16_t ( XDR xdrs,
int16_t int16_p 
)

Definition at line 331 of file xdr.c.

334{
335 long l;
336
337 switch (xdrs->x_op) {
338
339 case XDR_ENCODE:
340 l = (long) *int16_p;
341 return (XDR_PUTLONG(xdrs, &l));
342
343 case XDR_DECODE:
344 if (!XDR_GETLONG(xdrs, &l)) {
345 return (FALSE);
346 }
347 *int16_p = (int16_t) l;
348 return (TRUE);
349
350 case XDR_FREE:
351 return (TRUE);
352 }
353 /* NOTREACHED */
354 return (FALSE);
355}
#define int16_t
Definition: nsiface.idl:55

◆ xdr_int32_t()

bool_t xdr_int32_t ( XDR xdrs,
int32_t int32_p 
)

Definition at line 208 of file xdr.c.

211{
212 long l;
213
214 switch (xdrs->x_op) {
215
216 case XDR_ENCODE:
217 l = (long) *int32_p;
218 return (XDR_PUTLONG(xdrs, &l));
219
220 case XDR_DECODE:
221 if (!XDR_GETLONG(xdrs, &l)) {
222 return (FALSE);
223 }
224 *int32_p = (int32_t) l;
225 return (TRUE);
226
227 case XDR_FREE:
228 return (TRUE);
229 }
230 /* NOTREACHED */
231 return (FALSE);
232}

◆ xdr_int64_t()

bool_t xdr_int64_t ( XDR xdrs,
int64_t llp 
)

Definition at line 795 of file xdr.c.

798{
799 u_long ul[2];
800
801 switch (xdrs->x_op) {
802 case XDR_ENCODE:
803 ul[0] = (u_long)((u_int64_t)*llp >> 32) & 0xffffffff;
804 ul[1] = (u_long)((u_int64_t)*llp) & 0xffffffff;
805 if (XDR_PUTLONG(xdrs, (long *)&ul[0]) == FALSE)
806 return (FALSE);
807 return (XDR_PUTLONG(xdrs, (long *)&ul[1]));
808 case XDR_DECODE:
809 if (XDR_GETLONG(xdrs, (long *)&ul[0]) == FALSE)
810 return (FALSE);
811 if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
812 return (FALSE);
813 *llp = (int64_t)
814 (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
815 return (TRUE);
816 case XDR_FREE:
817 return (TRUE);
818 }
819 /* NOTREACHED */
820 return (FALSE);
821}
UINT64 u_int64_t
Definition: types.h:76
unsigned long u_long
Definition: linux.h:269
#define int64_t
Definition: nsiface.idl:57

Referenced by xdr_hyper(), and xdr_longlong_t().

◆ xdr_long()

bool_t xdr_long ( XDR xdrs,
long lp 
)

Definition at line 165 of file xdr.c.

168{
169 switch (xdrs->x_op) {
170 case XDR_ENCODE:
171 return (XDR_PUTLONG(xdrs, lp));
172 case XDR_DECODE:
173 return (XDR_GETLONG(xdrs, lp));
174 case XDR_FREE:
175 return (TRUE);
176 }
177 /* NOTREACHED */
178 return (FALSE);
179}

Referenced by xdr_enum().

◆ xdr_longlong_t()

bool_t xdr_longlong_t ( XDR xdrs,
quad_t llp 
)

Definition at line 895 of file xdr.c.

898{
899
900 /*
901 * Don't bother open-coding this; it's a fair amount of code. Just
902 * call xdr_int64_t().
903 */
904 return (xdr_int64_t(xdrs, (int64_t *)llp));
905}

◆ xdr_netobj()

bool_t xdr_netobj ( XDR xdrs,
struct netobj np 
)

Definition at line 609 of file xdr.c.

612{
613
614 return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
615}
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
u_int n_len
Definition: xdr.h:333
char * n_bytes
Definition: xdr.h:334
#define MAX_NETOBJ_SZ
Definition: xdr.h:331

Referenced by xdr_cryptkeyarg2().

◆ xdr_opaque()

bool_t xdr_opaque ( XDR ,
char ,
u_int   
)

◆ xdr_pointer()

bool_t xdr_pointer ( XDR xdrs,
char **  objpp,
u_int  obj_size,
xdrproc_t  xdr_obj 
)

Definition at line 119 of file xdr_reference.c.

124{
125
126 bool_t more_data;
127
128 more_data = (*objpp != NULL);
129 if (! xdr_bool(xdrs,&more_data)) {
130 return (FALSE);
131 }
132 if (! more_data) {
133 *objpp = NULL;
134 return (TRUE);
135 }
136 return (xdr_reference(xdrs,objpp,obj_size,xdr_obj));
137}
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
bool_t xdr_reference(XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
Definition: xdr_reference.c:62

Referenced by xdr_rpcbs_addrlist(), xdr_rpcbs_addrlist_ptr(), xdr_rpcbs_rmtcalllist(), and xdr_rpcbs_rmtcalllist_ptr().

◆ xdr_putint32()

static __inline int xdr_putint32 ( XDR xdrs,
int32_t ip 
)
static

Definition at line 178 of file xdr.h.

179{
180 long l;
181
182 l = (long)*ip;
183 return xdr_putlong(xdrs, &l);
184}
#define xdr_putlong(xdrs, longp)
Definition: xdr.h:163

Referenced by authdes_marshal().

◆ xdr_quadruple()

bool_t xdr_quadruple ( XDR ,
long double  
)

◆ xdr_reference()

bool_t xdr_reference ( XDR ,
char **  ,
u_int  ,
xdrproc_t   
)

◆ xdr_short()

bool_t xdr_short ( XDR xdrs,
short sp 
)

Definition at line 270 of file xdr.c.

273{
274 long l;
275
276 switch (xdrs->x_op) {
277
278 case XDR_ENCODE:
279 l = (long) *sp;
280 return (XDR_PUTLONG(xdrs, &l));
281
282 case XDR_DECODE:
283 if (!XDR_GETLONG(xdrs, &l)) {
284 return (FALSE);
285 }
286 *sp = (short) l;
287 return (TRUE);
288
289 case XDR_FREE:
290 return (TRUE);
291 }
292 /* NOTREACHED */
293 return (FALSE);
294}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94

Referenced by xdr_enum().

◆ xdr_string()

bool_t xdr_string ( XDR xdrs,
char **  cpp,
u_int  maxsize 
)

Definition at line 678 of file xdr.c.

682{
683 char *sp = *cpp; /* sp is the actual string pointer */
684 u_int size;
685 u_int nodesize;
686#ifdef __REACTOS__ // CVE-2017-8779
687 bool_t ret, allocated = FALSE;
688#endif
689
690 /*
691 * first deal with the length since xdr strings are counted-strings
692 */
693 switch (xdrs->x_op) {
694 case XDR_FREE:
695 if (sp == NULL) {
696 return(TRUE); /* already free */
697 }
698 /* FALLTHROUGH */
699 case XDR_ENCODE:
700 if (sp == NULL)
701 return FALSE;
702 size = strlen(sp);
703 break;
704 case XDR_DECODE:
705 break;
706 }
707 if (! xdr_u_int(xdrs, &size)) {
708 return (FALSE);
709 }
710 if (size > maxsize) {
711 return (FALSE);
712 }
713 nodesize = size + 1;
714 if (nodesize == 0) {
715 /* This means an overflow. It a bug in the caller which
716 * provided a too large maxsize but nevertheless catch it
717 * here.
718 */
719 return FALSE;
720 }
721
722 /*
723 * now deal with the actual bytes
724 */
725 switch (xdrs->x_op) {
726
727 case XDR_DECODE:
728#ifndef __REACTOS__ // CVE-2017-8779
729 if (sp == NULL)
730 *cpp = sp = mem_alloc(nodesize);
731#else
732 if (sp == NULL) {
733 *cpp = sp = mem_alloc(nodesize);
734 allocated = TRUE;
735 }
736#endif
737 if (sp == NULL) {
738 //warnx("xdr_string: out of memory");
739 return (FALSE);
740 }
741 sp[size] = 0;
742 /* FALLTHROUGH */
743
744 case XDR_ENCODE:
745#ifndef __REACTOS__ // CVE-2017-8779
746 return (xdr_opaque(xdrs, sp, size));
747#else
748 ret = xdr_opaque(xdrs, sp, size);
749 if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
750 if (allocated == TRUE) {
751 free(sp);
752 *cpp = NULL;
753 }
754 }
755 return (ret);
756#endif
757
758 case XDR_FREE:
759 mem_free(sp, nodesize);
760 *cpp = NULL;
761 return (TRUE);
762 }
763 /* NOTREACHED */
764 return (FALSE);
765}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizeiptr size
Definition: glext.h:5919

Referenced by encode_backchannel_sec_parms(), xdr_authdes_cred(), xdr_authunix_parms(), xdr_netnamestr(), xdr_nfsace4(), xdr_rpcb(), xdr_rpcb_entry(), xdr_rpcb_rmtcallres(), xdr_rpcbs_addrlist(), xdr_rpcbs_rmtcalllist(), and xdr_wrapstring().

◆ xdr_u_char()

bool_t xdr_u_char ( XDR xdrs,
u_char cp 
)

Definition at line 410 of file xdr.c.

413{
414 u_int u;
415
416 u = (*cp);
417 if (!xdr_u_int(xdrs, &u)) {
418 return (FALSE);
419 }
420 *cp = (u_char)u;
421 return (TRUE);
422}
UCHAR u_char
Definition: types.h:80
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 * u
Definition: glfuncs.h:240

◆ xdr_u_hyper()

◆ xdr_u_int()

bool_t xdr_u_int ( XDR xdrs,
u_int up 
)

Definition at line 133 of file xdr.c.

136{
137 u_long l;
138
139 switch (xdrs->x_op) {
140
141 case XDR_ENCODE:
142 l = (u_long) *up;
143 return (XDR_PUTLONG(xdrs, (long *)&l));
144
145 case XDR_DECODE:
146 if (!XDR_GETLONG(xdrs, (long *)&l)) {
147 return (FALSE);
148 }
149 *up = (u_int) l;
150 return (TRUE);
151
152 case XDR_FREE:
153 return (TRUE);
154 }
155 /* NOTREACHED */
156 return (FALSE);
157}
#define up(mutex)
Definition: glue.h:30

Referenced by xdr_array(), xdr_authunix_parms(), xdr_bytes(), xdr_callmsg(), xdr_rpc_gss_cred(), xdr_rpc_gss_init_res(), xdr_rpc_gss_unwrap_data(), xdr_rpc_gss_wrap_data(), xdr_rpc_sspi_cred(), xdr_rpc_sspi_init_res(), xdr_rpc_sspi_unwrap_data(), xdr_rpc_sspi_wrap_data(), xdr_rpcb_rmtcallargs(), xdr_rpcb_rmtcallres(), xdr_string(), xdr_u_char(), and xdr_unixcred().

◆ xdr_u_int16_t()

bool_t xdr_u_int16_t ( XDR xdrs,
u_int16_t u_int16_p 
)

Definition at line 361 of file xdr.c.

364{
365 u_long l;
366
367 switch (xdrs->x_op) {
368
369 case XDR_ENCODE:
370 l = (u_long) *u_int16_p;
371 return (XDR_PUTLONG(xdrs, (long *)&l));
372
373 case XDR_DECODE:
374 if (!XDR_GETLONG(xdrs, (long *)&l)) {
375 return (FALSE);
376 }
377 *u_int16_p = (u_int16_t) l;
378 return (TRUE);
379
380 case XDR_FREE:
381 return (TRUE);
382 }
383 /* NOTREACHED */
384 return (FALSE);
385}
unsigned short u_int16_t
Definition: rosdhcp.h:34

◆ xdr_u_int32_t()

bool_t xdr_u_int32_t ( XDR xdrs,
u_int32_t u_int32_p 
)

Definition at line 239 of file xdr.c.

242{
243 u_long l;
244
245 switch (xdrs->x_op) {
246
247 case XDR_ENCODE:
248 l = (u_long) *u_int32_p;
249 return (XDR_PUTLONG(xdrs, (long *)&l));
250
251 case XDR_DECODE:
252 if (!XDR_GETLONG(xdrs, (long *)&l)) {
253 return (FALSE);
254 }
255 *u_int32_p = (u_int32_t) l;
256 return (TRUE);
257
258 case XDR_FREE:
259 return (TRUE);
260 }
261 /* NOTREACHED */
262 return (FALSE);
263}
unsigned int u_int32_t
Definition: rosdhcp.h:35

Referenced by cb_compound_tag(), cb_notify_deviceid_change(), cb_notify_deviceid_delete(), common_fh(), common_stateid(), decode_file_attrs(), decode_file_layout(), decode_file_layout_handles(), decode_fs_location4(), decode_fs_locations4(), decode_getdeviceinfo_ok(), decode_layout_res_ok(), decode_lock_res_denied(), decode_modified_limit4(), decode_op_access(), decode_op_close(), decode_op_commit(), decode_op_create(), decode_op_create_session(), decode_op_delegpurge(), decode_op_delegreturn(), decode_op_destroy_clientid(), decode_op_destroy_session(), decode_op_exchange_id(), decode_op_free_stateid(), decode_op_getattr(), decode_op_getdeviceinfo(), decode_op_getfh(), decode_op_layoutcommit(), decode_op_layoutget(), decode_op_layoutreturn(), decode_op_link(), decode_op_lock(), decode_op_lockt(), decode_op_locku(), decode_op_lookup(), decode_op_open(), decode_op_openattr(), decode_op_putfh(), decode_op_putrootfh(), decode_op_read(), decode_op_readdir(), decode_op_readlink(), decode_op_remove(), decode_op_rename(), decode_op_restorefh(), decode_op_savefh(), decode_op_secinfo(), decode_op_secinfo_noname(), decode_op_sequence(), decode_op_setattr(), decode_op_test_stateid(), decode_op_want_delegation(), decode_op_write(), decode_open_res_ok(), decode_pathname4(), decode_space_limit4(), encode_backchannel_sec_parms(), encode_createhow4(), encode_createtype4(), encode_file_attrs(), encode_op_access(), encode_op_bind_conn_to_session(), encode_op_close(), encode_op_commit(), encode_op_create_session(), encode_op_exchange_id(), encode_op_getdeviceinfo(), encode_op_layoutcommit(), encode_op_layoutget(), encode_op_layoutreturn(), encode_op_lock(), encode_op_lockt(), encode_op_locku(), encode_op_open(), encode_op_read(), encode_op_readdir(), encode_op_sequence(), encode_op_want_delegation(), encode_op_write(), encode_open_claim4(), encode_openflag4(), nfs_decode_compound(), nfs_encode_compound(), op_cb_notify_args(), op_cb_notify_lock_args(), op_cb_push_deleg_args(), op_cb_recall_any_args(), op_cb_recall_slot_args(), op_cb_recallable_obj_avail_args(), op_cb_sequence_args(), op_cb_sequence_ref(), op_cb_sequence_res_ok(), op_cb_wants_cancelled_args(), proc_cb_compound_args(), xdr_accepted_reply(), xdr_bitmap4(), xdr_callhdr(), xdr_callmsg(), xdr_channel_attrs4(), xdr_data_server_list(), xdr_getcallbody(), xdr_getxiddir(), xdr_layout_types(), xdr_locker4(), xdr_mdsthreshold(), xdr_multi_addr(), xdr_netbuf(), xdr_nfsace4(), xdr_nfsdacl41(), xdr_nfstime4(), xdr_rejected_reply(), xdr_replymsg(), xdr_rpcb(), xdr_rpcb_entry(), xdr_rpcb_rmtcallargs(), xdr_rpcbs_addrlist(), xdr_rpcbs_rmtcalllist(), xdr_secinfo(), xdr_sequence_res_ok(), xdr_settime4(), xdr_state_protect4_a(), xdr_state_protect4_r(), xdr_stateid4(), xdr_stripe_indices(), xdr_threshold_item(), and xdr_write_res_ok().

◆ xdr_u_int64_t()

bool_t xdr_u_int64_t ( XDR xdrs,
u_int64_t ullp 
)

Definition at line 828 of file xdr.c.

831{
832 u_long ul[2];
833
834 switch (xdrs->x_op) {
835 case XDR_ENCODE:
836 ul[0] = (u_long)(*ullp >> 32) & 0xffffffff;
837 ul[1] = (u_long)(*ullp) & 0xffffffff;
838 if (XDR_PUTLONG(xdrs, (long *)&ul[0]) == FALSE)
839 return (FALSE);
840 return (XDR_PUTLONG(xdrs, (long *)&ul[1]));
841 case XDR_DECODE:
842 if (XDR_GETLONG(xdrs, (long *)&ul[0]) == FALSE)
843 return (FALSE);
844 if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
845 return (FALSE);
846 *ullp = (u_int64_t)
847 (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
848 return (TRUE);
849 case XDR_FREE:
850 return (TRUE);
851 }
852 /* NOTREACHED */
853 return (FALSE);
854}

Referenced by common_fsid(), encode_op_delegpurge(), op_cb_layoutrecall_file(), xdr_u_hyper(), and xdr_u_longlong_t().

◆ xdr_u_long()

bool_t xdr_u_long ( XDR xdrs,
u_long ulp 
)

Definition at line 186 of file xdr.c.

189{
190 switch (xdrs->x_op) {
191 case XDR_ENCODE:
192 return (XDR_PUTLONG(xdrs, (long *)ulp));
193 case XDR_DECODE:
194 return (XDR_GETLONG(xdrs, (long *)ulp));
195 case XDR_FREE:
196 return (TRUE);
197 }
198 /* NOTREACHED */
199 return (FALSE);
200}

Referenced by __rpc_get_time_offset(), xdr_authunix_parms(), xdr_pmap(), xdr_rmtcall_args(), and xdr_rmtcallres().

◆ xdr_u_longlong_t()

bool_t xdr_u_longlong_t ( XDR xdrs,
u_quad_t ullp 
)

Definition at line 912 of file xdr.c.

915{
916
917 /*
918 * Don't bother open-coding this; it's a fair amount of code. Just
919 * call xdr_u_int64_t().
920 */
921 return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
922}

◆ xdr_u_short()

bool_t xdr_u_short ( XDR xdrs,
u_short usp 
)

Definition at line 300 of file xdr.c.

303{
304 u_long l;
305
306 switch (xdrs->x_op) {
307
308 case XDR_ENCODE:
309 l = (u_long) *usp;
310 return (XDR_PUTLONG(xdrs, (long *)&l));
311
312 case XDR_DECODE:
313 if (!XDR_GETLONG(xdrs, (long *)&l)) {
314 return (FALSE);
315 }
316 *usp = (u_short) l;
317 return (TRUE);
318
319 case XDR_FREE:
320 return (TRUE);
321 }
322 /* NOTREACHED */
323 return (FALSE);
324}
unsigned short u_short
Definition: types.h:81

Referenced by __rpcb_findaddr_timed(), and pmap_getport().

◆ xdr_union()

bool_t xdr_union ( XDR xdrs,
enum_t dscmp,
char unp,
const struct xdr_discrim choices,
xdrproc_t  dfault 
)

Definition at line 629 of file xdr.c.

635{
636 enum_t dscm;
637
638 /*
639 * we deal with the discriminator; it's an enum
640 */
641 if (! xdr_enum(xdrs, dscmp)) {
642 return (FALSE);
643 }
644 dscm = *dscmp;
645
646 /*
647 * search choices for a value that matches the discriminator.
648 * if we find one, execute the xdr routine for that value.
649 */
650 for (; choices->proc != NULL_xdrproc_t; choices++) {
651 if (choices->value == dscm)
652 return ((*(choices->proc))(xdrs, unp));
653 }
654
655 /*
656 * no match - execute the default xdr routine if there is one
657 */
658 return ((dfault == NULL_xdrproc_t) ? FALSE :
659 (*dfault)(xdrs, unp));
660}
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
int32_t enum_t
Definition: types.h:102
int value
Definition: xdr.h:248
xdrproc_t proc
Definition: xdr.h:249
#define NULL_xdrproc_t
Definition: xdr.h:246

Referenced by cb_compound_argop(), cb_compound_resop(), op_cb_layoutrecall_args(), op_cb_sequence_res(), xdr_getreplyunion(), and xdr_replymsg().

◆ xdr_vector()

bool_t xdr_vector ( XDR xdrs,
char basep,
u_int  nelem,
u_int  elemsize,
xdrproc_t  xdr_elem 
)

Definition at line 139 of file xdr_array.c.

145{
146 u_int i;
147 char *elptr;
148
149 elptr = basep;
150 for (i = 0; i < nelem; i++) {
151 if (!(*xdr_elem)(xdrs, elptr)) {
152 return(FALSE);
153 }
154 elptr += elemsize;
155 }
156 return(TRUE);
157}
UINT elemsize
Definition: safearray.c:332
#define nelem(x)
Definition: shaptest.c:19

Referenced by xdr_rpcb_stat_byvers(), and xdr_rpcbs_proc().

◆ xdr_void()

◆ xdr_wrapstring()

bool_t xdr_wrapstring ( XDR xdrs,
char **  cpp 
)

Definition at line 772 of file xdr.c.

775{
776#ifdef __REACTOS__ // CVE-2017-8779
777 return xdr_string(xdrs, cpp, RPC_MAXDATASIZE);
778#else
779 return xdr_string(xdrs, cpp, LASTUNSIGNED);
780#endif
781}
bool_t xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
Definition: xdr.c:678
#define LASTUNSIGNED
Definition: xdr.c:65
#define RPC_MAXDATASIZE
Definition: rpc_com.h:51

◆ xdrmem_create()

__BEGIN_DECLS void xdrmem_create ( XDR xdrs,
char addr,
u_int  size,
enum  xdr_op 
)

Definition at line 94 of file xdr_mem.c.

99{
100
101 xdrs->x_op = op;
102 xdrs->x_ops = (PtrToUlong(addr) & (sizeof(int32_t) - 1))
104 xdrs->x_private = xdrs->x_base = addr;
105 xdrs->x_handy = size;
106}
#define PtrToUlong(u)
Definition: config.h:107
GLenum const GLvoid * addr
Definition: glext.h:9621
const struct __rpc_xdr::xdr_ops * x_ops
char * x_base
Definition: xdr.h:126
void * x_private
Definition: xdr.h:125
u_int x_handy
Definition: xdr.h:127
static const struct xdr_ops xdrmem_ops_aligned
Definition: xdr_mem.c:67
static const struct xdr_ops xdrmem_ops_unaligned
Definition: xdr_mem.c:78

Referenced by _svcauth_gss(), _svcauth_unix(), authgss_marshal(), authnone_create(), authsspi_marshal(), authunix_create(), authunix_refresh(), authunix_validate(), cache_set(), clnt_dg_create(), clnt_raw_create(), clnt_vc_create(), decode_op_getattr(), decode_readdir_entry(), encode_file_attrs(), info_to_fattr4(), marshal_new_auth(), op_cb_notify_deviceid_args(), replay_cache_read(), replay_cache_write(), replay_validate_args(), rpc_broadcast_exp(), svc_dg_create(), svc_raw_create(), xdr_rpc_gss_unwrap_data(), and xdr_rpc_sspi_unwrap_data().

◆ xdrrec_create()

void xdrrec_create ( XDR ,
u_int  ,
u_int  ,
void ,
int(*)(void *, void *, int ,
int(*)(void *, void *, int  
)

◆ xdrrec_endofrecord()

bool_t xdrrec_endofrecord ( XDR ,
int   
)

◆ xdrrec_eof()

bool_t xdrrec_eof ( XDR xdrs)

Definition at line 531 of file xdr_rec.c.

533{
534 RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
535
536 while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) {
537 if (! skip_input_bytes(rstrm, rstrm->fbtbc))
538 return (TRUE);
539 rstrm->fbtbc = 0;
540 if ((! rstrm->last_frag) && (! set_input_fragment(rstrm)))
541 return (TRUE);
542 }
543 if (rstrm->in_finger == rstrm->in_boundry)
544 return (TRUE);
545 return (FALSE);
546}
bool_t last_frag
Definition: xdr_rec.c:146
u_int fbtbc
Definition: xdr_rec.c:145
char * in_finger
Definition: xdr_rec.c:143
char * in_boundry
Definition: xdr_rec.c:144
static bool_t set_input_fragment(RECSTREAM *)
Definition: xdr_rec.c:765
static bool_t skip_input_bytes(RECSTREAM *, u_int)
Definition: xdr_rec.c:791

Referenced by svc_vc_stat().

◆ xdrrec_getoutbase()

int32_t * xdrrec_getoutbase ( XDR xdrs)

Definition at line 415 of file xdr_rec.c.

417{
418 RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
419 int32_t *buf = NULL;
420
421 switch (xdrs->x_op) {
422
423 case XDR_ENCODE:
424 buf = rstrm->out_base;
425 break;
426
427 case XDR_DECODE:
428 break;
429
430 case XDR_FREE:
431 break;
432 }
433 return (buf);
434}
switch(r->id)
Definition: btrfs.c:3046
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char * out_base
Definition: xdr_rec.c:132

Referenced by authsspi_marshal().

◆ xdrrec_readbytes()

u_int xdrrec_readbytes ( XDR ,
caddr_t  ,
u_int   
)

◆ xdrrec_setlastfrag()

void xdrrec_setlastfrag ( XDR xdrs)

Definition at line 488 of file xdr_rec.c.

490{
491 RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
492 rstrm->last_frag = 1;
493}

Referenced by clnt_cb_thread().

◆ xdrrec_skiprecord()

bool_t xdrrec_skiprecord ( XDR xdrs)

Definition at line 496 of file xdr_rec.c.

498{
499 RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
500 enum xprt_stat xstat;
501
502 if (rstrm->nonblock) {
503 if (__xdrrec_getrec(xdrs, &xstat, FALSE))
504 return TRUE;
505
506 if (rstrm->in_finger == rstrm->in_boundry &&
507 xstat == XPRT_MOREREQS) {
508 rstrm->fbtbc = 0;
509 return TRUE;
510 }
511 return FALSE;
512 }
513
514 while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) {
515 if (! skip_input_bytes(rstrm, rstrm->fbtbc))
516 return (FALSE);
517 rstrm->fbtbc = 0;
518 if ((! rstrm->last_frag) && (! set_input_fragment(rstrm)))
519 return (FALSE);
520 }
521 rstrm->last_frag = FALSE;
522 return (TRUE);
523}
xprt_stat
Definition: svc.h:81
@ XPRT_MOREREQS
Definition: svc.h:83
bool_t nonblock
Definition: xdr_rec.c:150
bool_t __xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata)
Definition: xdr_rec.c:581

Referenced by clnt_cb_thread(), and svc_vc_recv().

◆ xdrstdio_create()

void xdrstdio_create ( XDR xdrs,
FILE file,
enum  xdr_op 
)

Definition at line 79 of file xdr_stdio.c.

83{
84
85 xdrs->x_op = op;
86 xdrs->x_ops = &xdrstdio_ops;
87 xdrs->x_private = file;
88 xdrs->x_handy = 0;
89 xdrs->x_base = 0;
90}
Definition: fci.c:127
static const struct xdr_ops xdrstdio_ops
Definition: xdr_stdio.c:62