ReactOS 0.4.16-dev-329-g9223134
rpcb_st_xdr.c File Reference
#include <wintirpc.h>
#include <rpc/rpc.h>
Include dependency graph for rpcb_st_xdr.c:

Go to the source code of this file.

Functions

bool_t xdr_rpcbs_addrlist (XDR *xdrs, rpcbs_addrlist *objp)
 
bool_t xdr_rpcbs_rmtcalllist (XDR *xdrs, rpcbs_rmtcalllist *objp)
 
bool_t xdr_rpcbs_proc (XDR *xdrs, rpcbs_proc objp)
 
bool_t xdr_rpcbs_addrlist_ptr (XDR *xdrs, rpcbs_addrlist_ptr *objp)
 
bool_t xdr_rpcbs_rmtcalllist_ptr (XDR *xdrs, rpcbs_rmtcalllist_ptr *objp)
 
bool_t xdr_rpcb_stat (XDR *xdrs, rpcb_stat *objp)
 
bool_t xdr_rpcb_stat_byvers (XDR *xdrs, rpcb_stat_byvers objp)
 

Function Documentation

◆ xdr_rpcb_stat()

bool_t xdr_rpcb_stat ( XDR xdrs,
rpcb_stat objp 
)

Definition at line 247 of file rpcb_st_xdr.c.

250{
251
252 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
253 return (FALSE);
254 }
255 if (!xdr_int(xdrs, &objp->setinfo)) {
256 return (FALSE);
257 }
258 if (!xdr_int(xdrs, &objp->unsetinfo)) {
259 return (FALSE);
260 }
261 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
262 return (FALSE);
263 }
264 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
265 return (FALSE);
266 }
267 return (TRUE);
268}
bool_t xdr_int(XDR *xdrs, int *ip)
Definition: xdr.c:103
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
bool_t xdr_rpcbs_proc()
bool_t xdr_rpcbs_addrlist_ptr()
bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *xdrs, rpcbs_rmtcalllist_ptr *objp)
Definition: rpcb_st_xdr.c:235
rpcbs_proc info
Definition: rpcb_prot.h:437
int setinfo
Definition: rpcb_prot.h:438
rpcbs_rmtcalllist_ptr rmtinfo
Definition: rpcb_prot.h:441
int unsetinfo
Definition: rpcb_prot.h:439
rpcbs_addrlist_ptr addrinfo
Definition: rpcb_prot.h:440

◆ xdr_rpcb_stat_byvers()

bool_t xdr_rpcb_stat_byvers ( XDR xdrs,
rpcb_stat_byvers  objp 
)

Definition at line 275 of file rpcb_st_xdr.c.

278{
279 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
280 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {
281 return (FALSE);
282 }
283 return (TRUE);
284}
bool_t xdr_rpcb_stat()
#define RPCBVERS_STAT
Definition: rpcb_prot.h:358
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
bool_t xdr_vector(XDR *xdrs, char *basep, u_int nelem, u_int elemsize, xdrproc_t xdr_elem)
Definition: xdr_array.c:139

◆ xdr_rpcbs_addrlist()

bool_t xdr_rpcbs_addrlist ( XDR xdrs,
rpcbs_addrlist objp 
)

Definition at line 49 of file rpcb_st_xdr.c.

52{
53
54 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
55 return (FALSE);
56 }
57 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
58 return (FALSE);
59 }
60 if (!xdr_int(xdrs, &objp->success)) {
61 return (FALSE);
62 }
63 if (!xdr_int(xdrs, &objp->failure)) {
64 return (FALSE);
65 }
66#ifdef __REACTOS__ // CVE-2017-8779
67 if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
68#else
69 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
70#endif
71 return (FALSE);
72 }
73
74 if (!xdr_pointer(xdrs, (char **)&objp->next,
77 return (FALSE);
78 }
79
80 return (TRUE);
81}
bool_t xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
Definition: xdr.c:678
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 u_int
Definition: types.h:82
bool_t xdr_rpcbs_addrlist()
#define RPC_MAXDATASIZE
Definition: rpc_com.h:51
rpcvers_t vers
Definition: rpcb_prot.h:367
struct rpcbs_addrlist * next
Definition: rpcb_prot.h:371
rpcprog_t prog
Definition: rpcb_prot.h:366
char * netid
Definition: rpcb_prot.h:370
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
bool_t xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj)

◆ xdr_rpcbs_addrlist_ptr()

bool_t xdr_rpcbs_addrlist_ptr ( XDR xdrs,
rpcbs_addrlist_ptr objp 
)

Definition at line 223 of file rpcb_st_xdr.c.

226{
227 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
229 return (FALSE);
230 }
231 return (TRUE);
232}

◆ xdr_rpcbs_proc()

bool_t xdr_rpcbs_proc ( XDR xdrs,
rpcbs_proc  objp 
)

Definition at line 211 of file rpcb_st_xdr.c.

214{
215 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
216 sizeof (int), (xdrproc_t)xdr_int)) {
217 return (FALSE);
218 }
219 return (TRUE);
220}
#define RPCBSTAT_HIGHPROC
Definition: rpcb_prot.h:357

