1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 #ifndef _LIBFKSMBFS_H_
  17 #define _LIBFKSMBFS_H_
  18 
  19 /*
  20  * Declarations for exports in fake_vfs.c
  21  */
  22 
  23 #include <sys/types.h>
  24 #include <sys/cred.h>
  25 #include <sys/vnode.h>
  26 #include <sys/vfs.h>
  27 
  28 #ifndef MAXOFF32_T
  29 #define MAXOFF32_T      0x7fffffff
  30 #endif
  31 
  32 #ifdef __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 /*
  37  * Need these visible outside _FAKE_KERNEL for the test CLI.
  38  * In the kmod/lib build these duplicate declarations in vfs.h or
  39  * vnode.h but that's OK as long as the declarations are identical.
  40  */
  41 struct mounta;
  42 struct stat64;
  43 int     fake_installfs(vfsdef_t *);
  44 int     fake_removefs(vfsdef_t *);
  45 int     fake_domount(char *, struct mounta *, struct vfs **);
  46 int     fake_dounmount(struct vfs *, int);
  47 int     fake_lookup(vnode_t *, char *, vnode_t **);
  48 int     fake_lookup_dir(char *, vnode_t **, char **);
  49 int     fake_stat(vnode_t *, struct stat64 *, int);
  50 int     fake_getdents(vnode_t *, offset_t *, void *, size_t);
  51 ssize_t fake_pread(vnode_t *, void *, size_t, off_t);
  52 ssize_t fake_pwrite(vnode_t *, void *, size_t, off_t);
  53 int     fake_unlink(char *, int);
  54 int     fake_rename(char *, char *);
  55 
  56 int     vn_close_rele(vnode_t *vp, int flag);
  57 int     vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
  58                 struct vnode **vpp, enum create crwhy, mode_t umask);
  59 int     vn_create(char *pnamep, enum uio_seg seg, struct vattr *vap,
  60                 enum vcexcl excl, int mode, struct vnode **vpp,
  61                 enum create why, int flag, mode_t umask);
  62 
  63 void    vn_rele(struct vnode *vp);
  64 
  65 /* In the real smbfs, these are _init(), _fini() */
  66 int fksmbfs_init(void);
  67 int fksmbfs_fini(void);
  68 
  69 #ifdef __cplusplus
  70 }
  71 #endif
  72 
  73 #endif /* _LIBFKSMBFS_H_ */