nfs3.h 15 KB

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