1 /* $NetBSD: nlm_prot_xdr.c,v 1.2 2016/12/13 21:58:17 pgoyette Exp $ */ 2 /* 3 * Please do not edit this file. 4 * It was generated using rpcgen. 5 */ 6 7 #include <fs/nfs/nlm/nlm_prot.h> 8 9 #include <sys/cdefs.h> 10 #ifndef lint 11 /*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/ 12 /*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ 13 /* __RCSID("NetBSD: nlm_prot.x,v 1.6 2000/06/07 14:30:15 bouyer Exp "); */ 14 #endif /* not lint */ 15 /* __FBSDID("FreeBSD: head/sys/nlm/nlm_prot_xdr.c 177685 2008-03-28 09:50:32Z dfr "); */ 16 __RCSID("$NetBSD: nlm_prot_xdr.c,v 1.2 2016/12/13 21:58:17 pgoyette Exp $"); 17 18 bool_t 19 xdr_nlm_stats(XDR *xdrs, nlm_stats *objp) 20 { 21 22 if (!xdr_enum(xdrs, (enum_t *)objp)) 23 return (FALSE); 24 return (TRUE); 25 } 26 27 bool_t 28 xdr_nlm_holder(XDR *xdrs, nlm_holder *objp) 29 { 30 31 if (!xdr_bool(xdrs, &objp->exclusive)) 32 return (FALSE); 33 if (!xdr_int(xdrs, &objp->svid)) 34 return (FALSE); 35 if (!xdr_netobj(xdrs, &objp->oh)) 36 return (FALSE); 37 if (!xdr_u_int(xdrs, &objp->l_offset)) 38 return (FALSE); 39 if (!xdr_u_int(xdrs, &objp->l_len)) 40 return (FALSE); 41 return (TRUE); 42 } 43 44 bool_t 45 xdr_nlm_testrply(XDR *xdrs, nlm_testrply *objp) 46 { 47 48 if (!xdr_nlm_stats(xdrs, &objp->stat)) 49 return (FALSE); 50 switch (objp->stat) { 51 case nlm_denied: 52 if (!xdr_nlm_holder(xdrs, &objp->nlm_testrply_u.holder)) 53 return (FALSE); 54 break; 55 default: 56 break; 57 } 58 return (TRUE); 59 } 60 61 bool_t 62 xdr_nlm_stat(XDR *xdrs, nlm_stat *objp) 63 { 64 65 if (!xdr_nlm_stats(xdrs, &objp->stat)) 66 return (FALSE); 67 return (TRUE); 68 } 69 70 bool_t 71 xdr_nlm_res(XDR *xdrs, nlm_res *objp) 72 { 73 74 if (!xdr_netobj(xdrs, &objp->cookie)) 75 return (FALSE); 76 if (!xdr_nlm_stat(xdrs, &objp->stat)) 77 return (FALSE); 78 return (TRUE); 79 } 80 81 bool_t 82 xdr_nlm_testres(XDR *xdrs, nlm_testres *objp) 83 { 84 85 if (!xdr_netobj(xdrs, &objp->cookie)) 86 return (FALSE); 87 if (!xdr_nlm_testrply(xdrs, &objp->stat)) 88 return (FALSE); 89 return (TRUE); 90 } 91 92 bool_t 93 xdr_nlm_lock(XDR *xdrs, nlm_lock *objp) 94 { 95 96 if (!xdr_string(xdrs, &objp->caller_name, LM_MAXSTRLEN)) 97 return (FALSE); 98 if (!xdr_netobj(xdrs, &objp->fh)) 99 return (FALSE); 100 if (!xdr_netobj(xdrs, &objp->oh)) 101 return (FALSE); 102 if (!xdr_int(xdrs, &objp->svid)) 103 return (FALSE); 104 if (!xdr_u_int(xdrs, &objp->l_offset)) 105 return (FALSE); 106 if (!xdr_u_int(xdrs, &objp->l_len)) 107 return (FALSE); 108 return (TRUE); 109 } 110 111 bool_t 112 xdr_nlm_lockargs(XDR *xdrs, nlm_lockargs *objp) 113 { 114 115 if (!xdr_netobj(xdrs, &objp->cookie)) 116 return (FALSE); 117 if (!xdr_bool(xdrs, &objp->block)) 118 return (FALSE); 119 if (!xdr_bool(xdrs, &objp->exclusive)) 120 return (FALSE); 121 if (!xdr_nlm_lock(xdrs, &objp->alock)) 122 return (FALSE); 123 if (!xdr_bool(xdrs, &objp->reclaim)) 124 return (FALSE); 125 if (!xdr_int(xdrs, &objp->state)) 126 return (FALSE); 127 return (TRUE); 128 } 129 130 bool_t 131 xdr_nlm_cancargs(XDR *xdrs, nlm_cancargs *objp) 132 { 133 134 if (!xdr_netobj(xdrs, &objp->cookie)) 135 return (FALSE); 136 if (!xdr_bool(xdrs, &objp->block)) 137 return (FALSE); 138 if (!xdr_bool(xdrs, &objp->exclusive)) 139 return (FALSE); 140 if (!xdr_nlm_lock(xdrs, &objp->alock)) 141 return (FALSE); 142 return (TRUE); 143 } 144 145 bool_t 146 xdr_nlm_testargs(XDR *xdrs, nlm_testargs *objp) 147 { 148 149 if (!xdr_netobj(xdrs, &objp->cookie)) 150 return (FALSE); 151 if (!xdr_bool(xdrs, &objp->exclusive)) 152 return (FALSE); 153 if (!xdr_nlm_lock(xdrs, &objp->alock)) 154 return (FALSE); 155 return (TRUE); 156 } 157 158 bool_t 159 xdr_nlm_unlockargs(XDR *xdrs, nlm_unlockargs *objp) 160 { 161 162 if (!xdr_netobj(xdrs, &objp->cookie)) 163 return (FALSE); 164 if (!xdr_nlm_lock(xdrs, &objp->alock)) 165 return (FALSE); 166 return (TRUE); 167 } 168 169 bool_t 170 xdr_fsh_mode(XDR *xdrs, fsh_mode *objp) 171 { 172 173 if (!xdr_enum(xdrs, (enum_t *)objp)) 174 return (FALSE); 175 return (TRUE); 176 } 177 178 bool_t 179 xdr_fsh_access(XDR *xdrs, fsh_access *objp) 180 { 181 182 if (!xdr_enum(xdrs, (enum_t *)objp)) 183 return (FALSE); 184 return (TRUE); 185 } 186 187 bool_t 188 xdr_nlm_share(XDR *xdrs, nlm_share *objp) 189 { 190 191 if (!xdr_string(xdrs, &objp->caller_name, LM_MAXSTRLEN)) 192 return (FALSE); 193 if (!xdr_netobj(xdrs, &objp->fh)) 194 return (FALSE); 195 if (!xdr_netobj(xdrs, &objp->oh)) 196 return (FALSE); 197 if (!xdr_fsh_mode(xdrs, &objp->mode)) 198 return (FALSE); 199 if (!xdr_fsh_access(xdrs, &objp->access)) 200 return (FALSE); 201 return (TRUE); 202 } 203 204 bool_t 205 xdr_nlm_shareargs(XDR *xdrs, nlm_shareargs *objp) 206 { 207 208 if (!xdr_netobj(xdrs, &objp->cookie)) 209 return (FALSE); 210 if (!xdr_nlm_share(xdrs, &objp->share)) 211 return (FALSE); 212 if (!xdr_bool(xdrs, &objp->reclaim)) 213 return (FALSE); 214 return (TRUE); 215 } 216 217 bool_t 218 xdr_nlm_shareres(XDR *xdrs, nlm_shareres *objp) 219 { 220 221 if (!xdr_netobj(xdrs, &objp->cookie)) 222 return (FALSE); 223 if (!xdr_nlm_stats(xdrs, &objp->stat)) 224 return (FALSE); 225 if (!xdr_int(xdrs, &objp->sequence)) 226 return (FALSE); 227 return (TRUE); 228 } 229 230 bool_t 231 xdr_nlm_notify(XDR *xdrs, nlm_notify *objp) 232 { 233 234 if (!xdr_string(xdrs, &objp->name, MAXNAMELEN)) 235 return (FALSE); 236 if (!xdr_long(xdrs, &objp->state)) 237 return (FALSE); 238 return (TRUE); 239 } 240 241 bool_t 242 xdr_nlm4_stats(XDR *xdrs, nlm4_stats *objp) 243 { 244 245 if (!xdr_enum(xdrs, (enum_t *)objp)) 246 return (FALSE); 247 return (TRUE); 248 } 249 250 bool_t 251 xdr_nlm4_stat(XDR *xdrs, nlm4_stat *objp) 252 { 253 254 if (!xdr_nlm4_stats(xdrs, &objp->stat)) 255 return (FALSE); 256 return (TRUE); 257 } 258 259 bool_t 260 xdr_nlm4_holder(XDR *xdrs, nlm4_holder *objp) 261 { 262 263 if (!xdr_bool(xdrs, &objp->exclusive)) 264 return (FALSE); 265 if (!xdr_uint32_t(xdrs, &objp->svid)) 266 return (FALSE); 267 if (!xdr_netobj(xdrs, &objp->oh)) 268 return (FALSE); 269 if (!xdr_uint64_t(xdrs, &objp->l_offset)) 270 return (FALSE); 271 if (!xdr_uint64_t(xdrs, &objp->l_len)) 272 return (FALSE); 273 return (TRUE); 274 } 275 276 bool_t 277 xdr_nlm4_lock(XDR *xdrs, nlm4_lock *objp) 278 { 279 280 if (!xdr_string(xdrs, &objp->caller_name, MAXNAMELEN)) 281 return (FALSE); 282 if (!xdr_netobj(xdrs, &objp->fh)) 283 return (FALSE); 284 if (!xdr_netobj(xdrs, &objp->oh)) 285 return (FALSE); 286 if (!xdr_uint32_t(xdrs, &objp->svid)) 287 return (FALSE); 288 if (!xdr_uint64_t(xdrs, &objp->l_offset)) 289 return (FALSE); 290 if (!xdr_uint64_t(xdrs, &objp->l_len)) 291 return (FALSE); 292 return (TRUE); 293 } 294 295 bool_t 296 xdr_nlm4_share(XDR *xdrs, nlm4_share *objp) 297 { 298 299 if (!xdr_string(xdrs, &objp->caller_name, MAXNAMELEN)) 300 return (FALSE); 301 if (!xdr_netobj(xdrs, &objp->fh)) 302 return (FALSE); 303 if (!xdr_netobj(xdrs, &objp->oh)) 304 return (FALSE); 305 if (!xdr_fsh_mode(xdrs, &objp->mode)) 306 return (FALSE); 307 if (!xdr_fsh_access(xdrs, &objp->access)) 308 return (FALSE); 309 return (TRUE); 310 } 311 312 bool_t 313 xdr_nlm4_testrply(XDR *xdrs, nlm4_testrply *objp) 314 { 315 316 if (!xdr_nlm4_stats(xdrs, &objp->stat)) 317 return (FALSE); 318 switch (objp->stat) { 319 case nlm_denied: 320 if (!xdr_nlm4_holder(xdrs, &objp->nlm4_testrply_u.holder)) 321 return (FALSE); 322 break; 323 default: 324 break; 325 } 326 return (TRUE); 327 } 328 329 bool_t 330 xdr_nlm4_testres(XDR *xdrs, nlm4_testres *objp) 331 { 332 333 if (!xdr_netobj(xdrs, &objp->cookie)) 334 return (FALSE); 335 if (!xdr_nlm4_testrply(xdrs, &objp->stat)) 336 return (FALSE); 337 return (TRUE); 338 } 339 340 bool_t 341 xdr_nlm4_testargs(XDR *xdrs, nlm4_testargs *objp) 342 { 343 344 if (!xdr_netobj(xdrs, &objp->cookie)) 345 return (FALSE); 346 if (!xdr_bool(xdrs, &objp->exclusive)) 347 return (FALSE); 348 if (!xdr_nlm4_lock(xdrs, &objp->alock)) 349 return (FALSE); 350 return (TRUE); 351 } 352 353 bool_t 354 xdr_nlm4_res(XDR *xdrs, nlm4_res *objp) 355 { 356 357 if (!xdr_netobj(xdrs, &objp->cookie)) 358 return (FALSE); 359 if (!xdr_nlm4_stat(xdrs, &objp->stat)) 360 return (FALSE); 361 return (TRUE); 362 } 363 364 bool_t 365 xdr_nlm4_lockargs(XDR *xdrs, nlm4_lockargs *objp) 366 { 367 368 if (!xdr_netobj(xdrs, &objp->cookie)) 369 return (FALSE); 370 if (!xdr_bool(xdrs, &objp->block)) 371 return (FALSE); 372 if (!xdr_bool(xdrs, &objp->exclusive)) 373 return (FALSE); 374 if (!xdr_nlm4_lock(xdrs, &objp->alock)) 375 return (FALSE); 376 if (!xdr_bool(xdrs, &objp->reclaim)) 377 return (FALSE); 378 if (!xdr_int(xdrs, &objp->state)) 379 return (FALSE); 380 return (TRUE); 381 } 382 383 bool_t 384 xdr_nlm4_cancargs(XDR *xdrs, nlm4_cancargs *objp) 385 { 386 387 if (!xdr_netobj(xdrs, &objp->cookie)) 388 return (FALSE); 389 if (!xdr_bool(xdrs, &objp->block)) 390 return (FALSE); 391 if (!xdr_bool(xdrs, &objp->exclusive)) 392 return (FALSE); 393 if (!xdr_nlm4_lock(xdrs, &objp->alock)) 394 return (FALSE); 395 return (TRUE); 396 } 397 398 bool_t 399 xdr_nlm4_unlockargs(XDR *xdrs, nlm4_unlockargs *objp) 400 { 401 402 if (!xdr_netobj(xdrs, &objp->cookie)) 403 return (FALSE); 404 if (!xdr_nlm4_lock(xdrs, &objp->alock)) 405 return (FALSE); 406 return (TRUE); 407 } 408 409 bool_t 410 xdr_nlm4_shareargs(XDR *xdrs, nlm4_shareargs *objp) 411 { 412 413 if (!xdr_netobj(xdrs, &objp->cookie)) 414 return (FALSE); 415 if (!xdr_nlm4_share(xdrs, &objp->share)) 416 return (FALSE); 417 if (!xdr_bool(xdrs, &objp->reclaim)) 418 return (FALSE); 419 return (TRUE); 420 } 421 422 bool_t 423 xdr_nlm4_shareres(XDR *xdrs, nlm4_shareres *objp) 424 { 425 426 if (!xdr_netobj(xdrs, &objp->cookie)) 427 return (FALSE); 428 if (!xdr_nlm4_stats(xdrs, &objp->stat)) 429 return (FALSE); 430 if (!xdr_int(xdrs, &objp->sequence)) 431 return (FALSE); 432 return (TRUE); 433 } 434 435 bool_t 436 xdr_nlm_sm_status(XDR *xdrs, nlm_sm_status *objp) 437 { 438 439 if (!xdr_string(xdrs, &objp->mon_name, LM_MAXSTRLEN)) 440 return (FALSE); 441 if (!xdr_int(xdrs, &objp->state)) 442 return (FALSE); 443 if (!xdr_opaque(xdrs, objp->priv, 16)) 444 return (FALSE); 445 return (TRUE); 446 } 447 448 bool_t 449 xdr_nlm4_notify(XDR *xdrs, nlm4_notify *objp) 450 { 451 452 if (!xdr_string(xdrs, &objp->name, MAXNAMELEN)) 453 return (FALSE); 454 if (!xdr_int32_t(xdrs, &objp->state)) 455 return (FALSE); 456 return (TRUE); 457 } 458