"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/rpc/xdr/src/xdr-nfs3.h" (16 Sep 2020, 29080 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "xdr-nfs3.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2007-2012 Red Hat, Inc. <http://www.redhat.com>
    3   This file is part of GlusterFS.
    4 
    5   This file is licensed to you under your choice of the GNU Lesser
    6   General Public License, version 3 or any later version (LGPLv3 or
    7   later), or the GNU General Public License, version 2 (GPLv2), in all
    8   cases as published by the Free Software Foundation.
    9 */
   10 
   11 #ifndef _XDR_NFS3_H
   12 #define _XDR_NFS3_H
   13 
   14 #include <rpc/rpc.h>
   15 #include <sys/types.h>
   16 
   17 #define NFS3_FHSIZE 64
   18 #define NFS3_COOKIEVERFSIZE 8
   19 #define NFS3_CREATEVERFSIZE 8
   20 #define NFS3_WRITEVERFSIZE 8
   21 
   22 #define NFS3_ENTRY3_FIXED_SIZE 24
   23 #define NFS3_POSTOPATTR_SIZE 88
   24 #define NFS3_READDIR_RESOK_SIZE                                                \
   25     (NFS3_POSTOPATTR_SIZE + sizeof(bool_t) + NFS3_COOKIEVERFSIZE)
   26 
   27 /* In size of post_op_fh3, the length of the file handle will have to be
   28  * included separately since we have variable length fh. Here we only account
   29  * for the field for handle_follows and for the file handle length field.
   30  */
   31 #define NFS3_POSTOPFH3_FIXED_SIZE (sizeof(bool_t) + sizeof(uint32_t))
   32 
   33 /* Similarly, the size of the entry will have to include the variable length
   34  * file handle and the length of the entry name.
   35  */
   36 #define NFS3_ENTRYP3_FIXED_SIZE                                                \
   37     (NFS3_ENTRY3_FIXED_SIZE + NFS3_POSTOPATTR_SIZE + NFS3_POSTOPFH3_FIXED_SIZE)
   38 
   39 typedef uint64_t uint64;
   40 typedef int64_t int64;
   41 typedef uint32_t uint32;
   42 typedef int32_t int32;
   43 typedef char *filename3;
   44 typedef char *nfspath3;
   45 typedef uint64 fileid3;
   46 typedef uint64 cookie3;
   47 typedef char cookieverf3[NFS3_COOKIEVERFSIZE];
   48 typedef char createverf3[NFS3_CREATEVERFSIZE];
   49 typedef char writeverf3[NFS3_WRITEVERFSIZE];
   50 typedef uint32 uid3;
   51 typedef uint32 gid3;
   52 typedef uint64 size3;
   53 typedef uint64 offset3;
   54 typedef uint32 mode3;
   55 typedef uint32 count3;
   56 
   57 #define NFS3MODE_SETXUID 0x00800
   58 #define NFS3MODE_SETXGID 0x00400
   59 #define NFS3MODE_SAVESWAPTXT 0x00200
   60 #define NFS3MODE_ROWNER 0x00100
   61 #define NFS3MODE_WOWNER 0x00080
   62 #define NFS3MODE_XOWNER 0x00040
   63 #define NFS3MODE_RGROUP 0x00020
   64 #define NFS3MODE_WGROUP 0x00010
   65 #define NFS3MODE_XGROUP 0x00008
   66 #define NFS3MODE_ROTHER 0x00004
   67 #define NFS3MODE_WOTHER 0x00002
   68 #define NFS3MODE_XOTHER 0x00001
   69 
   70 enum nfsstat3 {
   71     NFS3_OK = 0,
   72     NFS3ERR_PERM = 1,
   73     NFS3ERR_NOENT = 2,
   74     NFS3ERR_IO = 5,
   75     NFS3ERR_NXIO = 6,
   76     NFS3ERR_ACCES = 13,
   77     NFS3ERR_EXIST = 17,
   78     NFS3ERR_XDEV = 18,
   79     NFS3ERR_NODEV = 19,
   80     NFS3ERR_NOTDIR = 20,
   81     NFS3ERR_ISDIR = 21,
   82     NFS3ERR_INVAL = 22,
   83     NFS3ERR_FBIG = 27,
   84     NFS3ERR_NOSPC = 28,
   85     NFS3ERR_ROFS = 30,
   86     NFS3ERR_MLINK = 31,
   87     NFS3ERR_NAMETOOLONG = 63,
   88     NFS3ERR_NOTEMPTY = 66,
   89     NFS3ERR_DQUOT = 69,
   90     NFS3ERR_STALE = 70,
   91     NFS3ERR_REMOTE = 71,
   92     NFS3ERR_BADHANDLE = 10001,
   93     NFS3ERR_NOT_SYNC = 10002,
   94     NFS3ERR_BAD_COOKIE = 10003,
   95     NFS3ERR_NOTSUPP = 10004,
   96     NFS3ERR_TOOSMALL = 10005,
   97     NFS3ERR_SERVERFAULT = 10006,
   98     NFS3ERR_BADTYPE = 10007,
   99     NFS3ERR_JUKEBOX = 10008,
  100     NFS3ERR_END_OF_LIST = -1,
  101 };
  102 typedef enum nfsstat3 nfsstat3;
  103 
  104 enum ftype3 {
  105     NF3REG = 1,
  106     NF3DIR = 2,
  107     NF3BLK = 3,
  108     NF3CHR = 4,
  109     NF3LNK = 5,
  110     NF3SOCK = 6,
  111     NF3FIFO = 7,
  112 };
  113 typedef enum ftype3 ftype3;
  114 
  115 struct specdata3 {
  116     uint32 specdata1;
  117     uint32 specdata2;
  118 };
  119 typedef struct specdata3 specdata3;
  120 
  121 struct nfs_fh3 {
  122     struct {
  123         u_int data_len;
  124         char *data_val;
  125     } data;
  126 };
  127 typedef struct nfs_fh3 nfs_fh3;
  128 
  129 struct nfstime3 {
  130     uint32 seconds;
  131     uint32 nseconds;
  132 };
  133 typedef struct nfstime3 nfstime3;
  134 
  135 struct fattr3 {
  136     ftype3 type;
  137     mode3 mode;
  138     uint32 nlink;
  139     uid3 uid;
  140     gid3 gid;
  141     size3 size;
  142     size3 used;
  143     specdata3 rdev;
  144     uint64 fsid;
  145     fileid3 fileid;
  146     nfstime3 atime;
  147     nfstime3 mtime;
  148     nfstime3 ctime;
  149 };
  150 typedef struct fattr3 fattr3;
  151 
  152 struct post_op_attr {
  153     bool_t attributes_follow;
  154     union {
  155         fattr3 attributes;
  156     } post_op_attr_u;
  157 };
  158 typedef struct post_op_attr post_op_attr;
  159 
  160 struct wcc_attr {
  161     size3 size;
  162     nfstime3 mtime;
  163     nfstime3 ctime;
  164 };
  165 typedef struct wcc_attr wcc_attr;
  166 
  167 struct pre_op_attr {
  168     bool_t attributes_follow;
  169     union {
  170         wcc_attr attributes;
  171     } pre_op_attr_u;
  172 };
  173 typedef struct pre_op_attr pre_op_attr;
  174 
  175 struct wcc_data {
  176     pre_op_attr before;
  177     post_op_attr after;
  178 };
  179 typedef struct wcc_data wcc_data;
  180 
  181 struct post_op_fh3 {
  182     bool_t handle_follows;
  183     union {
  184         nfs_fh3 handle;
  185     } post_op_fh3_u;
  186 };
  187 typedef struct post_op_fh3 post_op_fh3;
  188 
  189 enum time_how {
  190     DONT_CHANGE = 0,
  191     SET_TO_SERVER_TIME = 1,
  192     SET_TO_CLIENT_TIME = 2,
  193 };
  194 typedef enum time_how time_how;
  195 
  196 struct set_mode3 {
  197     bool_t set_it;
  198     union {
  199         mode3 mode;
  200     } set_mode3_u;
  201 };
  202 typedef struct set_mode3 set_mode3;
  203 
  204 struct set_uid3 {
  205     bool_t set_it;
  206     union {
  207         uid3 uid;
  208     } set_uid3_u;
  209 };
  210 typedef struct set_uid3 set_uid3;
  211 
  212 struct set_gid3 {
  213     bool_t set_it;
  214     union {
  215         gid3 gid;
  216     } set_gid3_u;
  217 };
  218 typedef struct set_gid3 set_gid3;
  219 
  220 struct set_size3 {
  221     bool_t set_it;
  222     union {
  223         size3 size;
  224     } set_size3_u;
  225 };
  226 typedef struct set_size3 set_size3;
  227 
  228 struct set_atime {
  229     time_how set_it;
  230     union {
  231         nfstime3 atime;
  232     } set_atime_u;
  233 };
  234 typedef struct set_atime set_atime;
  235 
  236 struct set_mtime {
  237     time_how set_it;
  238     union {
  239         nfstime3 mtime;
  240     } set_mtime_u;
  241 };
  242 typedef struct set_mtime set_mtime;
  243 
  244 struct sattr3 {
  245     set_mode3 mode;
  246     set_uid3 uid;
  247     set_gid3 gid;
  248     set_size3 size;
  249     set_atime atime;
  250     set_mtime mtime;
  251 };
  252 typedef struct sattr3 sattr3;
  253 
  254 struct diropargs3 {
  255     nfs_fh3 dir;
  256     filename3 name;
  257 };
  258 typedef struct diropargs3 diropargs3;
  259 
  260 struct getattr3args {
  261     nfs_fh3 object;
  262 };
  263 typedef struct getattr3args getattr3args;
  264 
  265 struct getattr3resok {
  266     fattr3 obj_attributes;
  267 };
  268 typedef struct getattr3resok getattr3resok;
  269 
  270 struct getattr3res {
  271     nfsstat3 status;
  272     union {
  273         getattr3resok resok;
  274     } getattr3res_u;
  275 };
  276 typedef struct getattr3res getattr3res;
  277 
  278 struct sattrguard3 {
  279     bool_t check;
  280     union {
  281         nfstime3 obj_ctime;
  282     } sattrguard3_u;
  283 };
  284 typedef struct sattrguard3 sattrguard3;
  285 
  286 struct setattr3args {
  287     nfs_fh3 object;
  288     sattr3 new_attributes;
  289     sattrguard3 guard;
  290 };
  291 typedef struct setattr3args setattr3args;
  292 
  293 struct setattr3resok {
  294     wcc_data obj_wcc;
  295 };
  296 typedef struct setattr3resok setattr3resok;
  297 
  298 struct setattr3resfail {
  299     wcc_data obj_wcc;
  300 };
  301 typedef struct setattr3resfail setattr3resfail;
  302 
  303 struct setattr3res {
  304     nfsstat3 status;
  305     union {
  306         setattr3resok resok;
  307         setattr3resfail resfail;
  308     } setattr3res_u;
  309 };
  310 typedef struct setattr3res setattr3res;
  311 
  312 struct lookup3args {
  313     diropargs3 what;
  314 };
  315 typedef struct lookup3args lookup3args;
  316 
  317 struct lookup3resok {
  318     nfs_fh3 object;
  319     post_op_attr obj_attributes;
  320     post_op_attr dir_attributes;
  321 };
  322 typedef struct lookup3resok lookup3resok;
  323 
  324 struct lookup3resfail {
  325     post_op_attr dir_attributes;
  326 };
  327 typedef struct lookup3resfail lookup3resfail;
  328 
  329 struct lookup3res {
  330     nfsstat3 status;
  331     union {
  332         lookup3resok resok;
  333         lookup3resfail resfail;
  334     } lookup3res_u;
  335 };
  336 typedef struct lookup3res lookup3res;
  337 #define ACCESS3_READ 0x0001
  338 #define ACCESS3_LOOKUP 0x0002
  339 #define ACCESS3_MODIFY 0x0004
  340 #define ACCESS3_EXTEND 0x0008
  341 #define ACCESS3_DELETE 0x0010
  342 #define ACCESS3_EXECUTE 0x0020
  343 
  344 struct access3args {
  345     nfs_fh3 object;
  346     uint32 access;
  347 };
  348 typedef struct access3args access3args;
  349 
  350 struct access3resok {
  351     post_op_attr obj_attributes;
  352     uint32 access;
  353 };
  354 typedef struct access3resok access3resok;
  355 
  356 struct access3resfail {
  357     post_op_attr obj_attributes;
  358 };
  359 typedef struct access3resfail access3resfail;
  360 
  361 struct access3res {
  362     nfsstat3 status;
  363     union {
  364         access3resok resok;
  365         access3resfail resfail;
  366     } access3res_u;
  367 };
  368 typedef struct access3res access3res;
  369 
  370 struct readlink3args {
  371     nfs_fh3 symlink;
  372 };
  373 typedef struct readlink3args readlink3args;
  374 
  375 struct readlink3resok {
  376     post_op_attr symlink_attributes;
  377     nfspath3 data;
  378 };
  379 typedef struct readlink3resok readlink3resok;
  380 
  381 struct readlink3resfail {
  382     post_op_attr symlink_attributes;
  383 };
  384 typedef struct readlink3resfail readlink3resfail;
  385 
  386 struct readlink3res {
  387     nfsstat3 status;
  388     union {
  389         readlink3resok resok;
  390         readlink3resfail resfail;
  391     } readlink3res_u;
  392 };
  393 typedef struct readlink3res readlink3res;
  394 
  395 struct read3args {
  396     nfs_fh3 file;
  397     offset3 offset;
  398     count3 count;
  399 };
  400 typedef struct read3args read3args;
  401 
  402 struct read3resok {
  403     post_op_attr file_attributes;
  404     count3 count;
  405     bool_t eof;
  406     struct {
  407         u_int data_len;
  408         char *data_val;
  409     } data;
  410 };
  411 typedef struct read3resok read3resok;
  412 
  413 struct read3resfail {
  414     post_op_attr file_attributes;
  415 };
  416 typedef struct read3resfail read3resfail;
  417 
  418 struct read3res {
  419     nfsstat3 status;
  420     union {
  421         read3resok resok;
  422         read3resfail resfail;
  423     } read3res_u;
  424 };
  425 typedef struct read3res read3res;
  426 
  427 enum stable_how {
  428     UNSTABLE = 0,
  429     DATA_SYNC = 1,
  430     FILE_SYNC = 2,
  431 };
  432 typedef enum stable_how stable_how;
  433 
  434 struct write3args {
  435     nfs_fh3 file;
  436     offset3 offset;
  437     count3 count;
  438     stable_how stable;
  439     struct {
  440         u_int data_len;
  441         char *data_val;
  442     } data;
  443 };
  444 typedef struct write3args write3args;
  445 
  446 /* Generally, the protocol allows the file handle to be less than 64 bytes but
  447  * our server does not return file handles less than 64b so we can safely say
  448  * sizeof (nfs_fh3) rather than first trying to extract the fh size of the
  449  * network followed by a sized-read of the file handle.
  450  */
  451 #define NFS3_WRITE3ARGS_SIZE                                                   \
  452     (sizeof(uint32_t) + NFS3_FHSIZE + sizeof(offset3) + sizeof(count3) +       \
  453      sizeof(uint32_t))
  454 struct write3resok {
  455     wcc_data file_wcc;
  456     count3 count;
  457     stable_how committed;
  458     writeverf3 verf;
  459 };
  460 typedef struct write3resok write3resok;
  461 
  462 struct write3resfail {
  463     wcc_data file_wcc;
  464 };
  465 typedef struct write3resfail write3resfail;
  466 
  467 struct write3res {
  468     nfsstat3 status;
  469     union {
  470         write3resok resok;
  471         write3resfail resfail;
  472     } write3res_u;
  473 };
  474 typedef struct write3res write3res;
  475 
  476 enum createmode3 {
  477     UNCHECKED = 0,
  478     GUARDED = 1,
  479     EXCLUSIVE = 2,
  480 };
  481 typedef enum createmode3 createmode3;
  482 
  483 struct createhow3 {
  484     createmode3 mode;
  485     union {
  486         sattr3 obj_attributes;
  487         createverf3 verf;
  488     } createhow3_u;
  489 };
  490 typedef struct createhow3 createhow3;
  491 
  492 struct create3args {
  493     diropargs3 where;
  494     createhow3 how;
  495 };
  496 typedef struct create3args create3args;
  497 
  498 struct create3resok {
  499     post_op_fh3 obj;
  500     post_op_attr obj_attributes;
  501     wcc_data dir_wcc;
  502 };
  503 typedef struct create3resok create3resok;
  504 
  505 struct create3resfail {
  506     wcc_data dir_wcc;
  507 };
  508 typedef struct create3resfail create3resfail;
  509 
  510 struct create3res {
  511     nfsstat3 status;
  512     union {
  513         create3resok resok;
  514         create3resfail resfail;
  515     } create3res_u;
  516 };
  517 typedef struct create3res create3res;
  518 
  519 struct mkdir3args {
  520     diropargs3 where;
  521     sattr3 attributes;
  522 };
  523 typedef struct mkdir3args mkdir3args;
  524 
  525 struct mkdir3resok {
  526     post_op_fh3 obj;
  527     post_op_attr obj_attributes;
  528     wcc_data dir_wcc;
  529 };
  530 typedef struct mkdir3resok mkdir3resok;
  531 
  532 struct mkdir3resfail {
  533     wcc_data dir_wcc;
  534 };
  535 typedef struct mkdir3resfail mkdir3resfail;
  536 
  537 struct mkdir3res {
  538     nfsstat3 status;
  539     union {
  540         mkdir3resok resok;
  541         mkdir3resfail resfail;
  542     } mkdir3res_u;
  543 };
  544 typedef struct mkdir3res mkdir3res;
  545 
  546 struct symlinkdata3 {
  547     sattr3 symlink_attributes;
  548     nfspath3 symlink_data;
  549 };
  550 typedef struct symlinkdata3 symlinkdata3;
  551 
  552 struct symlink3args {
  553     diropargs3 where;
  554     symlinkdata3 symlink;
  555 };
  556 typedef struct symlink3args symlink3args;
  557 
  558 struct symlink3resok {
  559     post_op_fh3 obj;
  560     post_op_attr obj_attributes;
  561     wcc_data dir_wcc;
  562 };
  563 typedef struct symlink3resok symlink3resok;
  564 
  565 struct symlink3resfail {
  566     wcc_data dir_wcc;
  567 };
  568 typedef struct symlink3resfail symlink3resfail;
  569 
  570 struct symlink3res {
  571     nfsstat3 status;
  572     union {
  573         symlink3resok resok;
  574         symlink3resfail resfail;
  575     } symlink3res_u;
  576 };
  577 typedef struct symlink3res symlink3res;
  578 
  579 struct devicedata3 {
  580     sattr3 dev_attributes;
  581     specdata3 spec;
  582 };
  583 typedef struct devicedata3 devicedata3;
  584 
  585 struct mknoddata3 {
  586     ftype3 type;
  587     union {
  588         devicedata3 device;
  589         sattr3 pipe_attributes;
  590     } mknoddata3_u;
  591 };
  592 typedef struct mknoddata3 mknoddata3;
  593 
  594 struct mknod3args {
  595     diropargs3 where;
  596     mknoddata3 what;
  597 };
  598 typedef struct mknod3args mknod3args;
  599 
  600 struct mknod3resok {
  601     post_op_fh3 obj;
  602     post_op_attr obj_attributes;
  603     wcc_data dir_wcc;
  604 };
  605 typedef struct mknod3resok mknod3resok;
  606 
  607 struct mknod3resfail {
  608     wcc_data dir_wcc;
  609 };
  610 typedef struct mknod3resfail mknod3resfail;
  611 
  612 struct mknod3res {
  613     nfsstat3 status;
  614     union {
  615         mknod3resok resok;
  616         mknod3resfail resfail;
  617     } mknod3res_u;
  618 };
  619 typedef struct mknod3res mknod3res;
  620 
  621 struct remove3args {
  622     diropargs3 object;
  623 };
  624 typedef struct remove3args remove3args;
  625 
  626 struct remove3resok {
  627     wcc_data dir_wcc;
  628 };
  629 typedef struct remove3resok remove3resok;
  630 
  631 struct remove3resfail {
  632     wcc_data dir_wcc;
  633 };
  634 typedef struct remove3resfail remove3resfail;
  635 
  636 struct remove3res {
  637     nfsstat3 status;
  638     union {
  639         remove3resok resok;
  640         remove3resfail resfail;
  641     } remove3res_u;
  642 };
  643 typedef struct remove3res remove3res;
  644 
  645 struct rmdir3args {
  646     diropargs3 object;
  647 };
  648 typedef struct rmdir3args rmdir3args;
  649 
  650 struct rmdir3resok {
  651     wcc_data dir_wcc;
  652 };
  653 typedef struct rmdir3resok rmdir3resok;
  654 
  655 struct rmdir3resfail {
  656     wcc_data dir_wcc;
  657 };
  658 typedef struct rmdir3resfail rmdir3resfail;
  659 
  660 struct rmdir3res {
  661     nfsstat3 status;
  662     union {
  663         rmdir3resok resok;
  664         rmdir3resfail resfail;
  665     } rmdir3res_u;
  666 };
  667 typedef struct rmdir3res rmdir3res;
  668 
  669 struct rename3args {
  670     diropargs3 from;
  671     diropargs3 to;
  672 };
  673 typedef struct rename3args rename3args;
  674 
  675 struct rename3resok {
  676     wcc_data fromdir_wcc;
  677     wcc_data todir_wcc;
  678 };
  679 typedef struct rename3resok rename3resok;
  680 
  681 struct rename3resfail {
  682     wcc_data fromdir_wcc;
  683     wcc_data todir_wcc;
  684 };
  685 typedef struct rename3resfail rename3resfail;
  686 
  687 struct rename3res {
  688     nfsstat3 status;
  689     union {
  690         rename3resok resok;
  691         rename3resfail resfail;
  692     } rename3res_u;
  693 };
  694 typedef struct rename3res rename3res;
  695 
  696 struct link3args {
  697     nfs_fh3 file;
  698     diropargs3 link;
  699 };
  700 typedef struct link3args link3args;
  701 
  702 struct link3resok {
  703     post_op_attr file_attributes;
  704     wcc_data linkdir_wcc;
  705 };
  706 typedef struct link3resok link3resok;
  707 
  708 struct link3resfail {
  709     post_op_attr file_attributes;
  710     wcc_data linkdir_wcc;
  711 };
  712 typedef struct link3resfail link3resfail;
  713 
  714 struct link3res {
  715     nfsstat3 status;
  716     union {
  717         link3resok resok;
  718         link3resfail resfail;
  719     } link3res_u;
  720 };
  721 typedef struct link3res link3res;
  722 
  723 struct readdir3args {
  724     nfs_fh3 dir;
  725     cookie3 cookie;
  726     cookieverf3 cookieverf;
  727     count3 count;
  728 };
  729 typedef struct readdir3args readdir3args;
  730 
  731 struct entry3 {
  732     fileid3 fileid;
  733     filename3 name;
  734     cookie3 cookie;
  735     struct entry3 *nextentry;
  736 };
  737 typedef struct entry3 entry3;
  738 
  739 struct dirlist3 {
  740     entry3 *entries;
  741     bool_t eof;
  742 };
  743 typedef struct dirlist3 dirlist3;
  744 
  745 struct readdir3resok {
  746     post_op_attr dir_attributes;
  747     cookieverf3 cookieverf;
  748     dirlist3 reply;
  749 };
  750 typedef struct readdir3resok readdir3resok;
  751 
  752 struct readdir3resfail {
  753     post_op_attr dir_attributes;
  754 };
  755 typedef struct readdir3resfail readdir3resfail;
  756 
  757 struct readdir3res {
  758     nfsstat3 status;
  759     union {
  760         readdir3resok resok;
  761         readdir3resfail resfail;
  762     } readdir3res_u;
  763 };
  764 typedef struct readdir3res readdir3res;
  765 
  766 struct readdirp3args {
  767     nfs_fh3 dir;
  768     cookie3 cookie;
  769     cookieverf3 cookieverf;
  770     count3 dircount;
  771     count3 maxcount;
  772 };
  773 typedef struct readdirp3args readdirp3args;
  774 
  775 struct entryp3 {
  776     fileid3 fileid;
  777     filename3 name;
  778     cookie3 cookie;
  779     post_op_attr name_attributes;
  780     post_op_fh3 name_handle;
  781     struct entryp3 *nextentry;
  782 };
  783 typedef struct entryp3 entryp3;
  784 
  785 struct dirlistp3 {
  786     entryp3 *entries;
  787     bool_t eof;
  788 };
  789 typedef struct dirlistp3 dirlistp3;
  790 
  791 struct readdirp3resok {
  792     post_op_attr dir_attributes;
  793     cookieverf3 cookieverf;
  794     dirlistp3 reply;
  795 };
  796 typedef struct readdirp3resok readdirp3resok;
  797 
  798 struct readdirp3resfail {
  799     post_op_attr dir_attributes;
  800 };
  801 typedef struct readdirp3resfail readdirp3resfail;
  802 
  803 struct readdirp3res {
  804     nfsstat3 status;
  805     union {
  806         readdirp3resok resok;
  807         readdirp3resfail resfail;
  808     } readdirp3res_u;
  809 };
  810 typedef struct readdirp3res readdirp3res;
  811 
  812 struct fsstat3args {
  813     nfs_fh3 fsroot;
  814 };
  815 typedef struct fsstat3args fsstat3args;
  816 
  817 struct fsstat3resok {
  818     post_op_attr obj_attributes;
  819     size3 tbytes;
  820     size3 fbytes;
  821     size3 abytes;
  822     size3 tfiles;
  823     size3 ffiles;
  824     size3 afiles;
  825     uint32 invarsec;
  826 };
  827 typedef struct fsstat3resok fsstat3resok;
  828 
  829 struct fsstat3resfail {
  830     post_op_attr obj_attributes;
  831 };
  832 typedef struct fsstat3resfail fsstat3resfail;
  833 
  834 struct fsstat3res {
  835     nfsstat3 status;
  836     union {
  837         fsstat3resok resok;
  838         fsstat3resfail resfail;
  839     } fsstat3res_u;
  840 };
  841 typedef struct fsstat3res fsstat3res;
  842 #define FSF3_LINK 0x0001
  843 #define FSF3_SYMLINK 0x0002
  844 #define FSF3_HOMOGENEOUS 0x0008
  845 #define FSF3_CANSETTIME 0x0010
  846 
  847 struct fsinfo3args {
  848     nfs_fh3 fsroot;
  849 };
  850 typedef struct fsinfo3args fsinfo3args;
  851 
  852 struct fsinfo3resok {
  853     post_op_attr obj_attributes;
  854     uint32 rtmax;
  855     uint32 rtpref;
  856     uint32 rtmult;
  857     uint32 wtmax;
  858     uint32 wtpref;
  859     uint32 wtmult;
  860     uint32 dtpref;
  861     size3 maxfilesize;
  862     nfstime3 time_delta;
  863     uint32 properties;
  864 };
  865 typedef struct fsinfo3resok fsinfo3resok;
  866 
  867 struct fsinfo3resfail {
  868     post_op_attr obj_attributes;
  869 };
  870 typedef struct fsinfo3resfail fsinfo3resfail;
  871 
  872 struct fsinfo3res {
  873     nfsstat3 status;
  874     union {
  875         fsinfo3resok resok;
  876         fsinfo3resfail resfail;
  877     } fsinfo3res_u;
  878 };
  879 typedef struct fsinfo3res fsinfo3res;
  880 
  881 struct pathconf3args {
  882     nfs_fh3 object;
  883 };
  884 typedef struct pathconf3args pathconf3args;
  885 
  886 struct pathconf3resok {
  887     post_op_attr obj_attributes;
  888     uint32 linkmax;
  889     uint32 name_max;
  890     bool_t no_trunc;
  891     bool_t chown_restricted;
  892     bool_t case_insensitive;
  893     bool_t case_preserving;
  894 };
  895 typedef struct pathconf3resok pathconf3resok;
  896 
  897 struct pathconf3resfail {
  898     post_op_attr obj_attributes;
  899 };
  900 typedef struct pathconf3resfail pathconf3resfail;
  901 
  902 struct pathconf3res {
  903     nfsstat3 status;
  904     union {
  905         pathconf3resok resok;
  906         pathconf3resfail resfail;
  907     } pathconf3res_u;
  908 };
  909 typedef struct pathconf3res pathconf3res;
  910 
  911 struct commit3args {
  912     nfs_fh3 file;
  913     offset3 offset;
  914     count3 count;
  915 };
  916 typedef struct commit3args commit3args;
  917 
  918 struct commit3resok {
  919     wcc_data file_wcc;
  920     writeverf3 verf;
  921 };
  922 typedef struct commit3resok commit3resok;
  923 
  924 struct commit3resfail {
  925     wcc_data file_wcc;
  926 };
  927 typedef struct commit3resfail commit3resfail;
  928 
  929 struct commit3res {
  930     nfsstat3 status;
  931     union {
  932         commit3resok resok;
  933         commit3resfail resfail;
  934     } commit3res_u;
  935 };
  936 typedef struct commit3res commit3res;
  937 #define MNTPATHLEN 1024
  938 #define MNTNAMLEN 255
  939 #define FHSIZE3 NFS3_FHSIZE
  940 
  941 typedef struct {
  942     u_int fhandle3_len;
  943     char *fhandle3_val;
  944 } fhandle3;
  945 
  946 typedef char *dirpath;
  947 
  948 typedef char *name;
  949 
  950 enum mountstat3 {
  951     MNT3_OK = 0,
  952     MNT3ERR_PERM = 1,
  953     MNT3ERR_NOENT = 2,
  954     MNT3ERR_IO = 5,
  955     MNT3ERR_ACCES = 13,
  956     MNT3ERR_NOTDIR = 20,
  957     MNT3ERR_INVAL = 22,
  958     MNT3ERR_NAMETOOLONG = 63,
  959     MNT3ERR_NOTSUPP = 10004,
  960     MNT3ERR_SERVERFAULT = 10006,
  961 };
  962 typedef enum mountstat3 mountstat3;
  963 
  964 struct mountres3_ok {
  965     fhandle3 fhandle;
  966     struct {
  967         u_int auth_flavors_len;
  968         int *auth_flavors_val;
  969     } auth_flavors;
  970 };
  971 typedef struct mountres3_ok mountres3_ok;
  972 
  973 struct mountres3 {
  974     mountstat3 fhs_status;
  975     union {
  976         mountres3_ok mountinfo;
  977     } mountres3_u;
  978 };
  979 typedef struct mountres3 mountres3;
  980 
  981 typedef struct mountbody *mountlist;
  982 
  983 struct mountbody {
  984     name ml_hostname;
  985     dirpath ml_directory;
  986     mountlist ml_next;
  987 };
  988 typedef struct mountbody mountbody;
  989 
  990 typedef struct groupnode *groups;
  991 
  992 struct groupnode {
  993     name gr_name;
  994     groups gr_next;
  995 };
  996 typedef struct groupnode groupnode;
  997 
  998 typedef struct exportnode *exports;
  999 
 1000 struct exportnode {
 1001     dirpath ex_dir;
 1002     groups ex_groups;
 1003     exports ex_next;
 1004 };
 1005 typedef struct exportnode exportnode;
 1006 
 1007 #define NFS_PROGRAM 100003
 1008 #define NFS_V3 3
 1009 
 1010 #define NFS3_NULL 0
 1011 #define NFS3_GETATTR 1
 1012 #define NFS3_SETATTR 2
 1013 #define NFS3_LOOKUP 3
 1014 #define NFS3_ACCESS 4
 1015 #define NFS3_READLINK 5
 1016 #define NFS3_READ 6
 1017 #define NFS3_WRITE 7
 1018 #define NFS3_CREATE 8
 1019 #define NFS3_MKDIR 9
 1020 #define NFS3_SYMLINK 10
 1021 #define NFS3_MKNOD 11
 1022 #define NFS3_REMOVE 12
 1023 #define NFS3_RMDIR 13
 1024 #define NFS3_RENAME 14
 1025 #define NFS3_LINK 15
 1026 #define NFS3_READDIR 16
 1027 #define NFS3_READDIRP 17
 1028 #define NFS3_FSSTAT 18
 1029 #define NFS3_FSINFO 19
 1030 #define NFS3_PATHCONF 20
 1031 #define NFS3_COMMIT 21
 1032 #define NFS3_PROC_COUNT 22
 1033 
 1034 #define MOUNT_PROGRAM 100005
 1035 #define MOUNT_V3 3
 1036 #define MOUNT_V1 1
 1037 
 1038 #define MOUNT3_NULL 0
 1039 #define MOUNT3_MNT 1
 1040 #define MOUNT3_DUMP 2
 1041 #define MOUNT3_UMNT 3
 1042 #define MOUNT3_UMNTALL 4
 1043 #define MOUNT3_EXPORT 5
 1044 #define MOUNT3_PROC_COUNT 6
 1045 
 1046 #define MOUNT1_NULL 0
 1047 #define MOUNT1_MNT 1
 1048 #define MOUNT1_DUMP 2
 1049 #define MOUNT1_UMNT 3
 1050 #define MOUNT1_UMNTALL 4
 1051 #define MOUNT1_EXPORT 5
 1052 #define MOUNT1_PROC_COUNT 6
 1053 /* the xdr functions */
 1054 
 1055 extern bool_t
 1056 xdr_uint64(XDR *, uint64 *);
 1057 extern bool_t
 1058 xdr_int64(XDR *, int64 *);
 1059 extern bool_t
 1060 xdr_uint32(XDR *, uint32 *);
 1061 extern bool_t
 1062 xdr_int32(XDR *, int32 *);
 1063 extern bool_t
 1064 xdr_filename3(XDR *, filename3 *);
 1065 extern bool_t
 1066 xdr_nfspath3(XDR *, nfspath3 *);
 1067 extern bool_t
 1068 xdr_fileid3(XDR *, fileid3 *);
 1069 extern bool_t
 1070 xdr_cookie3(XDR *, cookie3 *);
 1071 extern bool_t
 1072 xdr_cookieverf3(XDR *, cookieverf3);
 1073 extern bool_t
 1074 xdr_createverf3(XDR *, createverf3);
 1075 extern bool_t
 1076 xdr_writeverf3(XDR *, writeverf3);
 1077 extern bool_t
 1078 xdr_uid3(XDR *, uid3 *);
 1079 extern bool_t
 1080 xdr_gid3(XDR *, gid3 *);
 1081 extern bool_t
 1082 xdr_size3(XDR *, size3 *);
 1083 extern bool_t
 1084 xdr_offset3(XDR *, offset3 *);
 1085 extern bool_t
 1086 xdr_mode3(XDR *, mode3 *);
 1087 extern bool_t
 1088 xdr_count3(XDR *, count3 *);
 1089 extern bool_t
 1090 xdr_nfsstat3(XDR *, nfsstat3 *);
 1091 extern bool_t
 1092 xdr_ftype3(XDR *, ftype3 *);
 1093 extern bool_t
 1094 xdr_specdata3(XDR *, specdata3 *);
 1095 extern bool_t
 1096 xdr_nfs_fh3(XDR *, nfs_fh3 *);
 1097 extern bool_t
 1098 xdr_nfstime3(XDR *, nfstime3 *);
 1099 extern bool_t
 1100 xdr_fattr3(XDR *, fattr3 *);
 1101 extern bool_t
 1102 xdr_post_op_attr(XDR *, post_op_attr *);
 1103 extern bool_t
 1104 xdr_wcc_attr(XDR *, wcc_attr *);
 1105 extern bool_t
 1106 xdr_pre_op_attr(XDR *, pre_op_attr *);
 1107 extern bool_t
 1108 xdr_wcc_data(XDR *, wcc_data *);
 1109 extern bool_t
 1110 xdr_post_op_fh3(XDR *, post_op_fh3 *);
 1111 extern bool_t
 1112 xdr_time_how(XDR *, time_how *);
 1113 extern bool_t
 1114 xdr_set_mode3(XDR *, set_mode3 *);
 1115 extern bool_t
 1116 xdr_set_uid3(XDR *, set_uid3 *);
 1117 extern bool_t
 1118 xdr_set_gid3(XDR *, set_gid3 *);
 1119 extern bool_t
 1120 xdr_set_size3(XDR *, set_size3 *);
 1121 extern bool_t
 1122 xdr_set_atime(XDR *, set_atime *);
 1123 extern bool_t
 1124 xdr_set_mtime(XDR *, set_mtime *);
 1125 extern bool_t
 1126 xdr_sattr3(XDR *, sattr3 *);
 1127 extern bool_t
 1128 xdr_diropargs3(XDR *, diropargs3 *);
 1129 extern bool_t
 1130 xdr_getattr3args(XDR *, getattr3args *);
 1131 extern bool_t
 1132 xdr_getattr3resok(XDR *, getattr3resok *);
 1133 extern bool_t
 1134 xdr_getattr3res(XDR *, getattr3res *);
 1135 extern bool_t
 1136 xdr_sattrguard3(XDR *, sattrguard3 *);
 1137 extern bool_t
 1138 xdr_setattr3args(XDR *, setattr3args *);
 1139 extern bool_t
 1140 xdr_setattr3resok(XDR *, setattr3resok *);
 1141 extern bool_t
 1142 xdr_setattr3resfail(XDR *, setattr3resfail *);
 1143 extern bool_t
 1144 xdr_setattr3res(XDR *, setattr3res *);
 1145 extern bool_t
 1146 xdr_lookup3args(XDR *, lookup3args *);
 1147 extern bool_t
 1148 xdr_lookup3resok(XDR *, lookup3resok *);
 1149 extern bool_t
 1150 xdr_lookup3resfail(XDR *, lookup3resfail *);
 1151 extern bool_t
 1152 xdr_lookup3res(XDR *, lookup3res *);
 1153 extern bool_t
 1154 xdr_access3args(XDR *, access3args *);
 1155 extern bool_t
 1156 xdr_access3resok(XDR *, access3resok *);
 1157 extern bool_t
 1158 xdr_access3resfail(XDR *, access3resfail *);
 1159 extern bool_t
 1160 xdr_access3res(XDR *, access3res *);
 1161 extern bool_t
 1162 xdr_readlink3args(XDR *, readlink3args *);
 1163 extern bool_t
 1164 xdr_readlink3resok(XDR *, readlink3resok *);
 1165 extern bool_t
 1166 xdr_readlink3resfail(XDR *, readlink3resfail *);
 1167 extern bool_t
 1168 xdr_readlink3res(XDR *, readlink3res *);
 1169 extern bool_t
 1170 xdr_read3args(XDR *, read3args *);
 1171 extern bool_t
 1172 xdr_read3resok(XDR *, read3resok *);
 1173 extern bool_t
 1174 xdr_read3resfail(XDR *, read3resfail *);
 1175 extern bool_t
 1176 xdr_read3res(XDR *, read3res *);
 1177 extern bool_t
 1178 xdr_read3res_nocopy(XDR *xdrs, read3res *objp);
 1179 extern bool_t
 1180 xdr_stable_how(XDR *, stable_how *);
 1181 extern bool_t
 1182 xdr_write3args(XDR *, write3args *);
 1183 extern bool_t
 1184 xdr_write3resok(XDR *, write3resok *);
 1185 extern bool_t
 1186 xdr_write3resfail(XDR *, write3resfail *);
 1187 extern bool_t
 1188 xdr_write3res(XDR *, write3res *);
 1189 extern bool_t
 1190 xdr_createmode3(XDR *, createmode3 *);
 1191 extern bool_t
 1192 xdr_createhow3(XDR *, createhow3 *);
 1193 extern bool_t
 1194 xdr_create3args(XDR *, create3args *);
 1195 extern bool_t
 1196 xdr_create3resok(XDR *, create3resok *);
 1197 extern bool_t
 1198 xdr_create3resfail(XDR *, create3resfail *);
 1199 extern bool_t
 1200 xdr_create3res(XDR *, create3res *);
 1201 extern bool_t
 1202 xdr_mkdir3args(XDR *, mkdir3args *);
 1203 extern bool_t
 1204 xdr_mkdir3resok(XDR *, mkdir3resok *);
 1205 extern bool_t
 1206 xdr_mkdir3resfail(XDR *, mkdir3resfail *);
 1207 extern bool_t
 1208 xdr_mkdir3res(XDR *, mkdir3res *);
 1209 extern bool_t
 1210 xdr_symlinkdata3(XDR *, symlinkdata3 *);
 1211 extern bool_t
 1212 xdr_symlink3args(XDR *, symlink3args *);
 1213 extern bool_t
 1214 xdr_symlink3resok(XDR *, symlink3resok *);
 1215 extern bool_t
 1216 xdr_symlink3resfail(XDR *, symlink3resfail *);
 1217 extern bool_t
 1218 xdr_symlink3res(XDR *, symlink3res *);
 1219 extern bool_t
 1220 xdr_devicedata3(XDR *, devicedata3 *);
 1221 extern bool_t
 1222 xdr_mknoddata3(XDR *, mknoddata3 *);
 1223 extern bool_t
 1224 xdr_mknod3args(XDR *, mknod3args *);
 1225 extern bool_t
 1226 xdr_mknod3resok(XDR *, mknod3resok *);
 1227 extern bool_t
 1228 xdr_mknod3resfail(XDR *, mknod3resfail *);
 1229 extern bool_t
 1230 xdr_mknod3res(XDR *, mknod3res *);
 1231 extern bool_t
 1232 xdr_remove3args(XDR *, remove3args *);
 1233 extern bool_t
 1234 xdr_remove3resok(XDR *, remove3resok *);
 1235 extern bool_t
 1236 xdr_remove3resfail(XDR *, remove3resfail *);
 1237 extern bool_t
 1238 xdr_remove3res(XDR *, remove3res *);
 1239 extern bool_t
 1240 xdr_rmdir3args(XDR *, rmdir3args *);
 1241 extern bool_t
 1242 xdr_rmdir3resok(XDR *, rmdir3resok *);
 1243 extern bool_t
 1244 xdr_rmdir3resfail(XDR *, rmdir3resfail *);
 1245 extern bool_t
 1246 xdr_rmdir3res(XDR *, rmdir3res *);
 1247 extern bool_t
 1248 xdr_rename3args(XDR *, rename3args *);
 1249 extern bool_t
 1250 xdr_rename3resok(XDR *, rename3resok *);
 1251 extern bool_t
 1252 xdr_rename3resfail(XDR *, rename3resfail *);
 1253 extern bool_t
 1254 xdr_rename3res(XDR *, rename3res *);
 1255 extern bool_t
 1256 xdr_link3args(XDR *, link3args *);
 1257 extern bool_t
 1258 xdr_link3resok(XDR *, link3resok *);
 1259 extern bool_t
 1260 xdr_link3resfail(XDR *, link3resfail *);
 1261 extern bool_t
 1262 xdr_link3res(XDR *, link3res *);
 1263 extern bool_t
 1264 xdr_readdir3args(XDR *, readdir3args *);
 1265 extern bool_t
 1266 xdr_entry3(XDR *, entry3 *);
 1267 extern bool_t
 1268 xdr_dirlist3(XDR *, dirlist3 *);
 1269 extern bool_t
 1270 xdr_readdir3resok(XDR *, readdir3resok *);
 1271 extern bool_t
 1272 xdr_readdir3resfail(XDR *, readdir3resfail *);
 1273 extern bool_t
 1274 xdr_readdir3res(XDR *, readdir3res *);
 1275 extern bool_t
 1276 xdr_readdirp3args(XDR *, readdirp3args *);
 1277 extern bool_t
 1278 xdr_entryp3(XDR *, entryp3 *);
 1279 extern bool_t
 1280 xdr_dirlistp3(XDR *, dirlistp3 *);
 1281 extern bool_t
 1282 xdr_readdirp3resok(XDR *, readdirp3resok *);
 1283 extern bool_t
 1284 xdr_readdirp3resfail(XDR *, readdirp3resfail *);
 1285 extern bool_t
 1286 xdr_readdirp3res(XDR *, readdirp3res *);
 1287 extern bool_t
 1288 xdr_fsstat3args(XDR *, fsstat3args *);
 1289 extern bool_t
 1290 xdr_fsstat3resok(XDR *, fsstat3resok *);
 1291 extern bool_t
 1292 xdr_fsstat3resfail(XDR *, fsstat3resfail *);
 1293 extern bool_t
 1294 xdr_fsstat3res(XDR *, fsstat3res *);
 1295 extern bool_t
 1296 xdr_fsinfo3args(XDR *, fsinfo3args *);
 1297 extern bool_t
 1298 xdr_fsinfo3resok(XDR *, fsinfo3resok *);
 1299 extern bool_t
 1300 xdr_fsinfo3resfail(XDR *, fsinfo3resfail *);
 1301 extern bool_t
 1302 xdr_fsinfo3res(XDR *, fsinfo3res *);
 1303 extern bool_t
 1304 xdr_pathconf3args(XDR *, pathconf3args *);
 1305 extern bool_t
 1306 xdr_pathconf3resok(XDR *, pathconf3resok *);
 1307 extern bool_t
 1308 xdr_pathconf3resfail(XDR *, pathconf3resfail *);
 1309 extern bool_t
 1310 xdr_pathconf3res(XDR *, pathconf3res *);
 1311 extern bool_t
 1312 xdr_commit3args(XDR *, commit3args *);
 1313 extern bool_t
 1314 xdr_commit3resok(XDR *, commit3resok *);
 1315 extern bool_t
 1316 xdr_commit3resfail(XDR *, commit3resfail *);
 1317 extern bool_t
 1318 xdr_commit3res(XDR *, commit3res *);
 1319 extern bool_t
 1320 xdr_fhandle3(XDR *, fhandle3 *);
 1321 extern bool_t
 1322 xdr_dirpath(XDR *, dirpath *);
 1323 extern bool_t
 1324 xdr_name(XDR *, name *);
 1325 extern bool_t
 1326 xdr_mountstat3(XDR *, mountstat3 *);
 1327 extern bool_t
 1328 xdr_mountres3_ok(XDR *, mountres3_ok *);
 1329 extern bool_t
 1330 xdr_mountres3(XDR *, mountres3 *);
 1331 extern bool_t
 1332 xdr_mountlist(XDR *, mountlist *);
 1333 extern bool_t
 1334 xdr_mountbody(XDR *, mountbody *);
 1335 extern bool_t
 1336 xdr_groups(XDR *, groups *);
 1337 extern bool_t
 1338 xdr_groupnode(XDR *, groupnode *);
 1339 extern bool_t
 1340 xdr_exports(XDR *, exports *);
 1341 extern bool_t
 1342 xdr_exportnode(XDR *, exportnode *);
 1343 
 1344 extern void
 1345 xdr_free_exports_list(struct exportnode *first);
 1346 extern void
 1347 xdr_free_mountlist(mountlist ml);
 1348 
 1349 extern void
 1350 xdr_free_write3args_nocopy(write3args *wa);
 1351 #endif