nfs3.h 15 KB

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