The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/smbfs/smbfs_subr.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: smbfs_subr.h,v 1.9.4.1 2004/05/23 10:45:28 tron Exp $  */
    2 
    3 /*
    4  * Copyright (c) 2000-2001, Boris Popov
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. All advertising materials mentioning features or use of this software
   16  *    must display the following acknowledgement:
   17  *    This product includes software developed by Boris Popov.
   18  * 4. Neither the name of the author nor the names of any co-contributors
   19  *    may be used to endorse or promote products derived from this software
   20  *    without specific prior written permission.
   21  *
   22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   32  * SUCH DAMAGE.
   33  *
   34  * FreeBSD: src/sys/fs/smbfs/smbfs_subr.h,v 1.2 2001/12/10 08:09:46 obrien Exp
   35  */
   36 #ifndef _FS_SMBFS_SMBFS_SUBR_H_
   37 #define _FS_SMBFS_SMBFS_SUBR_H_
   38 
   39 MALLOC_DECLARE(M_SMBNODENAME);
   40 MALLOC_DECLARE(M_SMBFSDATA);
   41 
   42 #define SMBFSERR(format, args...) printf("%s: "format, __func__ ,## args)
   43 
   44 #ifdef SMB_VNODE_DEBUG
   45 #define SMBVDEBUG(format, args...) printf("%s: "format, __func__ ,## args)
   46 #else
   47 #define SMBVDEBUG(format, args...)
   48 #endif
   49 
   50 /*
   51  * Possible lock commands
   52  */
   53 #define SMB_LOCK_EXCL           0
   54 #define SMB_LOCK_SHARED         1
   55 #define SMB_LOCK_RELEASE        2
   56 
   57 struct smbmount;
   58 struct proc;
   59 struct timespec;
   60 struct ucred;
   61 struct vattr;
   62 struct vnode;
   63 struct statfs;
   64 
   65 struct smbfattr {
   66         int             fa_attr;
   67         int64_t         fa_size;
   68         struct timespec fa_atime;
   69         struct timespec fa_ctime;
   70         struct timespec fa_mtime;
   71         long            fa_ino;
   72 };
   73 
   74 /*
   75  * Context to perform findfirst/findnext/findclose operations
   76  */
   77 #define SMBFS_RDD_FINDFIRST     0x01
   78 #define SMBFS_RDD_EOF           0x02
   79 #define SMBFS_RDD_FINDSINGLE    0x04
   80 #define SMBFS_RDD_USESEARCH     0x08
   81 #define SMBFS_RDD_NOCLOSE       0x10
   82 #define SMBFS_RDD_GOTRNAME      0x1000
   83 
   84 /*
   85  * Search context supplied by server
   86  */
   87 #define SMB_SKEYLEN             21                      /* search context */
   88 #define SMB_DENTRYLEN           (SMB_SKEYLEN + 22)      /* entire entry */
   89 
   90 struct smbfs_fctx {
   91         /*
   92          * Setable values
   93          */
   94         int             f_flags;        /* SMBFS_RDD_ */
   95         /*
   96          * Return values
   97          */
   98         struct smbfattr f_attr;         /* current attributes */
   99         char *          f_name;         /* current file name */
  100         int             f_nmlen;        /* name len */
  101         /*
  102          * Internal variables
  103          */
  104         int             f_limit;        /* maximum number of entries */
  105         int             f_attrmask;     /* SMB_FA_ */
  106         int             f_wclen;
  107         const char *    f_wildcard;
  108         struct smbnode* f_dnp;
  109         struct smb_cred*f_scred;
  110         struct smb_share *f_ssp;
  111         union {
  112                 struct smb_rq * uf_rq;
  113                 struct smb_t2rq * uf_t2;
  114         } f_urq;
  115         int             f_left;         /* entries left */
  116         int             f_ecnt;         /* entries left in the current reponse */
  117         int             f_eofs;         /* entry offset in the parameter block */
  118         u_char          f_skey[SMB_SKEYLEN]; /* server side search context */
  119         char            f_fname[8 + 1 + 3 + 1]; /* common case for 8.3 filenames */
  120         u_int16_t       f_Sid;
  121         u_int16_t       f_infolevel;
  122         int             f_rnamelen;
  123         char *          f_rname;        /* resume name/key */
  124         int             f_rnameofs;
  125 };
  126 
  127 #define f_rq    f_urq.uf_rq
  128 #define f_t2    f_urq.uf_t2
  129 
  130 /*
  131  * smb level
  132  */
  133 int  smbfs_smb_lock(struct smbnode *np, int op, caddr_t id,
  134         off_t start, off_t end, struct smb_cred *scred);
  135 int  smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp,
  136         struct smb_cred *scred);
  137 int  smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp,
  138         struct smb_cred *scred);
  139 int  smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred);
  140 
  141 int  smbfs_smb_setpattr(struct smbnode *np, u_int16_t attr,
  142         struct timespec *mtime, struct smb_cred *scred);
  143 int  smbfs_smb_setptime2(struct smbnode *np, struct timespec *mtime,
  144         struct timespec *atime, int attr, struct smb_cred *scred);
  145 #if 0
  146 int  smbfs_smb_setpattrNT(struct smbnode *np, u_int16_t attr,
  147         struct timespec *mtime, struct timespec *atime, struct smb_cred *scred);
  148 #endif
  149 
  150 int  smbfs_smb_setftime(struct smbnode *np, struct timespec *mtime,
  151         struct timespec *atime, struct smb_cred *scred);
  152 int  smbfs_smb_setfattrNT(struct smbnode *np, u_int16_t attr,
  153         struct timespec *mtime, struct timespec *atime, struct smb_cred *scred);
  154 
  155 int  smbfs_smb_open(struct smbnode *np, int accmode, struct smb_cred *scred);
  156 int  smbfs_smb_close(struct smb_share *ssp, u_int16_t fid,
  157          struct timespec *mtime, struct smb_cred *scred);
  158 int  smbfs_smb_create(struct smbnode *dnp, const char *name, int len,
  159         struct smb_cred *scred);
  160 int  smbfs_smb_delete(struct smbnode *np, struct smb_cred *scred);
  161 int  smbfs_smb_rename(struct smbnode *src, struct smbnode *tdnp,
  162         const char *tname, int tnmlen, struct smb_cred *scred);
  163 int  smbfs_smb_move(struct smbnode *src, struct smbnode *tdnp,
  164         const char *tname, int tnmlen, u_int16_t flags, struct smb_cred *scred);
  165 int  smbfs_smb_mkdir(struct smbnode *dnp, const char *name, int len,
  166         struct smb_cred *scred);
  167 int  smbfs_smb_rmdir(struct smbnode *np, struct smb_cred *scred);
  168 int  smbfs_smb_ntcreatex(struct smbnode *, int accmode, struct smb_cred *);
  169 int  smbfs_smb_nt_dirnotify_setup(struct smbnode *, struct smb_rq **, struct smb_cred *, void (*)(void *), void *);
  170 int  smbfs_smb_nt_dirnotify_fetch(struct smb_rq *, int *);
  171 int  smbfs_smb_ntcancel(struct smb_connobj *, u_int16_t, struct smb_cred *);
  172 int  smbfs_findopen(struct smbnode *dnp, const char *wildcard, int wclen,
  173         int attr, struct smb_cred *scred, struct smbfs_fctx **ctxpp);
  174 int  smbfs_findnext(struct smbfs_fctx *ctx, int limit, struct smb_cred *scred);
  175 int  smbfs_findclose(struct smbfs_fctx *ctx, struct smb_cred *scred);
  176 int  smbfs_fullpath(struct mbchain *mbp, struct smb_vc *vcp,
  177         struct smbnode *dnp, const char *name, int nmlen);
  178 int  smbfs_smb_lookup(struct smbnode *dnp, const char *name, int nmlen,
  179         struct smbfattr *fap, struct smb_cred *scred);
  180 
  181 int  smbfs_fname_tolocal(struct smb_vc *vcp, char *name, int nmlen, int caseopt);
  182 
  183 void  smb_time_local2server(struct timespec *tsp, int tzoff, u_long *seconds);
  184 void  smb_time_server2local(u_long seconds, int tzoff, struct timespec *tsp);
  185 void  smb_time_NT2local(int64_t nsec, int tzoff, struct timespec *tsp);
  186 void  smb_time_local2NT(struct timespec *tsp, int tzoff, int64_t *nsec);
  187 void  smb_time_unix2dos(struct timespec *tsp, int tzoff, u_int16_t *ddp, 
  188              u_int16_t *dtp, u_int8_t *dhp);
  189 void smb_dos2unixtime (u_int dd, u_int dt, u_int dh, int tzoff, struct timespec *tsp);
  190 
  191 #ifdef SYSCTL_SETUP_PROTO
  192 SYSCTL_SETUP_PROTO(sysctl_vfs_samba_setup);
  193 #endif /* SYSCTL_SETUP_PROTO */
  194 #endif /* !_FS_SMBFS_SMBFS_SUBR_H_ */

Cache object: 239824a3e39bca11401af0135cea8114


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.