◆ xdr_rpcbs_rmtcalllist()

bool_t xdr_rpcbs_rmtcalllist ( XDR xdrs,
rpcbs_rmtcalllist objp 
)

Definition at line 86 of file rpcb_st_xdr.c.

89{
90 int32_t *buf;
91
92 if (xdrs->x_op == XDR_ENCODE) {
94 if (buf == NULL) {
95 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
96 return (FALSE);
97 }
98 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
99 return (FALSE);
100 }
101 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
102 return (FALSE);
103 }
104 if (!xdr_int(xdrs, &objp->success)) {
105 return (FALSE);
106 }
107 if (!xdr_int(xdrs, &objp->failure)) {
108 return (FALSE);
109 }
110 if (!xdr_int(xdrs, &objp->indirect)) {
111 return (FALSE);
112 }
113 } else {
114 IXDR_PUT_U_INT32(buf, objp->prog);
115 IXDR_PUT_U_INT32(buf, objp->vers);
116 IXDR_PUT_U_INT32(buf, objp->proc);
117 IXDR_PUT_INT32(buf, objp->success);
118 IXDR_PUT_INT32(buf, objp->failure);
120 }
121#ifdef __REACTOS__ // CVE-2017-8779
122 if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
123#else
124 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
125#endif
126 return (FALSE);
127 }
128 if (!xdr_pointer(xdrs, (char **)&objp->next,
131 return (FALSE);
132 }
133 return (TRUE);
134 } else if (xdrs->x_op == XDR_DECODE) {
135 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
136 if (buf == NULL) {
137 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
138 return (FALSE);
139 }
140 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
141 return (FALSE);
142 }
143 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
144 return (FALSE);
145 }
146 if (!xdr_int(xdrs, &objp->success)) {
147 return (FALSE);
148 }
149 if (!xdr_int(xdrs, &objp->failure)) {
150 return (FALSE);
151 }
152 if (!xdr_int(xdrs, &objp->indirect)) {
153 return (FALSE);
154 }
155 } else {
159 objp->success = (int)IXDR_GET_INT32(buf);
160 objp->failure = (int)IXDR_GET_INT32(buf);
161 objp->indirect = (int)IXDR_GET_INT32(buf);
162 }
163#ifdef __REACTOS__ // CVE-2017-8779
164 if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
165#else
166 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
167#endif
168 return (FALSE);
169 }
170 if (!xdr_pointer(xdrs, (char **)&objp->next,
171 sizeof (rpcbs_rmtcalllist),
173 return (FALSE);
174 }
175 return (TRUE);
176 }
177 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
178 return (FALSE);
179 }
180 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
181 return (FALSE);
182 }
183 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
184 return (FALSE);
185 }
186 if (!xdr_int(xdrs, &objp->success)) {
187 return (FALSE);
188 }
189 if (!xdr_int(xdrs, &objp->failure)) {
190 return (FALSE);
191 }
192 if (!xdr_int(xdrs, &objp->indirect)) {
193 return (FALSE);
194 }
195#ifdef __REACTOS__ // CVE-2017-8779
196 if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
197#else
198 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
199#endif
200 return (FALSE);
201 }
202 if (!xdr_pointer(xdrs, (char **)&objp->next,
203 sizeof (rpcbs_rmtcalllist),
205 return (FALSE);
206 }
207 return (TRUE);
208}
#define NULL
Definition: types.h:112
u_int32_t rpcprog_t
Definition: types.h:104
INT32 int32_t
Definition: types.h:71
u_int32_t rpcvers_t
Definition: types.h:105
u_int32_t rpcproc_t
Definition: types.h:106
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define IXDR_PUT_INT32(buf, v)
Definition: rpcb_prot.h:15
#define IXDR_GET_U_INT32(buf)
Definition: rpcb_prot.h:18
#define IXDR_GET_INT32(buf)
Definition: rpcb_prot.h:12
bool_t xdr_rpcbs_rmtcalllist()
#define IXDR_PUT_U_INT32(buf, v)
Definition: rpcb_prot.h:21
enum xdr_op x_op
Definition: xdr.h:104
rpcproc_t proc
Definition: rpcb_prot.h:388
rpcprog_t prog
Definition: rpcb_prot.h:386
rpcvers_t vers
Definition: rpcb_prot.h:387
struct rpcbs_rmtcalllist * next
Definition: rpcb_prot.h:393
#define XDR_INLINE(xdrs, len)
Definition: xdr.h:209
@ XDR_DECODE
Definition: xdr.h:86
@ XDR_ENCODE
Definition: xdr.h:85
#define BYTES_PER_XDR_UNIT
Definition: xdr.h:93

◆ xdr_rpcbs_rmtcalllist_ptr()

bool_t xdr_rpcbs_rmtcalllist_ptr ( XDR xdrs,
rpcbs_rmtcalllist_ptr objp 
)

Definition at line 235 of file rpcb_st_xdr.c.

238{
239 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
241 return (FALSE);
242 }
243 return (TRUE);
244}

Referenced by xdr_rpcb_stat().