"Fossies" - the Fresh Open Source Software Archive

Member "smbnetfs-0.6.3/src/smb_conn_proto.h" (3 Jan 2015, 3416 Bytes) of package /linux/misc/smbnetfs-0.6.3.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "smb_conn_proto.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.5.3b_vs_0.6.0.

    1 #ifndef __SMB_CONN_PROTO_H__
    2 #define __SMB_CONN_PROTO_H__
    3 
    4 #include <sys/types.h>
    5 #include <sys/stat.h>
    6 #include <unistd.h>
    7 
    8 #define COMM_BUF_SIZE       4096
    9 #define MAX_FILENAME_LEN    255
   10 
   11 typedef void *      smb_conn_srv_fd;
   12 
   13 enum smb_conn_cmd{
   14     DIE_MSG = -3,
   15     MESSAGE = -2,
   16     PASSWORD = -1,
   17     OPEN = 0,
   18     CREAT,
   19     READ,
   20     WRITE,
   21     CLOSE,
   22     UNLINK,
   23     RENAME,
   24     OPENDIR,
   25     CLOSEDIR,
   26     READDIR,
   27     MKDIR,
   28     RMDIR,
   29     STAT,
   30     FSTAT,
   31     FTRUNCATE,
   32     CHMOD,
   33     UTIMES,
   34     SETXATTR,
   35     GETXATTR,
   36     LISTXATTR,
   37     REMOVEXATTR
   38 };
   39 
   40 struct smb_conn_query_hdr{
   41     size_t          query_len;
   42     enum smb_conn_cmd       query_cmd;
   43     int             debug_level;
   44 };
   45 
   46 struct smb_conn_reply_hdr{
   47     size_t          reply_len;
   48     enum smb_conn_cmd       reply_cmd;
   49     int             errno_value;
   50 };
   51 
   52 struct smb_conn_dirent_rec{
   53     unsigned int        smbc_type;  /* see struct smbc_dirent from libsmbclient.h */
   54     char            d_name[MAX_FILENAME_LEN + 1];
   55 };
   56 
   57 /* ------------------------------- */
   58 
   59 /* UNLINK, OPENDIR, RMDIR, STAT, */
   60 struct smb_conn_url_query{
   61     size_t          url_offs;
   62 };
   63 
   64 /* CREAT, CHMOD, MKDIR */
   65 struct smb_conn_url_mode_query{
   66     size_t          url_offs;
   67     mode_t          mode;
   68 };
   69 
   70 /* OPEN */
   71 struct smb_conn_open_query{
   72     size_t          url_offs;
   73     mode_t          mode;
   74     int             flags;
   75 };
   76 
   77 /* RENAME */
   78 struct smb_conn_rename_query{
   79     size_t          old_url_offs;
   80     size_t          new_url_offs;
   81 };
   82 
   83 /* UTIMES */
   84 struct smb_conn_utimes_query{
   85     size_t          url_offs;
   86     struct timeval      tbuf[2];
   87 };
   88 
   89 /* CLOSE, CLOSEDIR, FSTAT */
   90 struct smb_conn_fd_query{
   91     smb_conn_srv_fd     srv_fd;
   92 };
   93 
   94 /* FTRUNCATE */
   95 struct smb_conn_ftruncate_query{
   96     smb_conn_srv_fd     srv_fd;
   97     off_t           offset;
   98 };
   99 
  100 /* READ, WRITE, READDIR */
  101 struct smb_conn_rw_query{
  102     smb_conn_srv_fd     srv_fd;
  103     off_t           offset;
  104     size_t          bufsize;
  105 };
  106 
  107 /* LISTXATTR */
  108 struct smb_conn_listxattr_query{
  109     size_t          url_offs;
  110     size_t          bufsize;
  111 };
  112 
  113 /* GETXATTR */
  114 struct smb_conn_getxattr_query{
  115     size_t          url_offs;
  116     size_t          name_offs;
  117     size_t          bufsize;
  118 };
  119 
  120 /* SETXATTR */
  121 struct smb_conn_setxattr_query{
  122     size_t          url_offs;
  123     size_t          name_offs;
  124     size_t          bufsize;
  125     int             flags;
  126 };
  127 
  128 /* REMOVEXATTR */
  129 struct smb_conn_removexattr_query{
  130     size_t          url_offs;
  131     size_t          name_offs;
  132 };
  133 
  134 /* PASSWORD */
  135 struct smb_conn_passwd{
  136     size_t          domain_offs;
  137     size_t          username_offs;
  138     size_t          password_offs;
  139 };
  140 
  141 /* ------------------------------- */
  142 
  143 /* CLOSE, FTRUNCATE, UNLINK, RENAME, CLOSEDIR, MKDIR, RMDIR, CHMOD, UTIMES, SETXATTR, REMOVEXATTR */
  144 struct smb_conn_no_reply{
  145 };
  146 
  147 /* OPEN, CREAT, OPENDIR */
  148 struct smb_conn_fd_reply{
  149     smb_conn_srv_fd     srv_fd;
  150 };
  151 
  152 /* READ, WRITE, READDIR, GETXATTR, LISTXATTR */
  153 struct smb_conn_buf_reply{
  154     ssize_t         bufsize;
  155 };
  156 
  157 /* STAT, FSTAT */
  158 struct smb_conn_stat_reply{
  159     struct stat         stat;
  160 };
  161 
  162 /* PASSWORD */
  163 struct smb_conn_passwd_req{
  164     size_t          server_offs;
  165     size_t          share_offs;
  166 };
  167 
  168 /* MESSAGE and DIE_MSG */
  169 struct smb_conn_message_req{
  170     pid_t           pid;
  171     int             debug_level;
  172     size_t          msg_offs;
  173 };
  174 
  175 
  176 /* ------------------------------- */
  177 
  178 struct smb_conn_srv_ctx{
  179     int             conn_fd;
  180     char            *shmem_ptr;
  181     size_t          shmem_size;
  182     int             timeout;
  183     int             smb_timeout;
  184     int             debug_level;
  185     int             smb_debug_level;
  186     const char          *local_charset;
  187     const char          *samba_charset;
  188 };
  189 
  190 
  191 void smb_conn_srv_listen(struct smb_conn_srv_ctx *ctx);
  192 
  193 #endif /* __SMB_CONN_PROTO_H__ */