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