1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #include "/home/git3/dehawe/titanic_53/usr/src/uts/intel/rdc/../../common/avs/ns/rdc/rdc_prot.h" 7 8 #ifndef _KERNEL 9 #include <stdlib.h> 10 #endif /* !_KERNEL */ 11 12 /* 13 * CDDL HEADER START 14 * 15 * The contents of this file are subject to the terms of the 16 * Common Development and Distribution License (the "License"). 17 * You may not use this file except in compliance with the License. 18 * 19 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 20 * or http://www.opensolaris.org/os/licensing. 21 * See the License for the specific language governing permissions 22 * and limitations under the License. 23 * 24 * When distributing Covered Code, include this CDDL HEADER in each 25 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 26 * If applicable, add the following below this CDDL HEADER, with the 27 * fields enclosed by brackets "[]" replaced with your own identifying 28 * information: Portions Copyright [yyyy] [name of copyright owner] 29 * 30 * CDDL HEADER END 31 */ 32 33 34 /* 35 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 36 * Use is subject to license terms. 37 */ 38 39 /* 40 * Auto generated from rdc_prot.x 41 */ 42 43 /* 44 * Network Replicator RPC spec 45 */ 46 47 /* 48 * We don't define netbuf in RPCL, since it would contain structure member 49 * names that would conflict with the definition of struct netbuf in 50 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here, 51 * and implement it ourselves in rpc/rpcb_prot.c. 52 */ 53 #ifdef __cplusplus 54 extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *); 55 56 #elif __STDC__ 57 extern bool_t xdr_netbuf(XDR *, struct netbuf *); 58 59 #else /* K&R C */ 60 bool_t xdr_netbuf(); 61 62 #endif /* K&R C */ 63 /* 64 * Use this to limit the size of the net_pendvec_t array 65 * to ~ 32k 66 */ 67 68 /* 69 * Error status 70 */ 71 72 bool_t 73 xdr_rdcstat(XDR *xdrs, rdcstat *objp) 74 { 75 76 if (!xdr_enum(xdrs, (enum_t *)objp)) 77 return (FALSE); 78 return (TRUE); 79 } 80 81 /* 82 * Set state (V4) 83 */ 84 85 bool_t 86 xdr_set_state4(XDR *xdrs, set_state4 *objp) 87 { 88 89 if (!xdr_opaque(xdrs, objp->netaddr, RDC_MAXADDR)) 90 return (FALSE); 91 if (!xdr_opaque(xdrs, objp->rnetaddr, RDC_MAXADDR)) 92 return (FALSE); 93 if (!xdr_int(xdrs, &objp->netaddrlen)) 94 return (FALSE); 95 if (!xdr_int(xdrs, &objp->rnetaddrlen)) 96 return (FALSE); 97 if (!xdr_u_int(xdrs, &objp->flag)) 98 return (FALSE); 99 if (!xdr_opaque(xdrs, objp->pfile, RDC_MAXNAMLEN)) 100 return (FALSE); 101 if (!xdr_opaque(xdrs, objp->sfile, RDC_MAXNAMLEN)) 102 return (FALSE); 103 return (TRUE); 104 } 105 106 bool_t 107 xdr_set_state(XDR *xdrs, set_state *objp) 108 { 109 110 if (!xdr_netbuf(xdrs, &objp->netaddr)) 111 return (FALSE); 112 if (!xdr_netbuf(xdrs, &objp->rnetaddr)) 113 return (FALSE); 114 if (!xdr_int(xdrs, &objp->netaddrlen)) 115 return (FALSE); 116 if (!xdr_int(xdrs, &objp->rnetaddrlen)) 117 return (FALSE); 118 if (!xdr_u_int(xdrs, &objp->flag)) 119 return (FALSE); 120 if (!xdr_string(xdrs, &objp->pfile, RDC_XDR_MAXNAMLEN)) 121 return (FALSE); 122 if (!xdr_string(xdrs, &objp->sfile, RDC_XDR_MAXNAMLEN)) 123 return (FALSE); 124 return (TRUE); 125 } 126 127 /* 128 * Get size of volume 129 */ 130 131 bool_t 132 xdr_getsize(XDR *xdrs, getsize *objp) 133 { 134 135 if (!xdr_int(xdrs, &objp->cd)) 136 return (FALSE); 137 return (TRUE); 138 } 139 140 /* 141 * Remote read (v5) 142 */ 143 144 bool_t 145 xdr_rread(XDR *xdrs, rread *objp) 146 { 147 148 if (!xdr_int(xdrs, &objp->cd)) 149 return (FALSE); 150 if (!xdr_int(xdrs, &objp->len)) 151 return (FALSE); 152 if (!xdr_int(xdrs, &objp->pos)) 153 return (FALSE); 154 if (!xdr_int(xdrs, &objp->idx)) 155 return (FALSE); 156 if (!xdr_int(xdrs, &objp->flag)) 157 return (FALSE); 158 return (TRUE); 159 } 160 161 /* 162 * Remote read (v6) 163 */ 164 165 bool_t 166 xdr_rread6(XDR *xdrs, rread6 *objp) 167 { 168 169 if (!xdr_int(xdrs, &objp->cd)) 170 return (FALSE); 171 if (!xdr_int(xdrs, &objp->len)) 172 return (FALSE); 173 if (!xdr_u_longlong_t(xdrs, &objp->pos)) 174 return (FALSE); 175 if (!xdr_int(xdrs, &objp->idx)) 176 return (FALSE); 177 if (!xdr_int(xdrs, &objp->flag)) 178 return (FALSE); 179 return (TRUE); 180 } 181 182 /* 183 * status OK from remote read 184 */ 185 186 bool_t 187 xdr_readok(XDR *xdrs, readok *objp) 188 { 189 190 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, RDC_MAXDATA)) 191 return (FALSE); 192 return (TRUE); 193 } 194 195 bool_t 196 xdr_readres(XDR *xdrs, readres *objp) 197 { 198 199 if (!xdr_rdcstat(xdrs, &objp->status)) 200 return (FALSE); 201 switch (objp->status) { 202 case RDC_OK: 203 if (!xdr_readok(xdrs, &objp->readres_u.reply)) 204 return (FALSE); 205 break; 206 } 207 return (TRUE); 208 } 209 210 /* 211 * Initiate bit map scoreboard transfer (v5) 212 */ 213 214 bool_t 215 xdr_bmap(XDR *xdrs, bmap *objp) 216 { 217 218 if (!xdr_int(xdrs, &objp->cd)) 219 return (FALSE); 220 if (!xdr_int(xdrs, &objp->dual)) 221 return (FALSE); 222 if (!xdr_int(xdrs, &objp->size)) 223 return (FALSE); 224 return (TRUE); 225 } 226 227 /* 228 * Initiate bit map scoreboard transfer (v6) 229 */ 230 231 bool_t 232 xdr_bmap6(XDR *xdrs, bmap6 *objp) 233 { 234 235 if (!xdr_int(xdrs, &objp->cd)) 236 return (FALSE); 237 if (!xdr_int(xdrs, &objp->dual)) 238 return (FALSE); 239 if (!xdr_u_longlong_t(xdrs, &objp->size)) 240 return (FALSE); 241 return (TRUE); 242 } 243 244 /* 245 * Scoreboard bitmap data (v5) 246 */ 247 248 bool_t 249 xdr_net_bdata(XDR *xdrs, net_bdata *objp) 250 { 251 252 if (!xdr_int(xdrs, &objp->cd)) 253 return (FALSE); 254 if (!xdr_int(xdrs, &objp->offset)) 255 return (FALSE); 256 if (!xdr_int(xdrs, &objp->size)) 257 return (FALSE); 258 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, RDC_BMAPBLKSIZE)) 259 return (FALSE); 260 return (TRUE); 261 } 262 263 /* 264 * Scoreboard bitmap data (v6) 265 */ 266 267 bool_t 268 xdr_net_bdata6(XDR *xdrs, net_bdata6 *objp) 269 { 270 271 if (!xdr_u_longlong_t(xdrs, &objp->offset)) 272 return (FALSE); 273 if (!xdr_int(xdrs, &objp->size)) 274 return (FALSE); 275 if (!xdr_int(xdrs, &objp->cd)) 276 return (FALSE); 277 if (!xdr_int(xdrs, &objp->endoblk)) 278 return (FALSE); 279 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, RDC_BMAPBLKSIZE)) 280 return (FALSE); 281 return (TRUE); 282 } 283 284 /* 285 * Data transfer and allocation (v5) 286 */ 287 288 bool_t 289 xdr_net_data5(XDR *xdrs, net_data5 *objp) 290 { 291 292 if (!xdr_int(xdrs, &objp->local_cd)) 293 return (FALSE); 294 if (!xdr_int(xdrs, &objp->cd)) 295 return (FALSE); 296 if (!xdr_int(xdrs, &objp->pos)) 297 return (FALSE); 298 if (!xdr_int(xdrs, &objp->len)) 299 return (FALSE); 300 if (!xdr_int(xdrs, &objp->flag)) 301 return (FALSE); 302 if (!xdr_int(xdrs, &objp->idx)) 303 return (FALSE); 304 if (!xdr_int(xdrs, &objp->seq)) 305 return (FALSE); 306 if (!xdr_int(xdrs, &objp->sfba)) 307 return (FALSE); 308 if (!xdr_int(xdrs, &objp->endoblk)) 309 return (FALSE); 310 if (!xdr_int(xdrs, &objp->nfba)) 311 return (FALSE); 312 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, RDC_MAXDATA)) 313 return (FALSE); 314 return (TRUE); 315 } 316 317 /* 318 * Data transfer and allocation (v6) 319 */ 320 321 bool_t 322 xdr_net_data6(XDR *xdrs, net_data6 *objp) 323 { 324 325 if (!xdr_int(xdrs, &objp->local_cd)) 326 return (FALSE); 327 if (!xdr_int(xdrs, &objp->cd)) 328 return (FALSE); 329 if (!xdr_u_longlong_t(xdrs, &objp->pos)) 330 return (FALSE); 331 if (!xdr_u_longlong_t(xdrs, &objp->qpos)) 332 return (FALSE); 333 if (!xdr_u_longlong_t(xdrs, &objp->sfba)) 334 return (FALSE); 335 if (!xdr_int(xdrs, &objp->nfba)) 336 return (FALSE); 337 if (!xdr_int(xdrs, &objp->len)) 338 return (FALSE); 339 if (!xdr_int(xdrs, &objp->flag)) 340 return (FALSE); 341 if (!xdr_int(xdrs, &objp->idx)) 342 return (FALSE); 343 if (!xdr_u_int(xdrs, &objp->seq)) 344 return (FALSE); 345 if (!xdr_int(xdrs, &objp->endoblk)) 346 return (FALSE); 347 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, RDC_MAXDATA)) 348 return (FALSE); 349 return (TRUE); 350 } 351 352 bool_t 353 xdr_net_pendvec(XDR *xdrs, net_pendvec *objp) 354 { 355 356 if (!xdr_u_longlong_t(xdrs, &objp->apos)) 357 return (FALSE); 358 if (!xdr_u_longlong_t(xdrs, &objp->qpos)) 359 return (FALSE); 360 if (!xdr_int(xdrs, &objp->alen)) 361 return (FALSE); 362 if (!xdr_u_int(xdrs, &objp->seq)) 363 return (FALSE); 364 if (!xdr_int(xdrs, &objp->pindex)) 365 return (FALSE); 366 return (TRUE); 367 } 368 369 bool_t 370 xdr_net_pendvec_t(XDR *xdrs, net_pendvec_t *objp) 371 { 372 373 if (!xdr_net_pendvec(xdrs, objp)) 374 return (FALSE); 375 return (TRUE); 376 } 377 /* 378 * results returned from a netwrite request. (v6) 379 * index = index number of request assigned by server when 380 * requests is broken down into smaller chunks. 381 * result = 0 request ok. 382 * result = 1 request is pending. 383 * result < 0 failure, set with -errno. 384 * If the vecdata array is not empty, then it contains 385 * a list of apos and alen 386 * pairs of previously pending requests that have been written. 387 */ 388 389 bool_t 390 xdr_netwriteres(XDR *xdrs, netwriteres *objp) 391 { 392 393 if (!xdr_int(xdrs, &objp->index)) 394 return (FALSE); 395 if (!xdr_int(xdrs, &objp->result)) 396 return (FALSE); 397 if (!xdr_u_int(xdrs, &objp->seq)) 398 return (FALSE); 399 if (!xdr_array(xdrs, (char **)&objp->vecdata.vecdata_val, (u_int *) &objp->vecdata.vecdata_len, RDC_PENDQLIM, 400 sizeof (net_pendvec_t), (xdrproc_t)xdr_net_pendvec_t)) 401 return (FALSE); 402 return (TRUE); 403 } 404 405 /* 406 * Ping 407 */ 408 409 bool_t 410 xdr_rdc_ping6(XDR *xdrs, rdc_ping6 *objp) 411 { 412 413 if (!xdr_opaque(xdrs, objp->p_ifaddr, RDC_MAXADDR)) 414 return (FALSE); 415 if (!xdr_opaque(xdrs, objp->s_ifaddr, RDC_MAXADDR)) 416 return (FALSE); 417 return (TRUE); 418 } 419 420 bool_t 421 xdr_rdc_ping(XDR *xdrs, rdc_ping *objp) 422 { 423 424 if (!xdr_netbuf(xdrs, &objp->p_ifaddr)) 425 return (FALSE); 426 if (!xdr_netbuf(xdrs, &objp->s_ifaddr)) 427 return (FALSE); 428 return (TRUE); 429 } 430