libnfs-raw.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. #ifndef CCAN_NFS_LIBNFS_RAW_H
  2. #define CCAN_NFS_LIBNFS_RAW_H
  3. /*
  4. Copyright (C) by Ronnie Sahlberg <ronniesahlberg@gmail.com> 2010
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, see <http://www.gnu.org/licenses/>.
  15. */
  16. /*
  17. * This is the lowlevel interface to access NFS resources.
  18. * Through this interface you have access to the full gamut of nfs and nfs related
  19. * protocol as well as the XDR encoded/decoded structures.
  20. */
  21. #include <stdint.h>
  22. struct rpc_data {
  23. int size;
  24. unsigned char *data;
  25. };
  26. struct rpc_context;
  27. struct rpc_context *rpc_init_context(void);
  28. void rpc_destroy_context(struct rpc_context *rpc);
  29. struct AUTH;
  30. void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
  31. int rpc_get_fd(struct rpc_context *rpc);
  32. int rpc_which_events(struct rpc_context *rpc);
  33. int rpc_service(struct rpc_context *rpc, int revents);
  34. char *rpc_get_error(struct rpc_context *rpc);
  35. #define RPC_STATUS_SUCCESS 0
  36. #define RPC_STATUS_ERROR 1
  37. #define RPC_STATUS_CANCEL 2
  38. typedef void (*rpc_cb)(struct rpc_context *rpc, int status, void *data, void *private_data);
  39. /*
  40. * Async connection to the tcp port at server:port.
  41. * Function returns
  42. * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
  43. * <0 : An error occurred when trying to set up the connection. The callback will not be invoked.
  44. *
  45. * When the callback is invoked, status indicates the result:
  46. * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
  47. * data is NULL.
  48. * RPC_STATUS_ERROR : The connection failed to establish.
  49. * data is the erro string.
  50. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  51. * : data is NULL.
  52. */
  53. int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, int use_privileged_port, rpc_cb cb, void *private_data);
  54. /*
  55. * When disconnecting a connection in flight. All commands in flight will be called with the callback
  56. * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
  57. */
  58. int rpc_disconnect(struct rpc_context *rpc, char *error);
  59. void rpc_set_error(struct rpc_context *rpc, char *error_string, ...);
  60. /*
  61. * PORTMAP FUNCTIONS
  62. */
  63. /*
  64. * Call PORTMAPPER/NULL
  65. * Function returns
  66. * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
  67. * <0 : An error occurred when trying to set up the connection. The callback will not be invoked.
  68. *
  69. * When the callback is invoked, status indicates the result:
  70. * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
  71. * data is NULL.
  72. * RPC_STATUS_ERROR : An error occurred when trying to contact the portmapper.
  73. * data is the error string.
  74. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  75. * data is NULL.
  76. */
  77. int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  78. /*
  79. * Call PORTMAPPER/GETPORT.
  80. * Function returns
  81. * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
  82. * <0 : An error occurred when trying to set up the connection. The callback will not be invoked.
  83. *
  84. * When the callback is invoked, status indicates the result:
  85. * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
  86. * data is a (uint32_t *), containing the port returned.
  87. * RPC_STATUS_ERROR : An error occurred when trying to contact the portmapper.
  88. * data is the error string.
  89. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  90. * data is NULL.
  91. */
  92. int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data);
  93. /*
  94. * MOUNT FUNCTIONS
  95. */
  96. char *mountstat3_to_str(int stat);
  97. int mountstat3_to_errno(int error);
  98. /*
  99. * Call MOUNT/NULL
  100. * Function returns
  101. * 0 : The call was initiated. The callback will be invoked when the call completes.
  102. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  103. *
  104. * When the callback is invoked, status indicates the result:
  105. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  106. * data is NULL.
  107. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  108. * data is the error string.
  109. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  110. * data is NULL.
  111. */
  112. int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  113. /*
  114. * Call MOUNT/MNT
  115. * Function returns
  116. * 0 : The call was initiated. The callback will be invoked when the call completes.
  117. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  118. *
  119. * When the callback is invoked, status indicates the result:
  120. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  121. * data is mountres3 *.
  122. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  123. * data is the error string.
  124. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  125. * data is NULL.
  126. */
  127. int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
  128. /*
  129. * Call MOUNT/DUMP
  130. * Function returns
  131. * 0 : The call was initiated. The callback will be invoked when the call completes.
  132. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  133. *
  134. * When the callback is invoked, status indicates the result:
  135. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  136. * data is a mountlist.
  137. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  138. * data is the error string.
  139. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  140. * data is NULL.
  141. */
  142. int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  143. /*
  144. * Call MOUNT/UMNT
  145. * Function returns
  146. * 0 : The call was initiated. The callback will be invoked when the call completes.
  147. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  148. *
  149. * When the callback is invoked, status indicates the result:
  150. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  151. * data NULL.
  152. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  153. * data is the error string.
  154. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  155. * data is NULL.
  156. */
  157. int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
  158. /*
  159. * Call MOUNT/UMNTALL
  160. * Function returns
  161. * 0 : The call was initiated. The callback will be invoked when the call completes.
  162. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  163. *
  164. * When the callback is invoked, status indicates the result:
  165. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  166. * data NULL.
  167. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  168. * data is the error string.
  169. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  170. * data is NULL.
  171. */
  172. int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  173. /*
  174. * Call MOUNT/EXPORT
  175. * Function returns
  176. * 0 : The call was initiated. The callback will be invoked when the call completes.
  177. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  178. *
  179. * When the callback is invoked, status indicates the result:
  180. * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
  181. * data is an exports.
  182. * RPC_STATUS_ERROR : An error occurred when trying to contact the mount daemon.
  183. * data is the error string.
  184. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  185. * data is NULL.
  186. */
  187. int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  188. /*
  189. * NFS FUNCTIONS
  190. */
  191. struct nfs_fh3;
  192. char *nfsstat3_to_str(int error);
  193. int nfsstat3_to_errno(int error);
  194. /*
  195. * Call NFS/NULL
  196. * Function returns
  197. * 0 : The call was initiated. The callback will be invoked when the call completes.
  198. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  199. *
  200. * When the callback is invoked, status indicates the result:
  201. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  202. * data is NULL.
  203. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  204. * data is the error string.
  205. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  206. * data is NULL.
  207. */
  208. int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  209. /*
  210. * Call NFS/GETATTR
  211. * Function returns
  212. * 0 : The call was initiated. The callback will be invoked when the call completes.
  213. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  214. *
  215. * When the callback is invoked, status indicates the result:
  216. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  217. * data is GETATTR3res
  218. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  219. * data is the error string.
  220. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  221. * data is NULL.
  222. */
  223. int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
  224. /*
  225. * Call NFS/LOOKUP
  226. * Function returns
  227. * 0 : The call was initiated. The callback will be invoked when the call completes.
  228. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  229. *
  230. * When the callback is invoked, status indicates the result:
  231. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  232. * data is LOOKUP3res
  233. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  234. * data is the error string.
  235. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  236. * data is NULL.
  237. */
  238. int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
  239. /*
  240. * Call NFS/ACCESS
  241. * Function returns
  242. * 0 : The call was initiated. The callback will be invoked when the call completes.
  243. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  244. *
  245. * When the callback is invoked, status indicates the result:
  246. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  247. * data is ACCESS3res
  248. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  249. * data is the error string.
  250. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  251. * data is NULL.
  252. */
  253. int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
  254. /*
  255. * Call NFS/READ
  256. * Function returns
  257. * 0 : The call was initiated. The callback will be invoked when the call completes.
  258. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  259. *
  260. * When the callback is invoked, status indicates the result:
  261. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  262. * data is ACCESS3res
  263. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  264. * data is the error string.
  265. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  266. * data is NULL.
  267. */
  268. int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, nfs_off_t offset, size_t count, void *private_data);
  269. /*
  270. * Call NFS/WRITE
  271. * Function returns
  272. * 0 : The call was initiated. The callback will be invoked when the call completes.
  273. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  274. *
  275. * When the callback is invoked, status indicates the result:
  276. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  277. * data is WRITE3res *
  278. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  279. * data is the error string.
  280. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  281. * data is NULL.
  282. */
  283. int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, nfs_off_t offset, size_t count, int stable_how, void *private_data);
  284. /*
  285. * Call NFS/COMMIT
  286. * Function returns
  287. * 0 : The call was initiated. The callback will be invoked when the call completes.
  288. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  289. *
  290. * When the callback is invoked, status indicates the result:
  291. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  292. * data is COMMIT3res *
  293. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  294. * data is the error string.
  295. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  296. * data is NULL.
  297. */
  298. int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
  299. /*
  300. * Call NFS/SETATTR
  301. * Function returns
  302. * 0 : The call was initiated. The callback will be invoked when the call completes.
  303. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  304. *
  305. * When the callback is invoked, status indicates the result:
  306. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  307. * data is SETATTR3res *
  308. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  309. * data is the error string.
  310. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  311. * data is NULL.
  312. */
  313. struct SETATTR3args;
  314. int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
  315. /*
  316. * Call NFS/MKDIR
  317. * Function returns
  318. * 0 : The call was initiated. The callback will be invoked when the call completes.
  319. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  320. *
  321. * When the callback is invoked, status indicates the result:
  322. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  323. * data is MKDIR3res *
  324. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  325. * data is the error string.
  326. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  327. * data is NULL.
  328. */
  329. int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
  330. /*
  331. * Call NFS/RMDIR
  332. * Function returns
  333. * 0 : The call was initiated. The callback will be invoked when the call completes.
  334. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  335. *
  336. * When the callback is invoked, status indicates the result:
  337. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  338. * data is RMDIR3res *
  339. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  340. * data is the error string.
  341. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  342. * data is NULL.
  343. */
  344. int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
  345. /*
  346. * Call NFS/CREATE
  347. * Function returns
  348. * 0 : The call was initiated. The callback will be invoked when the call completes.
  349. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  350. *
  351. * When the callback is invoked, status indicates the result:
  352. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  353. * data is CREATE3res *
  354. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  355. * data is the error string.
  356. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  357. * data is NULL.
  358. */
  359. int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, int mode, void *private_data);
  360. /*
  361. * Call NFS/REMOVE
  362. * Function returns
  363. * 0 : The call was initiated. The callback will be invoked when the call completes.
  364. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  365. *
  366. * When the callback is invoked, status indicates the result:
  367. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  368. * data is REMOVE3res *
  369. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  370. * data is the error string.
  371. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  372. * data is NULL.
  373. */
  374. int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
  375. /*
  376. * Call NFS/REMOVE
  377. * Function returns
  378. * 0 : The call was initiated. The callback will be invoked when the call completes.
  379. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  380. *
  381. * When the callback is invoked, status indicates the result:
  382. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  383. * data is READDIR3res *
  384. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  385. * data is the error string.
  386. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  387. * data is NULL.
  388. */
  389. int rpc_nfs_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t cookie, char *cookieverf, int count, void *private_data);
  390. /*
  391. * Call NFS/FSSTAT
  392. * Function returns
  393. * 0 : The call was initiated. The callback will be invoked when the call completes.
  394. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  395. *
  396. * When the callback is invoked, status indicates the result:
  397. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  398. * data is FSSTAT3res
  399. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  400. * data is the error string.
  401. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  402. * data is NULL.
  403. */
  404. int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
  405. /*
  406. * Call NFS/READLINK
  407. * Function returns
  408. * 0 : The call was initiated. The callback will be invoked when the call completes.
  409. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  410. *
  411. * When the callback is invoked, status indicates the result:
  412. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  413. * data is READLINK3res *
  414. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  415. * data is the error string.
  416. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  417. * data is NULL.
  418. */
  419. int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
  420. /*
  421. * Call NFS/SYMLINK
  422. * Function returns
  423. * 0 : The call was initiated. The callback will be invoked when the call completes.
  424. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  425. *
  426. * When the callback is invoked, status indicates the result:
  427. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  428. * data is SYMLINK3res *
  429. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  430. * data is the error string.
  431. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  432. * data is NULL.
  433. */
  434. int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *newname, char *oldpath, void *private_data);
  435. /*
  436. * Call NFS/RENAME
  437. * Function returns
  438. * 0 : The call was initiated. The callback will be invoked when the call completes.
  439. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  440. *
  441. * When the callback is invoked, status indicates the result:
  442. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  443. * data is RENAME3res *
  444. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  445. * data is the error string.
  446. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  447. * data is NULL.
  448. */
  449. int rpc_nfs_rename_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *olddir, char *oldname, struct nfs_fh3 *newdir, char *newname, void *private_data);
  450. /*
  451. * Call NFS/LINK
  452. * Function returns
  453. * 0 : The call was initiated. The callback will be invoked when the call completes.
  454. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  455. *
  456. * When the callback is invoked, status indicates the result:
  457. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  458. * data is LINK3res *
  459. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  460. * data is the error string.
  461. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  462. * data is NULL.
  463. */
  464. int rpc_nfs_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, struct nfs_fh3 *newdir, char *newname, void *private_data);
  465. /*
  466. * NFSACL FUNCTIONS
  467. */
  468. /*
  469. * Call NFSACL/NULL
  470. * Function returns
  471. * 0 : The call was initiated. The callback will be invoked when the call completes.
  472. * <0 : An error occurred when trying to set up the call. The callback will not be invoked.
  473. *
  474. * When the callback is invoked, status indicates the result:
  475. * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
  476. * data is NULL.
  477. * RPC_STATUS_ERROR : An error occurred when trying to contact the nfs daemon.
  478. * data is the error string.
  479. * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
  480. * data is NULL.
  481. */
  482. int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
  483. #endif /* CCAN_NFS_LIBNFS_RAW_H */