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