smbnetfs  0.6.3
About: SMBNetFS is a Linux/FreeBSD filesystem that allow you to use samba/microsoft network in the same manner as the network neighborhood in Microsoft Windows.
  Fossies Dox: smbnetfs-0.6.3.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Go to the documentation of this file.
1 #ifndef __SMB_CONN_H__
2 #define __SMB_CONN_H__
4 #include <time.h>
5 #include <sys/types.h>
6 #include <unistd.h>
7 #include "smb_conn_proto.h"
8 #include "list.h"
10 struct smb_conn_ctx{
12  time_t access_time;
13  pthread_mutex_t mutex;
14  char *shmem_ptr;
15  size_t shmem_size;
16  int conn_fd;
17 };
21  time_t access_time; // file_handle acess time
22  smb_conn_srv_fd srv_fd; // smb_conn_srv file descriptor
23  struct smb_conn_ctx *ctx; // smb_conn context
24  char *url; // samba url (without "smb:/")
27 };
29 typedef struct smb_conn_file* smb_conn_fd;
32 int smb_conn_set_max_retry_count(int count);
34 int smb_conn_set_server_reply_timeout(int timeout);
36 int smb_conn_ctx_init(struct smb_conn_ctx *ctx, size_t shmem_size);
40  const char *url, int flags, mode_t mode);
42  const char *url, mode_t mode);
43 ssize_t smb_conn_read(struct smb_conn_ctx *ctx,
44  smb_conn_fd fd, off_t offset,
45  void *buf, size_t bufsize);
46 ssize_t smb_conn_write(struct smb_conn_ctx *ctx,
47  smb_conn_fd fd, off_t offset,
48  const void *buf, size_t bufsize);
49 int smb_conn_close(struct smb_conn_ctx *ctx,
50  smb_conn_fd fd);
51 int smb_conn_unlink(struct smb_conn_ctx *ctx,
52  const char *url);
53 int smb_conn_rename(struct smb_conn_ctx *ctx,
54  const char *old_url, const char *new_url);
56  const char *url);
58  smb_conn_fd fd);
59 ssize_t smb_conn_readdir(struct smb_conn_ctx *ctx,
60  smb_conn_fd fd, void *buf, size_t bufsize);
61 int smb_conn_mkdir(struct smb_conn_ctx *ctx,
62  const char *url, mode_t mode);
63 int smb_conn_rmdir(struct smb_conn_ctx *ctx,
64  const char *url);
65 int smb_conn_stat(struct smb_conn_ctx *ctx,
66  const char *url, struct stat *st);
67 int smb_conn_fstat(struct smb_conn_ctx *ctx,
68  smb_conn_fd fd, struct stat *st);
70  smb_conn_fd fd, off_t size);
71 int smb_conn_chmod(struct smb_conn_ctx *ctx,
72  const char *url, mode_t mode);
73 int smb_conn_utimes(struct smb_conn_ctx *ctx,
74  const char *url, struct timeval *tbuf);
76  const char *url, const char *name,
77  const void *value, size_t size, int flags);
79  const char *url, const char *name,
80  void *value, size_t size);
82  const char *url,
83  char *list, size_t size);
85  const char *url, const char *name);
87 #endif /* __SMB_CONN_H__ */
smb_conn_fd smb_conn_creat(struct smb_conn_ctx *ctx, const char *url, mode_t mode)
Definition: smb_conn.c:650
int smb_conn_closedir(struct smb_conn_ctx *ctx, smb_conn_fd fd)
Definition: smb_conn.c:902
smb_conn_fd smb_conn_opendir(struct smb_conn_ctx *ctx, const char *url)
Definition: smb_conn.c:858
ssize_t smb_conn_write(struct smb_conn_ctx *ctx, smb_conn_fd fd, off_t offset, const void *buf, size_t bufsize)
Definition: smb_conn.c:737
int smb_conn_chmod(struct smb_conn_ctx *ctx, const char *url, mode_t mode)
Definition: smb_conn.c:1151
int smb_conn_removexattr(struct smb_conn_ctx *ctx, const char *url, const char *name)
Definition: smb_conn.c:1309
int smb_conn_fstat(struct smb_conn_ctx *ctx, smb_conn_fd fd, struct stat *st)
Definition: smb_conn.c:1080
int smb_conn_getxattr(struct smb_conn_ctx *ctx, const char *url, const char *name, void *value, size_t size)
Definition: smb_conn.c:1228
int smb_conn_rename(struct smb_conn_ctx *ctx, const char *old_url, const char *new_url)
Definition: smb_conn.c:836
smb_conn_fd smb_conn_open(struct smb_conn_ctx *ctx, const char *url, int flags, mode_t mode)
Definition: smb_conn.c:604
int smb_conn_close(struct smb_conn_ctx *ctx, smb_conn_fd fd)
Definition: smb_conn.c:779
int smb_conn_listxattr(struct smb_conn_ctx *ctx, const char *url, char *list, size_t size)
Definition: smb_conn.c:1269
int smb_conn_ctx_destroy(struct smb_conn_ctx *ctx)
Definition: smb_conn.c:160
int smb_conn_ftruncate(struct smb_conn_ctx *ctx, smb_conn_fd fd, off_t size)
Definition: smb_conn.c:1116
int smb_conn_ctx_init(struct smb_conn_ctx *ctx, size_t shmem_size)
Definition: smb_conn.c:142
struct smb_conn_file * smb_conn_fd
Definition: smb_conn.h:29
ssize_t smb_conn_read(struct smb_conn_ctx *ctx, smb_conn_fd fd, off_t offset, void *buf, size_t bufsize)
Definition: smb_conn.c:695
ssize_t smb_conn_readdir(struct smb_conn_ctx *ctx, smb_conn_fd fd, void *buf, size_t bufsize)
Definition: smb_conn.c:938
int smb_conn_set_max_passwd_query_count(int count)
Definition: smb_conn.c:93
int smb_conn_stat(struct smb_conn_ctx *ctx, const char *url, struct stat *st)
Definition: smb_conn.c:1057
int smb_conn_unlink(struct smb_conn_ctx *ctx, const char *url)
Definition: smb_conn.c:815
int smb_conn_utimes(struct smb_conn_ctx *ctx, const char *url, struct timeval *tbuf)
Definition: smb_conn.c:1173
int smb_conn_mkdir(struct smb_conn_ctx *ctx, const char *url, mode_t mode)
Definition: smb_conn.c:1014
int smb_conn_rmdir(struct smb_conn_ctx *ctx, const char *url)
Definition: smb_conn.c:1036
int smb_conn_set_max_retry_count(int count)
Definition: smb_conn.c:82
int smb_conn_set_server_reply_timeout(int timeout)
Definition: smb_conn.c:104
int smb_conn_setxattr(struct smb_conn_ctx *ctx, const char *url, const char *name, const void *value, size_t size, int flags)
Definition: smb_conn.c:1195
Definition: list.h:6
LIST smb_conn_file_list
Definition: smb_conn.h:11
char * shmem_ptr
Definition: smb_conn.h:14
size_t shmem_size
Definition: smb_conn.h:15
int conn_fd
Definition: smb_conn.h:16
pthread_mutex_t mutex
Definition: smb_conn.h:13
time_t access_time
Definition: smb_conn.h:12
smb_conn_srv_fd srv_fd
Definition: smb_conn.h:22
LIST entries
Definition: smb_conn.h:20
char * url
Definition: smb_conn.h:24
struct smb_conn_ctx * ctx
Definition: smb_conn.h:23
enum smb_conn_cmd reopen_cmd
Definition: smb_conn.h:25
int reopen_flags
Definition: smb_conn.h:26
time_t access_time
Definition: smb_conn.h:21