/* Make sure we have the following includes for now ... */
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <fcntl.h>
#include <utime.h>
* smbc_statvfs(). These may be OR-ed together to reflect a full set of
* available capabilities.
*/
-typedef enum smbc_vfs_capability
+typedef enum smbc_vfs_feature
{
/* Defined by POSIX or in Linux include files (low-order bits) */
- SMBC_VFS_CAP_RDONLY = (1 << 0),
+ SMBC_VFS_FEATURE_RDONLY = (1 << 0),
/* Specific to libsmbclient (high-order bits) */
- SMBC_VFS_CAP_DFS = (1 << 29),
- SMBC_VFS_CAP_CASE_SENSITIVE = (1 << 30),
- SMBC_VFS_CAP_UNIXCIFS = (1 << 31)
-} smbc_vfs_capability;
+ SMBC_VFS_FEATURE_DFS = (1 << 28),
+ SMBC_VFS_FEATURE_CASE_INSENSITIVE = (1 << 29),
+ SMBC_VFS_FEATURE_NO_UNIXCIFS = (1 << 30)
+} smbc_vfs_feature;
typedef int smbc_bool;
smbc_fstat_fn smbc_getFunctionFstat(SMBCCTX *c);
void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn);
+typedef int (*smbc_statvfs_fn)(SMBCCTX *c,
+ char *path,
+ struct statvfs *st);
+smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c);
+void smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn);
+
typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c,
SMBCFILE *file,
struct statvfs *st);
int smbc_fstat(int fd, struct stat *st);
+/**@ingroup attribute
+ * Get file system information for a specified path.
+ *
+ * @param url The smb url to get information for
+ *
+ * @param st pointer to a buffer that will be filled with
+ * standard Unix struct statvfs information.
+ *
+ * @return EBADF filedes is bad.
+ * - EACCES Permission denied.
+ * - EBADF fd is not a valid file descriptor
+ * - EINVAL Problems occurred in the underlying routines
+ * or smbc_init not called.
+ * - ENOMEM Out of memory
+ *
+ * @see Unix fstatvfs()
+ *
+ */
+int
+smbc_statvfs(char *url,
+ struct statvfs *st);
+
/**@ingroup attribute
* Get file system information via an file descriptor.
*
smbc_fstatvfs(int fd,
struct statvfs *st);
+
/**@ingroup attribute
* Truncate a file given a file descriptor
*
*/
void
-smbc_set_credentials(char *workgroup,
- char *user,
- char *password,
+smbc_set_credentials(const char *workgroup,
+ const char *user,
+ const char *password,
smbc_bool use_kerberos,
- char *signing_state);
+ const char *signing_state);
+
+/*
+ * Wrapper around smbc_set_credentials.
+ * Used to set correct credentials that will
+ * be used to connect to DFS target share
+ * in libsmbclient
+ */
+void
+smbc_set_credentials_with_fallback(SMBCCTX *ctx,
+ const char *workgroup,
+ const char *user,
+ const char *password);
/**
* @ingroup structure