using READDIRPLUS3 we get some extra fields for the direentry structure for free...
[deb_libnfs.git] / include / libnfs.h
index bbca07e1f809192a34138929640689ef361bbdc1..3a8304a00f9187f782d951d1fa0ae9996d2c9e0e 100644 (file)
@@ -582,6 +582,14 @@ struct nfsdirent  {
        struct nfsdirent *next;
        char *name;
        uint64_t inode;
+
+       /* some extra fields we get for free through the READDIRPLUS3 call. You need libnfs-raw-nfs.h for these */
+       uint32_t type; /* NF3REG, NF3DIR, NF3BLK, ... */
+       uint32_t mode;
+       uint64_t size;
+       struct timeval atime;
+       struct timeval mtime;
+       struct timeval ctime;
 };
 /*
  * nfs_readdir() never blocks, so no special sync/async versions are available
@@ -937,8 +945,42 @@ int nfs_link(struct nfs_context *nfs, const char *oldpath, const char *newpath);
  *          data is the error string.
  */
 int mount_getexports_async(struct rpc_context *rpc, const char *server, rpc_cb cb, void *private_data);
+/*
+ * Sync getexports(<server>)
+ * Function returns
+ *            NULL : something failed
+ *  exports export : a linked list of exported directories
+ * 
+ * returned data must be freed by calling mount_free_export_list(exportnode);
+ */
+struct exportnode *mount_getexports(const char *server);
 
+void mount_free_export_list(struct exportnode *exports);
 
 
 //qqq replace later with lseek(cur, 0)
 off_t nfs_get_current_offset(struct nfsfh *nfsfh);
+
+
+
+
+
+struct nfs_server_list {
+       struct nfs_server_list *next;
+       char *addr;
+};
+
+/*
+ * Sync find_local_servers(<server>)
+ * This function will probe all local networks for NFS server. This function will
+ * block for one second while awaiting for all nfs servers to respond.
+ *
+ * Function returns
+ * NULL : something failed
+ *
+ * struct nfs_server_list : a linked list of all discovered servers
+ * 
+ * returned data must be freed by nfs_free_srvr_list(srv);
+ */
+struct nfs_server_list *nfs_find_local_servers(void);
+void free_nfs_srvr_list(struct nfs_server_list *srv);