examples/VFS: add skel_get_dfs_referrals()
[sfrench/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
25 #include "includes.h"
26 #include "smbd/proto.h"
27
28 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
29    SAMBA DEVELOPERS GUIDE!!!!!!
30  */
31
32 /* If you take this file as template for your module
33  * you must re-implement every function.
34  */
35
36 static int skel_connect(vfs_handle_struct *handle,  const char *service, const char *user)    
37 {
38         errno = ENOSYS;
39         return -1;
40 }
41
42 static void skel_disconnect(vfs_handle_struct *handle)
43 {
44         ;
45 }
46
47 static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
48         bool small_query, uint64_t *bsize,
49         uint64_t *dfree, uint64_t *dsize)
50 {
51         *bsize = 0;
52         *dfree = 0;
53         *dsize = 0;
54         return 0;
55 }
56
57 static int skel_get_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
58 {
59         errno = ENOSYS;
60         return -1;
61 }
62
63 static int skel_set_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
64 {
65         errno = ENOSYS;
66         return -1;
67 }
68
69 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels)
70 {
71         errno = ENOSYS;
72         return -1;
73 }
74
75 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf)
76 {
77         errno = ENOSYS;
78         return -1;
79 }
80
81 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
82 {
83         return 0;
84 }
85
86 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
87                                        struct dfs_GetDFSReferral *r)
88 {
89         return NT_STATUS_NOT_IMPLEMENTED;
90 }
91
92 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle,  const char *fname, const char *mask, uint32 attr)
93 {
94         return NULL;
95 }
96
97 static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
98 {
99         return NULL;
100 }
101
102 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
103                                        SMB_STRUCT_DIR *dirp,
104                                        SMB_STRUCT_STAT *sbuf)
105 {
106         return NULL;
107 }
108
109 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
110 {
111         ;
112 }
113
114 static long skel_telldir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
115 {
116         return (long)-1;
117 }
118
119 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
120 {
121         ;
122 }
123
124 static int skel_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mode)
125 {
126         errno = ENOSYS;
127         return -1;
128 }
129
130 static int skel_rmdir(vfs_handle_struct *handle,  const char *path)
131 {
132         errno = ENOSYS;
133         return -1;
134 }
135
136 static int skel_closedir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dir)
137 {
138         errno = ENOSYS;
139         return -1;
140 }
141
142 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
143 {
144         ;
145 }
146
147 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
148                      files_struct *fsp, int flags, mode_t mode)
149 {
150         errno = ENOSYS;
151         return -1;
152 }
153
154 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
155                                 struct smb_request *req,
156                                 uint16_t root_dir_fid,
157                                 struct smb_filename *smb_fname,
158                                 uint32_t access_mask,
159                                 uint32_t share_access,
160                                 uint32_t create_disposition,
161                                 uint32_t create_options,
162                                 uint32_t file_attributes,
163                                 uint32_t oplock_request,
164                                 uint64_t allocation_size,
165                                 uint32_t private_flags,
166                                 struct security_descriptor *sd,
167                                 struct ea_list *ea_list,
168                                 files_struct **result,
169                                 int *pinfo)
170 {
171         return NT_STATUS_NOT_IMPLEMENTED;
172 }
173
174 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
175 {
176         errno = ENOSYS;
177         return -1;
178 }
179
180 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
181 {
182         errno = ENOSYS;
183         return -1;
184 }
185
186 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
187 {
188         errno = ENOSYS;
189         return -1;
190 }
191
192 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
193 {
194         errno = ENOSYS;
195         return -1;
196 }
197
198 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
199 {
200         errno = ENOSYS;
201         return -1;
202 }
203
204 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
205 {
206         errno = ENOSYS;
207         return (SMB_OFF_T)-1;
208 }
209
210 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
211 {
212         errno = ENOSYS;
213         return -1;
214 }
215
216 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
217 {
218         errno = ENOSYS;
219         return -1;
220 }
221
222 static int skel_rename(vfs_handle_struct *handle,
223                        const struct smb_filename *smb_fname_src,
224                        const struct smb_filename *smb_fname_dst)
225 {
226         errno = ENOSYS;
227         return -1;
228 }
229
230 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
231 {
232         errno = ENOSYS;
233         return -1;
234 }
235
236 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
237 {
238         errno = ENOSYS;
239         return -1;
240 }
241
242 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
243 {
244         errno = ENOSYS;
245         return -1;
246 }
247
248 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
249 {
250         errno = ENOSYS;
251         return -1;
252 }
253
254 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
255 {
256         errno = ENOSYS;
257         return -1;
258 }
259
260 static int skel_unlink(vfs_handle_struct *handle,
261                        const struct smb_filename *smb_fname)
262 {
263         errno = ENOSYS;
264         return -1;
265 }
266
267 static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
268 {
269         errno = ENOSYS;
270         return -1;
271 }
272
273 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
274 {
275         errno = ENOSYS;
276         return -1;
277 }
278
279 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
280 {
281         errno = ENOSYS;
282         return -1;
283 }
284
285 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
286 {
287         errno = ENOSYS;
288         return -1;
289 }
290
291 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
292 {
293         errno = ENOSYS;
294         return -1;
295 }
296
297 static int skel_chdir(vfs_handle_struct *handle,  const char *path)
298 {
299         errno = ENOSYS;
300         return -1;
301 }
302
303 static char *skel_getwd(vfs_handle_struct *handle)
304 {
305         errno = ENOSYS;
306         return NULL;
307 }
308
309 static int skel_ntimes(vfs_handle_struct *handle,
310                        const struct smb_filename *smb_fname,
311                        struct smb_file_time *ft)
312 {
313         errno = ENOSYS;
314         return -1;
315 }
316
317 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
318 {
319         errno = ENOSYS;
320         return -1;
321 }
322
323 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
324                         enum vfs_fallocate_mode mode,
325                         SMB_OFF_T offset, SMB_OFF_T len)
326 {
327         errno = ENOSYS;
328         return -1;
329 }
330
331 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
332 {
333         errno = ENOSYS;
334         return false;
335 }
336
337 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask)
338 {
339         errno = ENOSYS;
340         return -1;
341 }
342
343 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
344 {
345         errno = ENOSYS;
346         return -1;
347 }
348
349 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
350 {
351         errno = ENOSYS;
352         return false;
353 }
354
355 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
356 {
357         errno = ENOSYS;
358         return -1;
359 }
360
361 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
362 {
363         errno = ENOSYS;
364         return -1;
365 }
366
367 static int skel_link(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
368 {
369         errno = ENOSYS;
370         return -1;
371 }
372
373 static int skel_mknod(vfs_handle_struct *handle,  const char *path, mode_t mode, SMB_DEV_T dev)
374 {
375         errno = ENOSYS;
376         return -1;
377 }
378
379 static char *skel_realpath(vfs_handle_struct *handle,  const char *path)
380 {
381         errno = ENOSYS;
382         return NULL;
383 }
384
385 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
386             struct sys_notify_context *ctx, struct notify_entry *e,
387             void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
388             void *private_data, void *handle_p)
389 {
390         return NT_STATUS_NOT_IMPLEMENTED;
391 }
392
393 static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags)
394 {
395         errno = ENOSYS;
396         return -1;
397 }
398
399 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
400                                           const SMB_STRUCT_STAT *sbuf)
401 {
402         struct file_id id;
403         ZERO_STRUCT(id);
404         errno = ENOSYS;
405         return id;
406 }
407
408 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
409                                 struct files_struct *fsp,
410                                 const char *fname,
411                                 TALLOC_CTX *mem_ctx,
412                                 unsigned int *num_streams,
413                                 struct stream_struct **streams)
414 {
415         return NT_STATUS_NOT_IMPLEMENTED;
416 }
417
418 static int skel_get_real_filename(struct vfs_handle_struct *handle,
419                                 const char *path,
420                                 const char *name,
421                                 TALLOC_CTX *mem_ctx,
422                                 char **found_name)
423 {
424         errno = ENOSYS;
425         return -1;
426 }
427
428 static const char *skel_connectpath(struct vfs_handle_struct *handle,
429                                 const char *filename)
430 {
431         errno = ENOSYS;
432         return NULL;
433 }
434
435 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
436                                 struct byte_range_lock *br_lck,
437                                 struct lock_struct *plock,
438                                 bool blocking_lock,
439                                 struct blocking_lock_record *blr)
440 {
441         return NT_STATUS_NOT_IMPLEMENTED;
442 }
443
444 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
445                                 struct messaging_context *msg_ctx,
446                                 struct byte_range_lock *br_lck,
447                                 const struct lock_struct *plock)
448 {
449         errno = ENOSYS;
450         return false;
451 }
452
453 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
454                                 struct byte_range_lock *br_lck,
455                                 struct lock_struct *plock,
456                                 struct blocking_lock_record *blr)
457 {
458         errno = ENOSYS;
459         return false;
460 }
461
462 static bool skel_strict_lock(struct vfs_handle_struct *handle,
463                                 struct files_struct *fsp,
464                                 struct lock_struct *plock)
465 {
466         errno = ENOSYS;
467         return false;
468 }
469
470 static void skel_strict_unlock(struct vfs_handle_struct *handle,
471                                 struct files_struct *fsp,
472                                 struct lock_struct *plock)
473 {
474         ;
475 }
476
477 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
478                                 const char *mapped_name,
479                                 enum vfs_translate_direction direction,
480                                 TALLOC_CTX *mem_ctx,
481                                 char **pmapped_name)
482 {
483         return NT_STATUS_NOT_IMPLEMENTED;
484 }
485
486 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
487         uint32 security_info, struct security_descriptor **ppdesc)
488 {
489         return NT_STATUS_NOT_IMPLEMENTED;
490 }
491
492 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
493         const char *name, uint32 security_info, struct security_descriptor **ppdesc)
494 {
495         return NT_STATUS_NOT_IMPLEMENTED;
496 }
497
498 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
499         uint32 security_info_sent, const struct security_descriptor *psd)
500 {
501         return NT_STATUS_NOT_IMPLEMENTED;
502 }
503
504 static int skel_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t mode)
505 {
506         errno = ENOSYS;
507         return -1;
508 }
509
510 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
511 {
512         errno = ENOSYS;
513         return -1;
514 }
515
516 static int skel_sys_acl_get_entry(vfs_handle_struct *handle,  SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
517 {
518         errno = ENOSYS;
519         return -1;
520 }
521
522 static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
523 {
524         errno = ENOSYS;
525         return -1;
526 }
527
528 static int skel_sys_acl_get_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
529 {
530         errno = ENOSYS;
531         return -1;
532 }
533
534 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d)
535 {
536         errno = ENOSYS;
537         return NULL;
538 }
539
540 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,  const char *path_p, SMB_ACL_TYPE_T type)
541 {
542         errno = ENOSYS;
543         return (SMB_ACL_T)NULL;
544 }
545
546 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
547 {
548         errno = ENOSYS;
549         return (SMB_ACL_T)NULL;
550 }
551
552 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset)
553 {
554         errno = ENOSYS;
555         return -1;
556 }
557
558 static int skel_sys_acl_add_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
559 {
560         errno = ENOSYS;
561         return -1;
562 }
563
564 static char *skel_sys_acl_to_text(vfs_handle_struct *handle,  SMB_ACL_T theacl, ssize_t *plen)
565 {
566         errno = ENOSYS;
567         return NULL;
568 }
569
570 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle,  int count)
571 {
572         errno = ENOSYS;
573         return (SMB_ACL_T)NULL;
574 }
575
576 static int skel_sys_acl_create_entry(vfs_handle_struct *handle,  SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
577 {
578         errno = ENOSYS;
579         return -1;
580 }
581
582 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
583 {
584         errno = ENOSYS;
585         return -1;
586 }
587
588 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, void *qual)
589 {
590         errno = ENOSYS;
591         return -1;
592 }
593
594 static int skel_sys_acl_set_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
595 {
596         errno = ENOSYS;
597         return -1;
598 }
599
600 static int skel_sys_acl_valid(vfs_handle_struct *handle,  SMB_ACL_T theacl )
601 {
602         errno = ENOSYS;
603         return -1;
604 }
605
606 static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
607 {
608         errno = ENOSYS;
609         return -1;
610 }
611
612 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
613 {
614         errno = ENOSYS;
615         return -1;
616 }
617
618 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,  const char *path)
619 {
620         errno = ENOSYS;
621         return -1;
622 }
623
624 static int skel_sys_acl_get_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
625 {
626         errno = ENOSYS;
627         return -1;
628 }
629
630 static int skel_sys_acl_free_text(vfs_handle_struct *handle,  char *text)
631 {
632         errno = ENOSYS;
633         return -1;
634 }
635
636 static int skel_sys_acl_free_acl(vfs_handle_struct *handle,  SMB_ACL_T posix_acl)
637 {
638         errno = ENOSYS;
639         return -1;
640 }
641
642 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle,  void *qualifier, SMB_ACL_TAG_T tagtype)
643 {
644         errno = ENOSYS;
645         return -1;
646 }
647
648 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
649 {
650         errno = ENOSYS;
651         return -1;
652 }
653
654 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t
655 size)
656 {
657         errno = ENOSYS;
658         return -1;
659 }
660
661 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
662 {
663         errno = ENOSYS;
664         return -1;
665 }
666
667 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
668 {
669         errno = ENOSYS;
670         return -1;
671 }
672
673 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
674 {
675         errno = ENOSYS;
676         return -1;
677 }
678
679 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
680 {
681         errno = ENOSYS;
682         return -1;
683 }
684
685 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
686 {
687         errno = ENOSYS;
688         return -1;
689 }
690
691 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
692 {
693         errno = ENOSYS;
694         return -1;
695 }
696
697 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
698 {
699         errno = ENOSYS;
700         return -1;
701         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
702 }
703
704 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
705 {
706         errno = ENOSYS;
707         return -1;
708 }
709
710 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
711 {
712         errno = ENOSYS;
713         return -1;
714 }
715
716 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
717 {
718         errno = ENOSYS;
719         return -1;
720 }
721
722 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
723 {
724         errno = ENOSYS;
725         return -1;
726 }
727
728 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
729 {
730         errno = ENOSYS;
731         return -1;
732 }
733
734 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
735 {
736         errno = ENOSYS;
737         return -1;
738 }
739
740 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
741 {
742         errno = ENOSYS;
743         return -1;
744 }
745
746 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
747 {
748         errno = ENOSYS;
749         return -1;
750 }
751
752 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
753 {
754         errno = ENOSYS;
755         return -1;
756 }
757
758 static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
759 {
760         errno = ENOSYS;
761         return -1;
762 }
763
764 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
765 {
766         errno = ENOSYS;
767         return false;
768 }
769
770 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
771 {
772         errno = ENOSYS;
773         return false;
774 }
775
776 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
777 {
778         errno = ENOSYS;
779         return -1;
780 }
781
782 /* VFS operations structure */
783
784 struct vfs_fn_pointers skel_opaque_fns = {
785         /* Disk operations */
786
787         .connect_fn = skel_connect,
788         .disconnect = skel_disconnect,
789         .disk_free = skel_disk_free,
790         .get_quota = skel_get_quota,
791         .set_quota = skel_set_quota,
792         .get_shadow_copy_data = skel_get_shadow_copy_data,
793         .statvfs = skel_statvfs,
794         .fs_capabilities = skel_fs_capabilities,
795         .get_dfs_referrals = skel_get_dfs_referrals,
796
797         /* Directory operations */
798
799         .opendir = skel_opendir,
800         .fdopendir = skel_fdopendir,
801         .readdir = skel_readdir,
802         .seekdir = skel_seekdir,
803         .telldir = skel_telldir,
804         .rewind_dir = skel_rewind_dir,
805         .mkdir = skel_mkdir,
806         .rmdir = skel_rmdir,
807         .closedir = skel_closedir,
808         .init_search_op = skel_init_search_op,
809
810         /* File operations */
811
812         .open_fn = skel_open,
813         .create_file = skel_create_file,
814         .close_fn = skel_close_fn,
815         .vfs_read = skel_vfs_read,
816         .pread = skel_pread,
817         .write = skel_write,
818         .pwrite = skel_pwrite,
819         .lseek = skel_lseek,
820         .sendfile = skel_sendfile,
821         .recvfile = skel_recvfile,
822         .rename = skel_rename,
823         .fsync = skel_fsync,
824         .stat = skel_stat,
825         .fstat = skel_fstat,
826         .lstat = skel_lstat,
827         .get_alloc_size = skel_get_alloc_size,
828         .unlink = skel_unlink,
829         .chmod = skel_chmod,
830         .fchmod = skel_fchmod,
831         .chown = skel_chown,
832         .fchown = skel_fchown,
833         .lchown = skel_lchown,
834         .chdir = skel_chdir,
835         .getwd = skel_getwd,
836         .ntimes = skel_ntimes,
837         .ftruncate = skel_ftruncate,
838         .fallocate = skel_fallocate,
839         .lock = skel_lock,
840         .kernel_flock = skel_kernel_flock,
841         .linux_setlease = skel_linux_setlease,
842         .getlock = skel_getlock,
843         .symlink = skel_symlink,
844         .vfs_readlink = skel_vfs_readlink,
845         .link = skel_link,
846         .mknod = skel_mknod,
847         .realpath = skel_realpath,
848         .notify_watch = skel_notify_watch,
849         .chflags = skel_chflags,
850         .file_id_create = skel_file_id_create,
851
852         .streaminfo = skel_streaminfo,
853         .get_real_filename = skel_get_real_filename,
854         .connectpath = skel_connectpath,
855         .brl_lock_windows = skel_brl_lock_windows,
856         .brl_unlock_windows = skel_brl_unlock_windows,
857         .brl_cancel_windows = skel_brl_cancel_windows,
858         .strict_lock = skel_strict_lock,
859         .strict_unlock = skel_strict_unlock,
860         .translate_name = skel_translate_name,
861
862         /* NT ACL operations. */
863
864         .fget_nt_acl = skel_fget_nt_acl,
865         .get_nt_acl = skel_get_nt_acl,
866         .fset_nt_acl = skel_fset_nt_acl,
867
868         /* POSIX ACL operations. */
869
870         .chmod_acl = skel_chmod_acl,
871         .fchmod_acl = skel_fchmod_acl,
872
873         .sys_acl_get_entry = skel_sys_acl_get_entry,
874         .sys_acl_get_tag_type = skel_sys_acl_get_tag_type,
875         .sys_acl_get_permset = skel_sys_acl_get_permset,
876         .sys_acl_get_qualifier = skel_sys_acl_get_qualifier,
877         .sys_acl_get_file = skel_sys_acl_get_file,
878         .sys_acl_get_fd = skel_sys_acl_get_fd,
879         .sys_acl_clear_perms = skel_sys_acl_clear_perms,
880         .sys_acl_add_perm = skel_sys_acl_add_perm,
881         .sys_acl_to_text = skel_sys_acl_to_text,
882         .sys_acl_init = skel_sys_acl_init,
883         .sys_acl_create_entry = skel_sys_acl_create_entry,
884         .sys_acl_set_tag_type = skel_sys_acl_set_tag_type,
885         .sys_acl_set_qualifier = skel_sys_acl_set_qualifier,
886         .sys_acl_set_permset = skel_sys_acl_set_permset,
887         .sys_acl_valid = skel_sys_acl_valid,
888         .sys_acl_set_file = skel_sys_acl_set_file,
889         .sys_acl_set_fd = skel_sys_acl_set_fd,
890         .sys_acl_delete_def_file = skel_sys_acl_delete_def_file,
891         .sys_acl_get_perm = skel_sys_acl_get_perm,
892         .sys_acl_free_text = skel_sys_acl_free_text,
893         .sys_acl_free_acl = skel_sys_acl_free_acl,
894         .sys_acl_free_qualifier = skel_sys_acl_free_qualifier,
895
896         /* EA operations. */
897         .getxattr = skel_getxattr,
898         .lgetxattr = skel_lgetxattr,
899         .fgetxattr = skel_fgetxattr,
900         .listxattr = skel_listxattr,
901         .llistxattr = skel_llistxattr,
902         .flistxattr = skel_flistxattr,
903         .removexattr = skel_removexattr,
904         .lremovexattr = skel_lremovexattr,
905         .fremovexattr = skel_fremovexattr,
906         .setxattr = skel_setxattr,
907         .lsetxattr = skel_lsetxattr,
908         .fsetxattr = skel_fsetxattr,
909
910         /* aio operations */
911         .aio_read = skel_aio_read,
912         .aio_write = skel_aio_write,
913         .aio_return_fn = skel_aio_return_fn,
914         .aio_cancel = skel_aio_cancel,
915         .aio_error_fn = skel_aio_error_fn,
916         .aio_fsync = skel_aio_fsync,
917         .aio_suspend = skel_aio_suspend,
918         .aio_force = skel_aio_force,
919
920         /* offline operations */
921         .is_offline = skel_is_offline,
922         .set_offline = skel_set_offline
923 };
924
925 NTSTATUS vfs_skel_opaque_init(void)
926 {
927         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque", &skel_opaque_fns);
928 }