nfs3.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /*
  10. * NFS mounter V3; see RFC 1813
  11. */
  12. enum {
  13. NfsMount1HandleSize = 32,
  14. NfsMount3MaxPathSize = 1024,
  15. NfsMount3MaxNameSize = 255,
  16. NfsMount3MaxHandleSize = 64,
  17. NfsMount3Program = 100005,
  18. NfsMount3Version = 3,
  19. NfsMount1Program = 100005,
  20. NfsMount1Version = 1
  21. };
  22. typedef struct NfsMount3TNull NfsMount3TNull;
  23. typedef struct NfsMount3RNull NfsMount3RNull;
  24. typedef struct NfsMount3TMnt NfsMount3TMnt;
  25. typedef struct NfsMount3RMnt NfsMount3RMnt;
  26. typedef struct NfsMount3TDump NfsMount3TDump;
  27. typedef struct NfsMount3Entry NfsMount3Entry;
  28. typedef struct NfsMount3RDump NfsMount3RDump;
  29. typedef struct NfsMount3TUmnt NfsMount3TUmnt;
  30. typedef struct NfsMount3RUmnt NfsMount3RUmnt;
  31. typedef struct NfsMount3Export NfsMount3Export;
  32. typedef struct NfsMount3TUmntall NfsMount3TUmntall;
  33. typedef struct NfsMount3RUmntall NfsMount3RUmntall;
  34. typedef struct NfsMount3TExport NfsMount3TExport;
  35. typedef struct NfsMount3RExport NfsMount3RExport;
  36. typedef enum
  37. {
  38. NfsMount3CallTNull,
  39. NfsMount3CallRNull,
  40. NfsMount3CallTMnt,
  41. NfsMount3CallRMnt,
  42. NfsMount3CallTDump,
  43. NfsMount3CallRDump,
  44. NfsMount3CallTUmnt,
  45. NfsMount3CallRUmnt,
  46. NfsMount3CallTUmntall,
  47. NfsMount3CallRUmntall,
  48. NfsMount3CallTExport,
  49. NfsMount3CallRExport
  50. } NfsMount3CallType;
  51. typedef struct NfsMount3Call NfsMount3Call;
  52. struct NfsMount3Call {
  53. SunRpc rpc;
  54. NfsMount3CallType type;
  55. };
  56. struct NfsMount3TNull {
  57. NfsMount3Call call;
  58. };
  59. struct NfsMount3RNull {
  60. NfsMount3Call call;
  61. };
  62. struct NfsMount3TMnt {
  63. NfsMount3Call call;
  64. char *path;
  65. };
  66. struct NfsMount3RMnt {
  67. NfsMount3Call call;
  68. u32 status;
  69. u8 *handle;
  70. u32 len;
  71. u32 *auth;
  72. u32 nauth;
  73. };
  74. struct NfsMount3TDump {
  75. NfsMount3Call call;
  76. };
  77. struct NfsMount3Entry {
  78. char *host;
  79. char *path;
  80. };
  81. struct NfsMount3RDump {
  82. NfsMount3Call call;
  83. u8 *data;
  84. u32 count;
  85. };
  86. struct NfsMount3TUmnt {
  87. NfsMount3Call call;
  88. char *path;
  89. };
  90. struct NfsMount3RUmnt {
  91. NfsMount3Call call;
  92. };
  93. struct NfsMount3Export {
  94. char *path;
  95. char **g;
  96. u32 ng;
  97. };
  98. struct NfsMount3TUmntall {
  99. NfsMount3Call call;
  100. };
  101. struct NfsMount3RUmntall {
  102. NfsMount3Call call;
  103. };
  104. struct NfsMount3TExport {
  105. NfsMount3Call call;
  106. };
  107. struct NfsMount3RExport {
  108. NfsMount3Call call;
  109. u8 *data;
  110. u32 count;
  111. };
  112. u32 nfsMount3ExportGroupSize(u8*);
  113. u32 nfsMount3ExportSize(NfsMount3Export*);
  114. int nfsMount3ExportPack(u8*, u8*, u8**, NfsMount3Export*);
  115. int nfsMount3ExportUnpack(u8*, u8*, u8**, char**, char***,
  116. NfsMount3Export*);
  117. int nfsMount3EntryPack(u8*, u8*, u8**, NfsMount3Entry*);
  118. int nfsMount3EntryUnpack(u8*, u8*, u8**, NfsMount3Entry*);
  119. u32 nfsMount3EntrySize(NfsMount3Entry*);
  120. extern SunProg nfsMount3Prog;
  121. /*
  122. * NFS V3; see RFC 1813
  123. */
  124. enum {
  125. Nfs3MaxHandleSize = 64,
  126. Nfs3CookieVerfSize = 8,
  127. Nfs3CreateVerfSize = 8,
  128. Nfs3WriteVerfSize = 8,
  129. Nfs3AccessRead = 1,
  130. Nfs3AccessLookup = 2,
  131. Nfs3AccessModify = 4,
  132. Nfs3AccessExtend = 8,
  133. Nfs3AccessDelete = 16,
  134. Nfs3AccessExecute = 32,
  135. Nfs3FsHasLinks = 1,
  136. Nfs3FsHasSymlinks = 2,
  137. Nfs3FsHomogeneous = 8,
  138. Nfs3FsCanSetTime = 16,
  139. Nfs3Version = 3,
  140. Nfs3Program = 100003,
  141. };
  142. typedef enum
  143. {
  144. Nfs3Ok = 0,
  145. Nfs3ErrNotOwner = 1,
  146. Nfs3ErrNoEnt = 2,
  147. Nfs3ErrIo = 5,
  148. Nfs3ErrNxio = 6,
  149. Nfs3ErrNoMem = 12,
  150. Nfs3ErrAcces = 13,
  151. Nfs3ErrExist = 17,
  152. Nfs3ErrXDev = 18,
  153. Nfs3ErrNoDev = 19,
  154. Nfs3ErrNotDir = 20,
  155. Nfs3ErrIsDir = 21,
  156. Nfs3ErrInval = 22,
  157. Nfs3ErrFbig = 27,
  158. Nfs3ErrNoSpc = 28,
  159. Nfs3ErrRoFs = 30,
  160. Nfs3ErrMLink = 31,
  161. Nfs3ErrNameTooLong = 63,
  162. Nfs3ErrNotEmpty = 66,
  163. Nfs3ErrDQuot = 69,
  164. Nfs3ErrStale = 70,
  165. Nfs3ErrRemote = 71,
  166. Nfs3ErrBadHandle = 10001,
  167. Nfs3ErrNotSync = 10002,
  168. Nfs3ErrBadCookie = 10003,
  169. Nfs3ErrNotSupp = 10004,
  170. Nfs3ErrTooSmall = 10005,
  171. Nfs3ErrServerFault = 10006,
  172. Nfs3ErrBadType = 10007,
  173. Nfs3ErrJukebox = 10008,
  174. Nfs3ErrFprintNotFound = 10009,
  175. Nfs3ErrAborted = 10010,
  176. } Nfs3Status;
  177. void nfs3Errstr(Nfs3Status);
  178. typedef enum
  179. {
  180. Nfs3FileReg = 1,
  181. Nfs3FileDir = 2,
  182. Nfs3FileBlock = 3,
  183. Nfs3FileChar = 4,
  184. Nfs3FileSymlink = 5,
  185. Nfs3FileSocket = 6,
  186. Nfs3FileFifo = 7,
  187. } Nfs3FileType;
  188. enum
  189. {
  190. Nfs3ModeSetUid = 0x800,
  191. Nfs3ModeSetGid = 0x400,
  192. Nfs3ModeSticky = 0x200,
  193. };
  194. typedef enum
  195. {
  196. Nfs3CallTNull,
  197. Nfs3CallRNull,
  198. Nfs3CallTGetattr,
  199. Nfs3CallRGetattr,
  200. Nfs3CallTSetattr,
  201. Nfs3CallRSetattr,
  202. Nfs3CallTLookup,
  203. Nfs3CallRLookup,
  204. Nfs3CallTAccess,
  205. Nfs3CallRAccess,
  206. Nfs3CallTReadlink,
  207. Nfs3CallRReadlink,
  208. Nfs3CallTRead,
  209. Nfs3CallRRead,
  210. Nfs3CallTWrite,
  211. Nfs3CallRWrite,
  212. Nfs3CallTCreate,
  213. Nfs3CallRCreate,
  214. Nfs3CallTMkdir,
  215. Nfs3CallRMkdir,
  216. Nfs3CallTSymlink,
  217. Nfs3CallRSymlink,
  218. Nfs3CallTMknod,
  219. Nfs3CallRMknod,
  220. Nfs3CallTRemove,
  221. Nfs3CallRRemove,
  222. Nfs3CallTRmdir,
  223. Nfs3CallRRmdir,
  224. Nfs3CallTRename,
  225. Nfs3CallRRename,
  226. Nfs3CallTLink,
  227. Nfs3CallRLink,
  228. Nfs3CallTReadDir,
  229. Nfs3CallRReadDir,
  230. Nfs3CallTReadDirPlus,
  231. Nfs3CallRReadDirPlus,
  232. Nfs3CallTFsStat,
  233. Nfs3CallRFsStat,
  234. Nfs3CallTFsInfo,
  235. Nfs3CallRFsInfo,
  236. Nfs3CallTPathconf,
  237. Nfs3CallRPathconf,
  238. Nfs3CallTCommit,
  239. Nfs3CallRCommit,
  240. } Nfs3CallType;
  241. typedef struct Nfs3Call Nfs3Call;
  242. typedef struct Nfs3Handle Nfs3Handle;
  243. typedef struct Nfs3Time Nfs3Time;
  244. typedef struct Nfs3Attr Nfs3Attr;
  245. typedef struct Nfs3WccAttr Nfs3WccAttr;
  246. typedef struct Nfs3Wcc Nfs3Wcc;
  247. typedef enum
  248. {
  249. Nfs3SetTimeDont = 0,
  250. Nfs3SetTimeServer = 1,
  251. Nfs3SetTimeClient = 2,
  252. } Nfs3SetTime;
  253. typedef struct Nfs3SetAttr Nfs3SetAttr;
  254. typedef struct Nfs3TNull Nfs3TNull;
  255. typedef struct Nfs3RNull Nfs3RNull;
  256. typedef struct Nfs3TGetattr Nfs3TGetattr;
  257. typedef struct Nfs3RGetattr Nfs3RGetattr;
  258. typedef struct Nfs3TSetattr Nfs3TSetattr;
  259. typedef struct Nfs3RSetattr Nfs3RSetattr;
  260. typedef struct Nfs3TLookup Nfs3TLookup;
  261. typedef struct Nfs3RLookup Nfs3RLookup;
  262. typedef struct Nfs3TAccess Nfs3TAccess;
  263. typedef struct Nfs3RAccess Nfs3RAccess;
  264. typedef struct Nfs3TReadlink Nfs3TReadlink;
  265. typedef struct Nfs3RReadlink Nfs3RReadlink;
  266. typedef struct Nfs3TRead Nfs3TRead;
  267. typedef struct Nfs3RRead Nfs3RRead;
  268. typedef enum
  269. {
  270. Nfs3SyncNone = 0,
  271. Nfs3SyncData = 1,
  272. Nfs3SyncFile = 2,
  273. } Nfs3Sync;
  274. typedef struct Nfs3TWrite Nfs3TWrite;
  275. typedef struct Nfs3RWrite Nfs3RWrite;
  276. typedef enum
  277. {
  278. Nfs3CreateUnchecked = 0,
  279. Nfs3CreateGuarded = 1,
  280. Nfs3CreateExclusive = 2,
  281. } Nfs3Create;
  282. typedef struct Nfs3TCreate Nfs3TCreate;
  283. typedef struct Nfs3RCreate Nfs3RCreate;
  284. typedef struct Nfs3TMkdir Nfs3TMkdir;
  285. typedef struct Nfs3RMkdir Nfs3RMkdir;
  286. typedef struct Nfs3TSymlink Nfs3TSymlink;
  287. typedef struct Nfs3RSymlink Nfs3RSymlink;
  288. typedef struct Nfs3TMknod Nfs3TMknod;
  289. typedef struct Nfs3RMknod Nfs3RMknod;
  290. typedef struct Nfs3TRemove Nfs3TRemove;
  291. typedef struct Nfs3RRemove Nfs3RRemove;
  292. typedef struct Nfs3TRmdir Nfs3TRmdir;
  293. typedef struct Nfs3RRmdir Nfs3RRmdir;
  294. typedef struct Nfs3TRename Nfs3TRename;
  295. typedef struct Nfs3RRename Nfs3RRename;
  296. typedef struct Nfs3TLink Nfs3TLink;
  297. typedef struct Nfs3RLink Nfs3RLink;
  298. typedef struct Nfs3TReadDir Nfs3TReadDir;
  299. typedef struct Nfs3Entry Nfs3Entry;
  300. typedef struct Nfs3RReadDir Nfs3RReadDir;
  301. typedef struct Nfs3TReadDirPlus Nfs3TReadDirPlus;
  302. typedef struct Nfs3EntryPlus Nfs3EntryPlus;
  303. typedef struct Nfs3RReadDirPlus Nfs3RReadDirPlus;
  304. typedef struct Nfs3TFsStat Nfs3TFsStat;
  305. typedef struct Nfs3RFsStat Nfs3RFsStat;
  306. typedef struct Nfs3TFsInfo Nfs3TFsInfo;
  307. typedef struct Nfs3RFsInfo Nfs3RFsInfo;
  308. typedef struct Nfs3TPathconf Nfs3TPathconf;
  309. typedef struct Nfs3RPathconf Nfs3RPathconf;
  310. typedef struct Nfs3TCommit Nfs3TCommit;
  311. typedef struct Nfs3RCommit Nfs3RCommit;
  312. struct Nfs3Call {
  313. SunRpc rpc;
  314. Nfs3CallType type;
  315. };
  316. struct Nfs3Handle {
  317. u8 h[Nfs3MaxHandleSize];
  318. u32 len;
  319. };
  320. struct Nfs3Time {
  321. u32 sec;
  322. u32 nsec;
  323. };
  324. struct Nfs3Attr {
  325. Nfs3FileType type;
  326. u32 mode;
  327. u32 nlink;
  328. u32 uid;
  329. u32 gid;
  330. u64 size;
  331. u64 used;
  332. u32 major;
  333. u32 minor;
  334. u64 fsid;
  335. u64 fileid;
  336. Nfs3Time atime;
  337. Nfs3Time mtime;
  338. Nfs3Time ctime;
  339. };
  340. struct Nfs3WccAttr {
  341. u64 size;
  342. Nfs3Time mtime;
  343. Nfs3Time ctime;
  344. };
  345. struct Nfs3Wcc {
  346. u1int haveWccAttr;
  347. Nfs3WccAttr wccAttr;
  348. u1int haveAttr;
  349. Nfs3Attr attr;
  350. };
  351. struct Nfs3SetAttr {
  352. u1int setMode;
  353. u32 mode;
  354. u1int setUid;
  355. u32 uid;
  356. u1int setGid;
  357. u32 gid;
  358. u1int setSize;
  359. u64 size;
  360. Nfs3SetTime setAtime;
  361. Nfs3Time atime;
  362. Nfs3SetTime setMtime;
  363. Nfs3Time mtime;
  364. };
  365. struct Nfs3TNull {
  366. Nfs3Call call;
  367. };
  368. struct Nfs3RNull {
  369. Nfs3Call call;
  370. };
  371. struct Nfs3TGetattr {
  372. Nfs3Call call;
  373. Nfs3Handle handle;
  374. };
  375. struct Nfs3RGetattr {
  376. Nfs3Call call;
  377. Nfs3Status status;
  378. Nfs3Attr attr;
  379. };
  380. struct Nfs3TSetattr {
  381. Nfs3Call call;
  382. Nfs3Handle handle;
  383. Nfs3SetAttr attr;
  384. u1int checkCtime;
  385. Nfs3Time ctime;
  386. };
  387. struct Nfs3RSetattr {
  388. Nfs3Call call;
  389. Nfs3Status status;
  390. Nfs3Wcc wcc;
  391. };
  392. struct Nfs3TLookup {
  393. Nfs3Call call;
  394. Nfs3Handle handle;
  395. char *name;
  396. };
  397. struct Nfs3RLookup {
  398. Nfs3Call call;
  399. Nfs3Status status;
  400. Nfs3Handle handle;
  401. u1int haveAttr;
  402. Nfs3Attr attr;
  403. u1int haveDirAttr;
  404. Nfs3Attr dirAttr;
  405. };
  406. struct Nfs3TAccess {
  407. Nfs3Call call;
  408. Nfs3Handle handle;
  409. u32 access;
  410. };
  411. struct Nfs3RAccess {
  412. Nfs3Call call;
  413. Nfs3Status status;
  414. u1int haveAttr;
  415. Nfs3Attr attr;
  416. u32 access;
  417. };
  418. struct Nfs3TReadlink {
  419. Nfs3Call call;
  420. Nfs3Handle handle;
  421. };
  422. struct Nfs3RReadlink {
  423. Nfs3Call call;
  424. Nfs3Status status;
  425. u1int haveAttr;
  426. Nfs3Attr attr;
  427. char *data;
  428. };
  429. struct Nfs3TRead {
  430. Nfs3Call call;
  431. Nfs3Handle handle;
  432. u64 offset;
  433. u32 count;
  434. };
  435. struct Nfs3RRead {
  436. Nfs3Call call;
  437. Nfs3Status status;
  438. u1int haveAttr;
  439. Nfs3Attr attr;
  440. u32 count;
  441. u1int eof;
  442. u8 *data;
  443. u32 ndata;
  444. };
  445. struct Nfs3TWrite {
  446. Nfs3Call call;
  447. Nfs3Handle handle;
  448. u64 offset;
  449. u32 count;
  450. Nfs3Sync stable;
  451. u8 *data;
  452. u32 ndata;
  453. };
  454. struct Nfs3RWrite {
  455. Nfs3Call call;
  456. Nfs3Status status;
  457. Nfs3Wcc wcc;
  458. u32 count;
  459. Nfs3Sync committed;
  460. u8 verf[Nfs3WriteVerfSize];
  461. };
  462. struct Nfs3TCreate {
  463. Nfs3Call call;
  464. Nfs3Handle handle;
  465. char *name;
  466. Nfs3Create mode;
  467. Nfs3SetAttr attr;
  468. u8 verf[Nfs3CreateVerfSize];
  469. };
  470. struct Nfs3RCreate {
  471. Nfs3Call call;
  472. Nfs3Status status;
  473. u1int haveHandle;
  474. Nfs3Handle handle;
  475. u1int haveAttr;
  476. Nfs3Attr attr;
  477. Nfs3Wcc dirWcc;
  478. };
  479. struct Nfs3TMkdir {
  480. Nfs3Call call;
  481. Nfs3Handle handle;
  482. char *name;
  483. Nfs3SetAttr attr;
  484. };
  485. struct Nfs3RMkdir {
  486. Nfs3Call call;
  487. Nfs3Status status;
  488. u1int haveHandle;
  489. Nfs3Handle handle;
  490. u1int haveAttr;
  491. Nfs3Attr attr;
  492. Nfs3Wcc dirWcc;
  493. };
  494. struct Nfs3TSymlink {
  495. Nfs3Call call;
  496. Nfs3Handle handle;
  497. char *name;
  498. Nfs3SetAttr attr;
  499. char *data;
  500. };
  501. struct Nfs3RSymlink {
  502. Nfs3Call call;
  503. Nfs3Status status;
  504. u1int haveHandle;
  505. Nfs3Handle handle;
  506. u1int haveAttr;
  507. Nfs3Attr attr;
  508. Nfs3Wcc dirWcc;
  509. };
  510. struct Nfs3TMknod {
  511. Nfs3Call call;
  512. Nfs3Handle handle;
  513. char *name;
  514. Nfs3FileType type;
  515. Nfs3SetAttr attr;
  516. u32 major;
  517. u32 minor;
  518. };
  519. struct Nfs3RMknod {
  520. Nfs3Call call;
  521. Nfs3Status status;
  522. u1int haveHandle;
  523. Nfs3Handle handle;
  524. u1int haveAttr;
  525. Nfs3Attr attr;
  526. Nfs3Wcc dirWcc;
  527. };
  528. struct Nfs3TRemove {
  529. Nfs3Call call;
  530. Nfs3Handle handle;
  531. char *name;
  532. };
  533. struct Nfs3RRemove {
  534. Nfs3Call call;
  535. Nfs3Status status;
  536. Nfs3Wcc wcc;
  537. };
  538. struct Nfs3TRmdir {
  539. Nfs3Call call;
  540. Nfs3Handle handle;
  541. char *name;
  542. };
  543. struct Nfs3RRmdir {
  544. Nfs3Call call;
  545. Nfs3Status status;
  546. Nfs3Wcc wcc;
  547. };
  548. struct Nfs3TRename {
  549. Nfs3Call call;
  550. struct {
  551. Nfs3Handle handle;
  552. char *name;
  553. } from;
  554. struct {
  555. Nfs3Handle handle;
  556. char *name;
  557. } to;
  558. };
  559. struct Nfs3RRename {
  560. Nfs3Call call;
  561. Nfs3Status status;
  562. Nfs3Wcc fromWcc;
  563. Nfs3Wcc toWcc;
  564. };
  565. struct Nfs3TLink {
  566. Nfs3Call call;
  567. Nfs3Handle handle;
  568. struct {
  569. Nfs3Handle handle;
  570. char *name;
  571. } link;
  572. };
  573. struct Nfs3RLink {
  574. Nfs3Call call;
  575. Nfs3Status status;
  576. u1int haveAttr;
  577. Nfs3Attr attr;
  578. Nfs3Wcc dirWcc;
  579. };
  580. struct Nfs3TReadDir {
  581. Nfs3Call call;
  582. Nfs3Handle handle;
  583. u64 cookie;
  584. u8 verf[Nfs3CookieVerfSize];
  585. u32 count;
  586. };
  587. struct Nfs3RReadDir {
  588. Nfs3Call call;
  589. Nfs3Status status;
  590. u1int haveAttr;
  591. Nfs3Attr attr;
  592. u8 verf[Nfs3CookieVerfSize];
  593. u8 *data;
  594. u32 count;
  595. u1int eof;
  596. };
  597. struct Nfs3TReadDirPlus {
  598. Nfs3Call call;
  599. Nfs3Handle handle;
  600. u64 cookie;
  601. u8 verf[Nfs3CookieVerfSize];
  602. u32 dirCount;
  603. u32 maxCount;
  604. };
  605. struct Nfs3Entry {
  606. u64 fileid;
  607. char *name;
  608. u64 cookie;
  609. u1int haveAttr;
  610. Nfs3Attr attr;
  611. u1int haveHandle;
  612. Nfs3Handle handle;
  613. };
  614. struct Nfs3RReadDirPlus {
  615. Nfs3Call call;
  616. Nfs3Status status;
  617. u1int haveAttr;
  618. Nfs3Attr attr;
  619. u8 verf[Nfs3CookieVerfSize];
  620. u8 *data;
  621. u32 count;
  622. u1int eof;
  623. };
  624. struct Nfs3TFsStat {
  625. Nfs3Call call;
  626. Nfs3Handle handle;
  627. };
  628. struct Nfs3RFsStat {
  629. Nfs3Call call;
  630. Nfs3Status status;
  631. u1int haveAttr;
  632. Nfs3Attr attr;
  633. u64 totalBytes;
  634. u64 freeBytes;
  635. u64 availBytes;
  636. u64 totalFiles;
  637. u64 freeFiles;
  638. u64 availFiles;
  639. u32 invarSec;
  640. };
  641. struct Nfs3TFsInfo {
  642. Nfs3Call call;
  643. Nfs3Handle handle;
  644. };
  645. struct Nfs3RFsInfo {
  646. Nfs3Call call;
  647. Nfs3Status status;
  648. u1int haveAttr;
  649. Nfs3Attr attr;
  650. u32 readMax;
  651. u32 readPref;
  652. u32 readMult;
  653. u32 writeMax;
  654. u32 writePref;
  655. u32 writeMult;
  656. u32 readDirPref;
  657. u64 maxFileSize;
  658. Nfs3Time timePrec;
  659. u32 flags;
  660. };
  661. struct Nfs3TPathconf {
  662. Nfs3Call call;
  663. Nfs3Handle handle;
  664. };
  665. struct Nfs3RPathconf {
  666. Nfs3Call call;
  667. Nfs3Status status;
  668. u1int haveAttr;
  669. Nfs3Attr attr;
  670. u32 maxLink;
  671. u32 maxName;
  672. u1int noTrunc;
  673. u1int chownRestricted;
  674. u1int caseInsensitive;
  675. u1int casePreserving;
  676. };
  677. struct Nfs3TCommit {
  678. Nfs3Call call;
  679. Nfs3Handle handle;
  680. u64 offset;
  681. u32 count;
  682. };
  683. struct Nfs3RCommit {
  684. Nfs3Call call;
  685. Nfs3Status status;
  686. Nfs3Wcc wcc;
  687. u8 verf[Nfs3WriteVerfSize];
  688. };
  689. char *nfs3StatusStr(Nfs3Status);
  690. char *nfs3TypeStr(Nfs3CallType);
  691. char *nfs3SetTimeStr(Nfs3SetTime);
  692. char *nfs3SyncStr(Nfs3Sync);
  693. void nfs3HandlePrint(Fmt*, Nfs3Handle*);
  694. u32 nfs3HandleSize(Nfs3Handle*);
  695. int nfs3HandlePack(u8*, u8*, u8**, Nfs3Handle*);
  696. int nfs3HandleUnpack(u8*, u8*, u8**, Nfs3Handle*);
  697. void nfs3TimePrint(Fmt*, Nfs3Time*);
  698. u32 nfs3TimeSize(Nfs3Time*);
  699. int nfs3TimePack(u8*, u8*, u8**, Nfs3Time*);
  700. int nfs3TimeUnpack(u8*, u8*, u8**, Nfs3Time*);
  701. void nfs3AttrPrint(Fmt*, Nfs3Attr*);
  702. u32 nfs3AttrSize(Nfs3Attr*);
  703. int nfs3AttrPack(u8*, u8*, u8**, Nfs3Attr*);
  704. int nfs3AttrUnpack(u8*, u8*, u8**, Nfs3Attr*);
  705. void nfs3WccAttrPrint(Fmt*, Nfs3WccAttr*);
  706. u32 nfs3WccAttrSize(Nfs3WccAttr*);
  707. int nfs3WccAttrPack(u8*, u8*, u8**, Nfs3WccAttr*);
  708. int nfs3WccAttrUnpack(u8*, u8*, u8**, Nfs3WccAttr*);
  709. void nfs3WccPrint(Fmt*, Nfs3Wcc*);
  710. u32 nfs3WccSize(Nfs3Wcc*);
  711. int nfs3WccPack(u8*, u8*, u8**, Nfs3Wcc*);
  712. int nfs3WccUnpack(u8*, u8*, u8**, Nfs3Wcc*);
  713. void nfs3SetAttrPrint(Fmt*, Nfs3SetAttr*);
  714. u32 nfs3SetAttrSize(Nfs3SetAttr*);
  715. int nfs3SetAttrPack(u8*, u8*, u8**, Nfs3SetAttr*);
  716. int nfs3SetAttrUnpack(u8*, u8*, u8**, Nfs3SetAttr*);
  717. extern SunProg nfs3Prog;
  718. void nfs3EntryPrint(Fmt*, Nfs3Entry*);
  719. u32 nfs3EntrySize(Nfs3Entry*);
  720. int nfs3EntryPack(u8*, u8*, u8**, Nfs3Entry*);
  721. int nfs3EntryUnpack(u8*, u8*, u8**, Nfs3Entry*);
  722. void nfs3EntryPlusPrint(Fmt*, Nfs3Entry*);
  723. u32 nfs3EntryPlusSize(Nfs3Entry*);
  724. int nfs3EntryPlusPack(u8*, u8*, u8**, Nfs3Entry*);
  725. int nfs3EntryPlusUnpack(u8*, u8*, u8**, Nfs3Entry*);