nfs_prot.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. /*
  2. * Please do not edit this file.
  3. * It was generated using rpcgen.
  4. */
  5. #ifndef _NFS_PROT_H_RPCGEN
  6. #define _NFS_PROT_H_RPCGEN
  7. #include <rpc/rpc.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define NFS_PORT 2049
  12. #define NFS_MAXDATA 8192
  13. #define NFS_MAXPATHLEN 1024
  14. #define NFS_MAXNAMLEN 255
  15. #define NFS_FHSIZE 32
  16. #define NFS_COOKIESIZE 4
  17. #define NFS_FIFO_DEV -1
  18. #define NFSMODE_FMT 0170000
  19. #define NFSMODE_DIR 0040000
  20. #define NFSMODE_CHR 0020000
  21. #define NFSMODE_BLK 0060000
  22. #define NFSMODE_REG 0100000
  23. #define NFSMODE_LNK 0120000
  24. #define NFSMODE_SOCK 0140000
  25. #define NFSMODE_FIFO 0010000
  26. enum nfsstat {
  27. NFS_OK = 0,
  28. NFSERR_PERM = 1,
  29. NFSERR_NOENT = 2,
  30. NFSERR_IO = 5,
  31. NFSERR_NXIO = 6,
  32. NFSERR_ACCES = 13,
  33. NFSERR_EXIST = 17,
  34. NFSERR_NODEV = 19,
  35. NFSERR_NOTDIR = 20,
  36. NFSERR_ISDIR = 21,
  37. NFSERR_FBIG = 27,
  38. NFSERR_NOSPC = 28,
  39. NFSERR_ROFS = 30,
  40. NFSERR_NAMETOOLONG = 63,
  41. NFSERR_NOTEMPTY = 66,
  42. NFSERR_DQUOT = 69,
  43. NFSERR_STALE = 70,
  44. NFSERR_WFLUSH = 99,
  45. };
  46. typedef enum nfsstat nfsstat;
  47. enum ftype {
  48. NFNON = 0,
  49. NFREG = 1,
  50. NFDIR = 2,
  51. NFBLK = 3,
  52. NFCHR = 4,
  53. NFLNK = 5,
  54. NFSOCK = 6,
  55. NFBAD = 7,
  56. NFFIFO = 8,
  57. };
  58. typedef enum ftype ftype;
  59. struct nfs_fh {
  60. char data[NFS_FHSIZE];
  61. };
  62. typedef struct nfs_fh nfs_fh;
  63. struct nfstime {
  64. u_int seconds;
  65. u_int useconds;
  66. };
  67. typedef struct nfstime nfstime;
  68. struct fattr {
  69. ftype type;
  70. u_int mode;
  71. u_int nlink;
  72. u_int uid;
  73. u_int gid;
  74. u_int size;
  75. u_int blocksize;
  76. u_int rdev;
  77. u_int blocks;
  78. u_int fsid;
  79. u_int fileid;
  80. nfstime atime;
  81. nfstime mtime;
  82. nfstime ctime;
  83. };
  84. typedef struct fattr fattr;
  85. struct sattr {
  86. u_int mode;
  87. u_int uid;
  88. u_int gid;
  89. u_int size;
  90. nfstime atime;
  91. nfstime mtime;
  92. };
  93. typedef struct sattr sattr;
  94. typedef char *filename;
  95. typedef char *nfspath;
  96. struct attrstat {
  97. nfsstat status;
  98. union {
  99. fattr attributes;
  100. } attrstat_u;
  101. };
  102. typedef struct attrstat attrstat;
  103. struct sattrargs {
  104. nfs_fh file;
  105. sattr attributes;
  106. };
  107. typedef struct sattrargs sattrargs;
  108. struct diropargs {
  109. nfs_fh dir;
  110. filename name;
  111. };
  112. typedef struct diropargs diropargs;
  113. struct diropokres {
  114. nfs_fh file;
  115. fattr attributes;
  116. };
  117. typedef struct diropokres diropokres;
  118. struct diropres {
  119. nfsstat status;
  120. union {
  121. diropokres diropres;
  122. } diropres_u;
  123. };
  124. typedef struct diropres diropres;
  125. struct readlinkres {
  126. nfsstat status;
  127. union {
  128. nfspath data;
  129. } readlinkres_u;
  130. };
  131. typedef struct readlinkres readlinkres;
  132. struct readargs {
  133. nfs_fh file;
  134. u_int offset;
  135. u_int count;
  136. u_int totalcount;
  137. };
  138. typedef struct readargs readargs;
  139. struct readokres {
  140. fattr attributes;
  141. struct {
  142. u_int data_len;
  143. char *data_val;
  144. } data;
  145. };
  146. typedef struct readokres readokres;
  147. struct readres {
  148. nfsstat status;
  149. union {
  150. readokres reply;
  151. } readres_u;
  152. };
  153. typedef struct readres readres;
  154. struct writeargs {
  155. nfs_fh file;
  156. u_int beginoffset;
  157. u_int offset;
  158. u_int totalcount;
  159. struct {
  160. u_int data_len;
  161. char *data_val;
  162. } data;
  163. };
  164. typedef struct writeargs writeargs;
  165. struct createargs {
  166. diropargs where;
  167. sattr attributes;
  168. };
  169. typedef struct createargs createargs;
  170. struct renameargs {
  171. diropargs from;
  172. diropargs to;
  173. };
  174. typedef struct renameargs renameargs;
  175. struct linkargs {
  176. nfs_fh from;
  177. diropargs to;
  178. };
  179. typedef struct linkargs linkargs;
  180. struct symlinkargs {
  181. diropargs from;
  182. nfspath to;
  183. sattr attributes;
  184. };
  185. typedef struct symlinkargs symlinkargs;
  186. typedef char nfscookie[NFS_COOKIESIZE];
  187. struct readdirargs {
  188. nfs_fh dir;
  189. nfscookie cookie;
  190. u_int count;
  191. };
  192. typedef struct readdirargs readdirargs;
  193. struct entry {
  194. u_int fileid;
  195. filename name;
  196. nfscookie cookie;
  197. struct entry *nextentry;
  198. };
  199. typedef struct entry entry;
  200. struct dirlist {
  201. entry *entries;
  202. bool_t eof;
  203. };
  204. typedef struct dirlist dirlist;
  205. struct readdirres {
  206. nfsstat status;
  207. union {
  208. dirlist reply;
  209. } readdirres_u;
  210. };
  211. typedef struct readdirres readdirres;
  212. struct statfsokres {
  213. u_int tsize;
  214. u_int bsize;
  215. u_int blocks;
  216. u_int bfree;
  217. u_int bavail;
  218. };
  219. typedef struct statfsokres statfsokres;
  220. struct statfsres {
  221. nfsstat status;
  222. union {
  223. statfsokres reply;
  224. } statfsres_u;
  225. };
  226. typedef struct statfsres statfsres;
  227. #define NFS_PROGRAM 100003
  228. #define NFS_VERSION 2
  229. #if defined(__STDC__) || defined(__cplusplus)
  230. #define NFSPROC_NULL 0
  231. extern void * nfsproc_null_2(void *, CLIENT *);
  232. extern void * nfsproc_null_2_svc(void *, struct svc_req *);
  233. #define NFSPROC_GETATTR 1
  234. extern attrstat * nfsproc_getattr_2(nfs_fh *, CLIENT *);
  235. extern attrstat * nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *);
  236. #define NFSPROC_SETATTR 2
  237. extern attrstat * nfsproc_setattr_2(sattrargs *, CLIENT *);
  238. extern attrstat * nfsproc_setattr_2_svc(sattrargs *, struct svc_req *);
  239. #define NFSPROC_ROOT 3
  240. extern void * nfsproc_root_2(void *, CLIENT *);
  241. extern void * nfsproc_root_2_svc(void *, struct svc_req *);
  242. #define NFSPROC_LOOKUP 4
  243. extern diropres * nfsproc_lookup_2(diropargs *, CLIENT *);
  244. extern diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *);
  245. #define NFSPROC_READLINK 5
  246. extern readlinkres * nfsproc_readlink_2(nfs_fh *, CLIENT *);
  247. extern readlinkres * nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *);
  248. #define NFSPROC_READ 6
  249. extern readres * nfsproc_read_2(readargs *, CLIENT *);
  250. extern readres * nfsproc_read_2_svc(readargs *, struct svc_req *);
  251. #define NFSPROC_WRITECACHE 7
  252. extern void * nfsproc_writecache_2(void *, CLIENT *);
  253. extern void * nfsproc_writecache_2_svc(void *, struct svc_req *);
  254. #define NFSPROC_WRITE 8
  255. extern attrstat * nfsproc_write_2(writeargs *, CLIENT *);
  256. extern attrstat * nfsproc_write_2_svc(writeargs *, struct svc_req *);
  257. #define NFSPROC_CREATE 9
  258. extern diropres * nfsproc_create_2(createargs *, CLIENT *);
  259. extern diropres * nfsproc_create_2_svc(createargs *, struct svc_req *);
  260. #define NFSPROC_REMOVE 10
  261. extern nfsstat * nfsproc_remove_2(diropargs *, CLIENT *);
  262. extern nfsstat * nfsproc_remove_2_svc(diropargs *, struct svc_req *);
  263. #define NFSPROC_RENAME 11
  264. extern nfsstat * nfsproc_rename_2(renameargs *, CLIENT *);
  265. extern nfsstat * nfsproc_rename_2_svc(renameargs *, struct svc_req *);
  266. #define NFSPROC_LINK 12
  267. extern nfsstat * nfsproc_link_2(linkargs *, CLIENT *);
  268. extern nfsstat * nfsproc_link_2_svc(linkargs *, struct svc_req *);
  269. #define NFSPROC_SYMLINK 13
  270. extern nfsstat * nfsproc_symlink_2(symlinkargs *, CLIENT *);
  271. extern nfsstat * nfsproc_symlink_2_svc(symlinkargs *, struct svc_req *);
  272. #define NFSPROC_MKDIR 14
  273. extern diropres * nfsproc_mkdir_2(createargs *, CLIENT *);
  274. extern diropres * nfsproc_mkdir_2_svc(createargs *, struct svc_req *);
  275. #define NFSPROC_RMDIR 15
  276. extern nfsstat * nfsproc_rmdir_2(diropargs *, CLIENT *);
  277. extern nfsstat * nfsproc_rmdir_2_svc(diropargs *, struct svc_req *);
  278. #define NFSPROC_READDIR 16
  279. extern readdirres * nfsproc_readdir_2(readdirargs *, CLIENT *);
  280. extern readdirres * nfsproc_readdir_2_svc(readdirargs *, struct svc_req *);
  281. #define NFSPROC_STATFS 17
  282. extern statfsres * nfsproc_statfs_2(nfs_fh *, CLIENT *);
  283. extern statfsres * nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *);
  284. extern int nfs_program_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
  285. #else /* K&R C */
  286. #define NFSPROC_NULL 0
  287. extern void * nfsproc_null_2();
  288. extern void * nfsproc_null_2_svc();
  289. #define NFSPROC_GETATTR 1
  290. extern attrstat * nfsproc_getattr_2();
  291. extern attrstat * nfsproc_getattr_2_svc();
  292. #define NFSPROC_SETATTR 2
  293. extern attrstat * nfsproc_setattr_2();
  294. extern attrstat * nfsproc_setattr_2_svc();
  295. #define NFSPROC_ROOT 3
  296. extern void * nfsproc_root_2();
  297. extern void * nfsproc_root_2_svc();
  298. #define NFSPROC_LOOKUP 4
  299. extern diropres * nfsproc_lookup_2();
  300. extern diropres * nfsproc_lookup_2_svc();
  301. #define NFSPROC_READLINK 5
  302. extern readlinkres * nfsproc_readlink_2();
  303. extern readlinkres * nfsproc_readlink_2_svc();
  304. #define NFSPROC_READ 6
  305. extern readres * nfsproc_read_2();
  306. extern readres * nfsproc_read_2_svc();
  307. #define NFSPROC_WRITECACHE 7
  308. extern void * nfsproc_writecache_2();
  309. extern void * nfsproc_writecache_2_svc();
  310. #define NFSPROC_WRITE 8
  311. extern attrstat * nfsproc_write_2();
  312. extern attrstat * nfsproc_write_2_svc();
  313. #define NFSPROC_CREATE 9
  314. extern diropres * nfsproc_create_2();
  315. extern diropres * nfsproc_create_2_svc();
  316. #define NFSPROC_REMOVE 10
  317. extern nfsstat * nfsproc_remove_2();
  318. extern nfsstat * nfsproc_remove_2_svc();
  319. #define NFSPROC_RENAME 11
  320. extern nfsstat * nfsproc_rename_2();
  321. extern nfsstat * nfsproc_rename_2_svc();
  322. #define NFSPROC_LINK 12
  323. extern nfsstat * nfsproc_link_2();
  324. extern nfsstat * nfsproc_link_2_svc();
  325. #define NFSPROC_SYMLINK 13
  326. extern nfsstat * nfsproc_symlink_2();
  327. extern nfsstat * nfsproc_symlink_2_svc();
  328. #define NFSPROC_MKDIR 14
  329. extern diropres * nfsproc_mkdir_2();
  330. extern diropres * nfsproc_mkdir_2_svc();
  331. #define NFSPROC_RMDIR 15
  332. extern nfsstat * nfsproc_rmdir_2();
  333. extern nfsstat * nfsproc_rmdir_2_svc();
  334. #define NFSPROC_READDIR 16
  335. extern readdirres * nfsproc_readdir_2();
  336. extern readdirres * nfsproc_readdir_2_svc();
  337. #define NFSPROC_STATFS 17
  338. extern statfsres * nfsproc_statfs_2();
  339. extern statfsres * nfsproc_statfs_2_svc();
  340. extern int nfs_program_2_freeresult ();
  341. #endif /* K&R C */
  342. /* the xdr functions */
  343. #if defined(__STDC__) || defined(__cplusplus)
  344. extern bool_t xdr_nfsstat (XDR *, nfsstat*);
  345. extern bool_t xdr_ftype (XDR *, ftype*);
  346. extern bool_t xdr_nfs_fh (XDR *, nfs_fh*);
  347. extern bool_t xdr_nfstime (XDR *, nfstime*);
  348. extern bool_t xdr_fattr (XDR *, fattr*);
  349. extern bool_t xdr_sattr (XDR *, sattr*);
  350. extern bool_t xdr_filename (XDR *, filename*);
  351. extern bool_t xdr_nfspath (XDR *, nfspath*);
  352. extern bool_t xdr_attrstat (XDR *, attrstat*);
  353. extern bool_t xdr_sattrargs (XDR *, sattrargs*);
  354. extern bool_t xdr_diropargs (XDR *, diropargs*);
  355. extern bool_t xdr_diropokres (XDR *, diropokres*);
  356. extern bool_t xdr_diropres (XDR *, diropres*);
  357. extern bool_t xdr_readlinkres (XDR *, readlinkres*);
  358. extern bool_t xdr_readargs (XDR *, readargs*);
  359. extern bool_t xdr_readokres (XDR *, readokres*);
  360. extern bool_t xdr_readres (XDR *, readres*);
  361. extern bool_t xdr_writeargs (XDR *, writeargs*);
  362. extern bool_t xdr_createargs (XDR *, createargs*);
  363. extern bool_t xdr_renameargs (XDR *, renameargs*);
  364. extern bool_t xdr_linkargs (XDR *, linkargs*);
  365. extern bool_t xdr_symlinkargs (XDR *, symlinkargs*);
  366. extern bool_t xdr_nfscookie (XDR *, nfscookie);
  367. extern bool_t xdr_readdirargs (XDR *, readdirargs*);
  368. extern bool_t xdr_entry (XDR *, entry*);
  369. extern bool_t xdr_dirlist (XDR *, dirlist*);
  370. extern bool_t xdr_readdirres (XDR *, readdirres*);
  371. extern bool_t xdr_statfsokres (XDR *, statfsokres*);
  372. extern bool_t xdr_statfsres (XDR *, statfsres*);
  373. #else /* K&R C */
  374. extern bool_t xdr_nfsstat ();
  375. extern bool_t xdr_ftype ();
  376. extern bool_t xdr_nfs_fh ();
  377. extern bool_t xdr_nfstime ();
  378. extern bool_t xdr_fattr ();
  379. extern bool_t xdr_sattr ();
  380. extern bool_t xdr_filename ();
  381. extern bool_t xdr_nfspath ();
  382. extern bool_t xdr_attrstat ();
  383. extern bool_t xdr_sattrargs ();
  384. extern bool_t xdr_diropargs ();
  385. extern bool_t xdr_diropokres ();
  386. extern bool_t xdr_diropres ();
  387. extern bool_t xdr_readlinkres ();
  388. extern bool_t xdr_readargs ();
  389. extern bool_t xdr_readokres ();
  390. extern bool_t xdr_readres ();
  391. extern bool_t xdr_writeargs ();
  392. extern bool_t xdr_createargs ();
  393. extern bool_t xdr_renameargs ();
  394. extern bool_t xdr_linkargs ();
  395. extern bool_t xdr_symlinkargs ();
  396. extern bool_t xdr_nfscookie ();
  397. extern bool_t xdr_readdirargs ();
  398. extern bool_t xdr_entry ();
  399. extern bool_t xdr_dirlist ();
  400. extern bool_t xdr_readdirres ();
  401. extern bool_t xdr_statfsokres ();
  402. extern bool_t xdr_statfsres ();
  403. #endif /* K&R C */
  404. #ifdef __cplusplus
  405. }
  406. #endif
  407. #endif /* !_NFS_PROT_H_RPCGEN */