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