47b46a4db756890be4d4ef3b23b1e45a6b8c99e9
[obnox/samba/samba-obnox.git] / examples / VFS / skel_opaque.c
1 /* 
2  * Skeleton VFS module.  Implements dummy versions of all VFS
3  * functions.
4  *
5  * Copyright (C) Tim Potter, 1999-2000
6  * Copyright (C) Alexander Bokovoy, 2002
7  * Copyright (C) Stefan (metze) Metzmacher, 2003
8  * Copyright (C) Jeremy Allison 2009
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *  
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *  
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #include "../source3/include/includes.h"
25 #include "lib/util/tevent_ntstatus.h"
26
27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
28    SAMBA DEVELOPERS GUIDE!!!!!!
29  */
30
31 /* If you take this file as template for your module
32  * you must re-implement every function.
33  */
34
35 static int skel_connect(vfs_handle_struct *handle, const char *service,
36                         const char *user)
37 {
38         errno = ENOSYS;
39         return -1;
40 }
41
42 static void skel_disconnect(vfs_handle_struct *handle)
43 {
44         ;
45 }
46
47 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
48                                bool small_query, uint64_t *bsize,
49                                uint64_t *dfree, uint64_t *dsize)
50 {
51         *bsize = 0;
52         *dfree = 0;
53         *dsize = 0;
54         return 0;
55 }
56
57 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
58                           unid_t id, SMB_DISK_QUOTA *dq)
59 {
60         errno = ENOSYS;
61         return -1;
62 }
63
64 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
65                           unid_t id, SMB_DISK_QUOTA *dq)
66 {
67         errno = ENOSYS;
68         return -1;
69 }
70
71 static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
72                                      files_struct *fsp,
73                                      struct shadow_copy_data *shadow_copy_data,
74                                      bool labels)
75 {
76         errno = ENOSYS;
77         return -1;
78 }
79
80 static int skel_statvfs(struct vfs_handle_struct *handle,
81                         const char *path, struct vfs_statvfs_struct *statbuf)
82 {
83         errno = ENOSYS;
84         return -1;
85 }
86
87 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
88                                      enum timestamp_set_resolution *p_ts_res)
89 {
90         return 0;
91 }
92
93 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
94                                        struct dfs_GetDFSReferral *r)
95 {
96         return NT_STATUS_NOT_IMPLEMENTED;
97 }
98
99 static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname,
100                          const char *mask, uint32 attr)
101 {
102         return NULL;
103 }
104
105 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
106                            const char *mask, uint32 attr)
107 {
108         return NULL;
109 }
110
111 static struct dirent *skel_readdir(vfs_handle_struct *handle,
112                                    DIR *dirp, SMB_STRUCT_STAT *sbuf)
113 {
114         return NULL;
115 }
116
117 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
118 {
119         ;
120 }
121
122 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
123 {
124         return (long)-1;
125 }
126
127 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
128 {
129         ;
130 }
131
132 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
133 {
134         errno = ENOSYS;
135         return -1;
136 }
137
138 static int skel_rmdir(vfs_handle_struct *handle, const char *path)
139 {
140         errno = ENOSYS;
141         return -1;
142 }
143
144 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
145 {
146         errno = ENOSYS;
147         return -1;
148 }
149
150 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
151 {
152         ;
153 }
154
155 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
156                      files_struct *fsp, int flags, mode_t mode)
157 {
158         errno = ENOSYS;
159         return -1;
160 }
161
162 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
163                                  struct smb_request *req,
164                                  uint16_t root_dir_fid,
165                                  struct smb_filename *smb_fname,
166                                  uint32_t access_mask,
167                                  uint32_t share_access,
168                                  uint32_t create_disposition,
169                                  uint32_t create_options,
170                                  uint32_t file_attributes,
171                                  uint32_t oplock_request,
172                                  struct smb2_lease *lease,
173                                  uint64_t allocation_size,
174                                  uint32_t private_flags,
175                                  struct security_descriptor *sd,
176                                  struct ea_list *ea_list,
177                                  files_struct **result, int *pinfo)
178 {
179         return NT_STATUS_NOT_IMPLEMENTED;
180 }
181
182 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
183 {
184         errno = ENOSYS;
185         return -1;
186 }
187
188 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
189                              void *data, size_t n)
190 {
191         errno = ENOSYS;
192         return -1;
193 }
194
195 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
196                           void *data, size_t n, off_t offset)
197 {
198         errno = ENOSYS;
199         return -1;
200 }
201
202 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
203                                           TALLOC_CTX *mem_ctx,
204                                           struct tevent_context *ev,
205                                           struct files_struct *fsp,
206                                           void *data, size_t n, off_t offset)
207 {
208         return NULL;
209 }
210
211 static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
212 {
213         *err = ENOSYS;
214         return -1;
215 }
216
217 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
218                           const void *data, size_t n)
219 {
220         errno = ENOSYS;
221         return -1;
222 }
223
224 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
225                            const void *data, size_t n, off_t offset)
226 {
227         errno = ENOSYS;
228         return -1;
229 }
230
231 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
232                                            TALLOC_CTX *mem_ctx,
233                                            struct tevent_context *ev,
234                                            struct files_struct *fsp,
235                                            const void *data,
236                                            size_t n, off_t offset)
237 {
238         return NULL;
239 }
240
241 static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
242 {
243         *err = ENOSYS;
244         return -1;
245 }
246
247 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp,
248                         off_t offset, int whence)
249 {
250         errno = ENOSYS;
251         return (off_t) - 1;
252 }
253
254 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd,
255                              files_struct *fromfsp, const DATA_BLOB *hdr,
256                              off_t offset, size_t n)
257 {
258         errno = ENOSYS;
259         return -1;
260 }
261
262 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
263                              files_struct *tofsp, off_t offset, size_t n)
264 {
265         errno = ENOSYS;
266         return -1;
267 }
268
269 static int skel_rename(vfs_handle_struct *handle,
270                        const struct smb_filename *smb_fname_src,
271                        const struct smb_filename *smb_fname_dst)
272 {
273         errno = ENOSYS;
274         return -1;
275 }
276
277 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
278 {
279         errno = ENOSYS;
280         return -1;
281 }
282
283 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
284                                           TALLOC_CTX *mem_ctx,
285                                           struct tevent_context *ev,
286                                           struct files_struct *fsp)
287 {
288         return NULL;
289 }
290
291 static int skel_fsync_recv(struct tevent_req *req, int *err)
292 {
293         *err = ENOSYS;
294         return -1;
295 }
296
297 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
298 {
299         errno = ENOSYS;
300         return -1;
301 }
302
303 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp,
304                       SMB_STRUCT_STAT *sbuf)
305 {
306         errno = ENOSYS;
307         return -1;
308 }
309
310 static int skel_lstat(vfs_handle_struct *handle,
311                       struct smb_filename *smb_fname)
312 {
313         errno = ENOSYS;
314         return -1;
315 }
316
317 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
318                                     struct files_struct *fsp,
319                                     const SMB_STRUCT_STAT *sbuf)
320 {
321         errno = ENOSYS;
322         return -1;
323 }
324
325 static int skel_unlink(vfs_handle_struct *handle,
326                        const struct smb_filename *smb_fname)
327 {
328         errno = ENOSYS;
329         return -1;
330 }
331
332 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
333 {
334         errno = ENOSYS;
335         return -1;
336 }
337
338 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
339                        mode_t mode)
340 {
341         errno = ENOSYS;
342         return -1;
343 }
344
345 static int skel_chown(vfs_handle_struct *handle, const char *path,
346                       uid_t uid, gid_t gid)
347 {
348         errno = ENOSYS;
349         return -1;
350 }
351
352 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
353                        uid_t uid, gid_t gid)
354 {
355         errno = ENOSYS;
356         return -1;
357 }
358
359 static int skel_lchown(vfs_handle_struct *handle, const char *path,
360                        uid_t uid, gid_t gid)
361 {
362         errno = ENOSYS;
363         return -1;
364 }
365
366 static int skel_chdir(vfs_handle_struct *handle, const char *path)
367 {
368         errno = ENOSYS;
369         return -1;
370 }
371
372 static char *skel_getwd(vfs_handle_struct *handle)
373 {
374         errno = ENOSYS;
375         return NULL;
376 }
377
378 static int skel_ntimes(vfs_handle_struct *handle,
379                        const struct smb_filename *smb_fname,
380                        struct smb_file_time *ft)
381 {
382         errno = ENOSYS;
383         return -1;
384 }
385
386 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
387                           off_t offset)
388 {
389         errno = ENOSYS;
390         return -1;
391 }
392
393 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
394                           enum vfs_fallocate_mode mode, off_t offset, off_t len)
395 {
396         errno = ENOSYS;
397         return -1;
398 }
399
400 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
401                       off_t offset, off_t count, int type)
402 {
403         errno = ENOSYS;
404         return false;
405 }
406
407 static int skel_kernel_flock(struct vfs_handle_struct *handle,
408                              struct files_struct *fsp,
409                              uint32 share_mode, uint32 access_mask)
410 {
411         errno = ENOSYS;
412         return -1;
413 }
414
415 static int skel_linux_setlease(struct vfs_handle_struct *handle,
416                                struct files_struct *fsp, int leasetype)
417 {
418         errno = ENOSYS;
419         return -1;
420 }
421
422 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
423                          off_t *poffset, off_t *pcount, int *ptype,
424                          pid_t *ppid)
425 {
426         errno = ENOSYS;
427         return false;
428 }
429
430 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath,
431                         const char *newpath)
432 {
433         errno = ENOSYS;
434         return -1;
435 }
436
437 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path,
438                              char *buf, size_t bufsiz)
439 {
440         errno = ENOSYS;
441         return -1;
442 }
443
444 static int skel_link(vfs_handle_struct *handle, const char *oldpath,
445                      const char *newpath)
446 {
447         errno = ENOSYS;
448         return -1;
449 }
450
451 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode,
452                       SMB_DEV_T dev)
453 {
454         errno = ENOSYS;
455         return -1;
456 }
457
458 static char *skel_realpath(vfs_handle_struct *handle, const char *path)
459 {
460         errno = ENOSYS;
461         return NULL;
462 }
463
464 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
465                                   struct sys_notify_context *ctx,
466                                   const char *path,
467                                   uint32_t *filter,
468                                   uint32_t *subdir_filter,
469                                   void (*callback) (struct sys_notify_context *
470                                                     ctx, void *private_data,
471                                                     struct notify_event *ev),
472                                   void *private_data, void *handle_p)
473 {
474         return NT_STATUS_NOT_IMPLEMENTED;
475 }
476
477 static int skel_chflags(vfs_handle_struct *handle, const char *path,
478                         uint flags)
479 {
480         errno = ENOSYS;
481         return -1;
482 }
483
484 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
485                                           const SMB_STRUCT_STAT *sbuf)
486 {
487         struct file_id id;
488         ZERO_STRUCT(id);
489         errno = ENOSYS;
490         return id;
491 }
492
493 struct skel_cc_state {
494         uint64_t unused;
495 };
496 static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle,
497                                                TALLOC_CTX *mem_ctx,
498                                                struct tevent_context *ev,
499                                                struct files_struct *src_fsp,
500                                                off_t src_off,
501                                                struct files_struct *dest_fsp,
502                                                off_t dest_off,
503                                                off_t num)
504 {
505         struct tevent_req *req;
506         struct skel_cc_state *cc_state;
507
508         req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state);
509         if (req == NULL) {
510                 return NULL;
511         }
512
513         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
514         return tevent_req_post(req, ev);
515 }
516
517 static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle,
518                                      struct tevent_req *req,
519                                      off_t *copied)
520 {
521         NTSTATUS status;
522
523         if (tevent_req_is_nterror(req, &status)) {
524                 tevent_req_received(req);
525                 return status;
526         }
527         tevent_req_received(req);
528
529         return NT_STATUS_OK;
530 }
531
532 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
533                                      TALLOC_CTX *mem_ctx,
534                                      struct files_struct *fsp,
535                                      struct smb_filename *smb_fname,
536                                      uint16_t *_compression_fmt)
537 {
538         return NT_STATUS_INVALID_DEVICE_REQUEST;
539 }
540
541 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
542                                      TALLOC_CTX *mem_ctx,
543                                      struct files_struct *fsp,
544                                      uint16_t compression_fmt)
545 {
546         return NT_STATUS_INVALID_DEVICE_REQUEST;
547 }
548
549 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
550                                 struct files_struct *fsp,
551                                 const char *fname,
552                                 TALLOC_CTX *mem_ctx,
553                                 unsigned int *num_streams,
554                                 struct stream_struct **streams)
555 {
556         return NT_STATUS_NOT_IMPLEMENTED;
557 }
558
559 static int skel_get_real_filename(struct vfs_handle_struct *handle,
560                                   const char *path,
561                                   const char *name,
562                                   TALLOC_CTX *mem_ctx, char **found_name)
563 {
564         errno = ENOSYS;
565         return -1;
566 }
567
568 static const char *skel_connectpath(struct vfs_handle_struct *handle,
569                                     const char *filename)
570 {
571         errno = ENOSYS;
572         return NULL;
573 }
574
575 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
576                                       struct byte_range_lock *br_lck,
577                                       struct lock_struct *plock,
578                                       bool blocking_lock)
579 {
580         return NT_STATUS_NOT_IMPLEMENTED;
581 }
582
583 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
584                                     struct messaging_context *msg_ctx,
585                                     struct byte_range_lock *br_lck,
586                                     const struct lock_struct *plock)
587 {
588         errno = ENOSYS;
589         return false;
590 }
591
592 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
593                                     struct byte_range_lock *br_lck,
594                                     struct lock_struct *plock)
595 {
596         errno = ENOSYS;
597         return false;
598 }
599
600 static bool skel_strict_lock(struct vfs_handle_struct *handle,
601                              struct files_struct *fsp,
602                              struct lock_struct *plock)
603 {
604         errno = ENOSYS;
605         return false;
606 }
607
608 static void skel_strict_unlock(struct vfs_handle_struct *handle,
609                                struct files_struct *fsp,
610                                struct lock_struct *plock)
611 {
612         ;
613 }
614
615 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
616                                     const char *mapped_name,
617                                     enum vfs_translate_direction direction,
618                                     TALLOC_CTX *mem_ctx, char **pmapped_name)
619 {
620         return NT_STATUS_NOT_IMPLEMENTED;
621 }
622
623 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
624                            struct files_struct *fsp,
625                            TALLOC_CTX *ctx,
626                            uint32_t function,
627                            uint16_t req_flags,  /* Needed for UNICODE ... */
628                            const uint8_t *_in_data,
629                            uint32_t in_len,
630                            uint8_t **_out_data,
631                            uint32_t max_out_len, uint32_t *out_len)
632 {
633         return NT_STATUS_NOT_IMPLEMENTED;
634 }
635
636 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
637                                  uint32 security_info,
638                                  TALLOC_CTX *mem_ctx,
639                                  struct security_descriptor **ppdesc)
640 {
641         return NT_STATUS_NOT_IMPLEMENTED;
642 }
643
644 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
645                                 const char *name, uint32 security_info,
646                                 TALLOC_CTX *mem_ctx,
647                                 struct security_descriptor **ppdesc)
648 {
649         return NT_STATUS_NOT_IMPLEMENTED;
650 }
651
652 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
653                                  uint32 security_info_sent,
654                                  const struct security_descriptor *psd)
655 {
656         return NT_STATUS_NOT_IMPLEMENTED;
657 }
658
659 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name,
660                           mode_t mode)
661 {
662         errno = ENOSYS;
663         return -1;
664 }
665
666 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
667                            mode_t mode)
668 {
669         errno = ENOSYS;
670         return -1;
671 }
672
673 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
674                                        const char *path_p,
675                                        SMB_ACL_TYPE_T type,
676                                        TALLOC_CTX *mem_ctx)
677 {
678         errno = ENOSYS;
679         return (SMB_ACL_T) NULL;
680 }
681
682 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
683                                      files_struct *fsp, TALLOC_CTX *mem_ctx)
684 {
685         errno = ENOSYS;
686         return (SMB_ACL_T) NULL;
687 }
688
689 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
690                                       const char *path_p, TALLOC_CTX *mem_ctx,
691                                       char **blob_description, DATA_BLOB *blob)
692 {
693         errno = ENOSYS;
694         return -1;
695 }
696
697 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
698                                     files_struct *fsp, TALLOC_CTX *mem_ctx,
699                                     char **blob_description, DATA_BLOB *blob)
700 {
701         errno = ENOSYS;
702         return -1;
703 }
704
705 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
706                                  SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
707 {
708         errno = ENOSYS;
709         return -1;
710 }
711
712 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
713                                SMB_ACL_T theacl)
714 {
715         errno = ENOSYS;
716         return -1;
717 }
718
719 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
720                                         const char *path)
721 {
722         errno = ENOSYS;
723         return -1;
724 }
725
726 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path,
727                              const char *name, void *value, size_t size)
728 {
729         errno = ENOSYS;
730         return -1;
731 }
732
733 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
734                               struct files_struct *fsp, const char *name,
735                               void *value, size_t size)
736 {
737         errno = ENOSYS;
738         return -1;
739 }
740
741 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path,
742                               char *list, size_t size)
743 {
744         errno = ENOSYS;
745         return -1;
746 }
747
748 static ssize_t skel_flistxattr(vfs_handle_struct *handle,
749                                struct files_struct *fsp, char *list,
750                                size_t size)
751 {
752         errno = ENOSYS;
753         return -1;
754 }
755
756 static int skel_removexattr(vfs_handle_struct *handle, const char *path,
757                             const char *name)
758 {
759         errno = ENOSYS;
760         return -1;
761 }
762
763 static int skel_fremovexattr(vfs_handle_struct *handle,
764                              struct files_struct *fsp, const char *name)
765 {
766         errno = ENOSYS;
767         return -1;
768         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
769 }
770
771 static int skel_setxattr(vfs_handle_struct *handle, const char *path,
772                          const char *name, const void *value, size_t size,
773                          int flags)
774 {
775         errno = ENOSYS;
776         return -1;
777 }
778
779 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
780                           const char *name, const void *value, size_t size,
781                           int flags)
782 {
783         errno = ENOSYS;
784         return -1;
785 }
786
787 static bool skel_aio_force(struct vfs_handle_struct *handle,
788                            struct files_struct *fsp)
789 {
790         errno = ENOSYS;
791         return false;
792 }
793
794 static bool skel_is_offline(struct vfs_handle_struct *handle,
795                             const struct smb_filename *fname,
796                             SMB_STRUCT_STAT *sbuf)
797 {
798         errno = ENOSYS;
799         return false;
800 }
801
802 static int skel_set_offline(struct vfs_handle_struct *handle,
803                             const struct smb_filename *fname)
804 {
805         errno = ENOSYS;
806         return -1;
807 }
808
809 /* VFS operations structure */
810
811 struct vfs_fn_pointers skel_opaque_fns = {
812         /* Disk operations */
813
814         .connect_fn = skel_connect,
815         .disconnect_fn = skel_disconnect,
816         .disk_free_fn = skel_disk_free,
817         .get_quota_fn = skel_get_quota,
818         .set_quota_fn = skel_set_quota,
819         .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
820         .statvfs_fn = skel_statvfs,
821         .fs_capabilities_fn = skel_fs_capabilities,
822         .get_dfs_referrals_fn = skel_get_dfs_referrals,
823
824         /* Directory operations */
825
826         .opendir_fn = skel_opendir,
827         .fdopendir_fn = skel_fdopendir,
828         .readdir_fn = skel_readdir,
829         .seekdir_fn = skel_seekdir,
830         .telldir_fn = skel_telldir,
831         .rewind_dir_fn = skel_rewind_dir,
832         .mkdir_fn = skel_mkdir,
833         .rmdir_fn = skel_rmdir,
834         .closedir_fn = skel_closedir,
835         .init_search_op_fn = skel_init_search_op,
836
837         /* File operations */
838
839         .open_fn = skel_open,
840         .create_file_fn = skel_create_file,
841         .close_fn = skel_close_fn,
842         .read_fn = skel_vfs_read,
843         .pread_fn = skel_pread,
844         .pread_send_fn = skel_pread_send,
845         .pread_recv_fn = skel_pread_recv,
846         .write_fn = skel_write,
847         .pwrite_fn = skel_pwrite,
848         .pwrite_send_fn = skel_pwrite_send,
849         .pwrite_recv_fn = skel_pwrite_recv,
850         .lseek_fn = skel_lseek,
851         .sendfile_fn = skel_sendfile,
852         .recvfile_fn = skel_recvfile,
853         .rename_fn = skel_rename,
854         .fsync_fn = skel_fsync,
855         .fsync_send_fn = skel_fsync_send,
856         .fsync_recv_fn = skel_fsync_recv,
857         .stat_fn = skel_stat,
858         .fstat_fn = skel_fstat,
859         .lstat_fn = skel_lstat,
860         .get_alloc_size_fn = skel_get_alloc_size,
861         .unlink_fn = skel_unlink,
862         .chmod_fn = skel_chmod,
863         .fchmod_fn = skel_fchmod,
864         .chown_fn = skel_chown,
865         .fchown_fn = skel_fchown,
866         .lchown_fn = skel_lchown,
867         .chdir_fn = skel_chdir,
868         .getwd_fn = skel_getwd,
869         .ntimes_fn = skel_ntimes,
870         .ftruncate_fn = skel_ftruncate,
871         .fallocate_fn = skel_fallocate,
872         .lock_fn = skel_lock,
873         .kernel_flock_fn = skel_kernel_flock,
874         .linux_setlease_fn = skel_linux_setlease,
875         .getlock_fn = skel_getlock,
876         .symlink_fn = skel_symlink,
877         .readlink_fn = skel_vfs_readlink,
878         .link_fn = skel_link,
879         .mknod_fn = skel_mknod,
880         .realpath_fn = skel_realpath,
881         .notify_watch_fn = skel_notify_watch,
882         .chflags_fn = skel_chflags,
883         .file_id_create_fn = skel_file_id_create,
884         .copy_chunk_send_fn = skel_copy_chunk_send,
885         .copy_chunk_recv_fn = skel_copy_chunk_recv,
886         .get_compression_fn = skel_get_compression,
887         .set_compression_fn = skel_set_compression,
888
889         .streaminfo_fn = skel_streaminfo,
890         .get_real_filename_fn = skel_get_real_filename,
891         .connectpath_fn = skel_connectpath,
892         .brl_lock_windows_fn = skel_brl_lock_windows,
893         .brl_unlock_windows_fn = skel_brl_unlock_windows,
894         .brl_cancel_windows_fn = skel_brl_cancel_windows,
895         .strict_lock_fn = skel_strict_lock,
896         .strict_unlock_fn = skel_strict_unlock,
897         .translate_name_fn = skel_translate_name,
898         .fsctl_fn = skel_fsctl,
899
900         /* NT ACL operations. */
901
902         .fget_nt_acl_fn = skel_fget_nt_acl,
903         .get_nt_acl_fn = skel_get_nt_acl,
904         .fset_nt_acl_fn = skel_fset_nt_acl,
905
906         /* POSIX ACL operations. */
907
908         .chmod_acl_fn = skel_chmod_acl,
909         .fchmod_acl_fn = skel_fchmod_acl,
910
911         .sys_acl_get_file_fn = skel_sys_acl_get_file,
912         .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
913         .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
914         .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
915         .sys_acl_set_file_fn = skel_sys_acl_set_file,
916         .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
917         .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
918
919         /* EA operations. */
920         .getxattr_fn = skel_getxattr,
921         .fgetxattr_fn = skel_fgetxattr,
922         .listxattr_fn = skel_listxattr,
923         .flistxattr_fn = skel_flistxattr,
924         .removexattr_fn = skel_removexattr,
925         .fremovexattr_fn = skel_fremovexattr,
926         .setxattr_fn = skel_setxattr,
927         .fsetxattr_fn = skel_fsetxattr,
928
929         /* aio operations */
930         .aio_force_fn = skel_aio_force,
931
932         /* offline operations */
933         .is_offline_fn = skel_is_offline,
934         .set_offline_fn = skel_set_offline
935 };
936
937 NTSTATUS vfs_skel_opaque_init(void)
938 {
939         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
940                                 &skel_opaque_fns);
941 }