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