s4: remove ipv6:enabled parameteric option
[Samba.git] / examples / VFS / skel_opaque.c
blobe6c066d2eb8e51c6cce9b2a73e40aec55a45b240
1 /*
2 * Skeleton VFS module. Implements dummy versions of all VFS
3 * functions.
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
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.
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.
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/>.
24 #include "../source3/include/includes.h"
25 #include "lib/util/tevent_ntstatus.h"
27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE
28 SAMBA DEVELOPERS GUIDE!!!!!!
31 /* If you take this file as template for your module
32 * you must re-implement every function.
35 static int skel_connect(vfs_handle_struct *handle, const char *service,
36 const char *user)
38 errno = ENOSYS;
39 return -1;
42 static void skel_disconnect(vfs_handle_struct *handle)
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)
53 *bsize = 0;
54 *dfree = 0;
55 *dsize = 0;
56 return 0;
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)
65 errno = ENOSYS;
66 return -1;
69 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
70 unid_t id, SMB_DISK_QUOTA *dq)
72 errno = ENOSYS;
73 return -1;
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)
81 errno = ENOSYS;
82 return -1;
85 static int skel_statvfs(struct vfs_handle_struct *handle,
86 const struct smb_filename *smb_fname,
87 struct vfs_statvfs_struct *statbuf)
89 errno = ENOSYS;
90 return -1;
93 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
94 enum timestamp_set_resolution *p_ts_res)
96 return 0;
99 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
100 struct dfs_GetDFSReferral *r)
102 return NT_STATUS_NOT_IMPLEMENTED;
105 static DIR *skel_opendir(vfs_handle_struct *handle,
106 const struct smb_filename *smb_fname,
107 const char *mask,
108 uint32_t attr)
110 return NULL;
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)
118 return NT_STATUS_NOT_SUPPORTED;
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)
129 return NT_STATUS_NOT_SUPPORTED;
132 static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle,
133 TALLOC_CTX *mem_ctx,
134 char *base_path,
135 char *snap_path)
137 return NT_STATUS_NOT_SUPPORTED;
140 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
141 const char *mask, uint32_t attr)
143 return NULL;
146 static struct dirent *skel_readdir(vfs_handle_struct *handle,
147 DIR *dirp, SMB_STRUCT_STAT *sbuf)
149 return NULL;
152 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
157 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
159 return (long)-1;
162 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
167 static int skel_mkdir(vfs_handle_struct *handle,
168 const struct smb_filename *smb_fname,
169 mode_t mode)
171 errno = ENOSYS;
172 return -1;
175 static int skel_rmdir(vfs_handle_struct *handle,
176 const struct smb_filename *smb_fname)
178 errno = ENOSYS;
179 return -1;
182 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
184 errno = ENOSYS;
185 return -1;
188 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
189 files_struct *fsp, int flags, mode_t mode)
191 errno = ENOSYS;
192 return -1;
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)
214 return NT_STATUS_NOT_IMPLEMENTED;
217 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
219 errno = ENOSYS;
220 return -1;
223 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
224 void *data, size_t n)
226 errno = ENOSYS;
227 return -1;
230 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
231 void *data, size_t n, off_t offset)
233 errno = ENOSYS;
234 return -1;
237 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
238 TALLOC_CTX *mem_ctx,
239 struct tevent_context *ev,
240 struct files_struct *fsp,
241 void *data, size_t n, off_t offset)
243 return NULL;
246 static ssize_t skel_pread_recv(struct tevent_req *req,
247 struct vfs_aio_state *vfs_aio_state)
249 vfs_aio_state->error = ENOSYS;
250 return -1;
253 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
254 const void *data, size_t n)
256 errno = ENOSYS;
257 return -1;
260 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
261 const void *data, size_t n, off_t offset)
263 errno = ENOSYS;
264 return -1;
267 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
268 TALLOC_CTX *mem_ctx,
269 struct tevent_context *ev,
270 struct files_struct *fsp,
271 const void *data,
272 size_t n, off_t offset)
274 return NULL;
277 static ssize_t skel_pwrite_recv(struct tevent_req *req,
278 struct vfs_aio_state *vfs_aio_state)
280 vfs_aio_state->error = ENOSYS;
281 return -1;
284 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp,
285 off_t offset, int whence)
287 errno = ENOSYS;
288 return (off_t) - 1;
291 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd,
292 files_struct *fromfsp, const DATA_BLOB *hdr,
293 off_t offset, size_t n)
295 errno = ENOSYS;
296 return -1;
299 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
300 files_struct *tofsp, off_t offset, size_t n)
302 errno = ENOSYS;
303 return -1;
306 static int skel_rename(vfs_handle_struct *handle,
307 const struct smb_filename *smb_fname_src,
308 const struct smb_filename *smb_fname_dst)
310 errno = ENOSYS;
311 return -1;
314 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
316 errno = ENOSYS;
317 return -1;
320 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
321 TALLOC_CTX *mem_ctx,
322 struct tevent_context *ev,
323 struct files_struct *fsp)
325 return NULL;
328 static int skel_fsync_recv(struct tevent_req *req,
329 struct vfs_aio_state *vfs_aio_state)
331 vfs_aio_state->error = ENOSYS;
332 return -1;
335 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
337 errno = ENOSYS;
338 return -1;
341 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp,
342 SMB_STRUCT_STAT *sbuf)
344 errno = ENOSYS;
345 return -1;
348 static int skel_lstat(vfs_handle_struct *handle,
349 struct smb_filename *smb_fname)
351 errno = ENOSYS;
352 return -1;
355 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
356 struct files_struct *fsp,
357 const SMB_STRUCT_STAT *sbuf)
359 errno = ENOSYS;
360 return -1;
363 static int skel_unlink(vfs_handle_struct *handle,
364 const struct smb_filename *smb_fname)
366 errno = ENOSYS;
367 return -1;
370 static int skel_chmod(vfs_handle_struct *handle,
371 const struct smb_filename *smb_fname,
372 mode_t mode)
374 errno = ENOSYS;
375 return -1;
378 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
379 mode_t mode)
381 errno = ENOSYS;
382 return -1;
385 static int skel_chown(vfs_handle_struct *handle,
386 const struct smb_filename *smb_fname,
387 uid_t uid,
388 gid_t gid)
390 errno = ENOSYS;
391 return -1;
394 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
395 uid_t uid, gid_t gid)
397 errno = ENOSYS;
398 return -1;
401 static int skel_lchown(vfs_handle_struct *handle,
402 const struct smb_filename *smb_fname,
403 uid_t uid,
404 gid_t gid)
406 errno = ENOSYS;
407 return -1;
410 static int skel_chdir(vfs_handle_struct *handle,
411 const struct smb_filename *smb_fname)
413 errno = ENOSYS;
414 return -1;
417 static struct smb_filename *skel_getwd(vfs_handle_struct *handle,
418 TALLOC_CTX *ctx)
420 errno = ENOSYS;
421 return NULL;
424 static int skel_ntimes(vfs_handle_struct *handle,
425 const struct smb_filename *smb_fname,
426 struct smb_file_time *ft)
428 errno = ENOSYS;
429 return -1;
432 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
433 off_t offset)
435 errno = ENOSYS;
436 return -1;
439 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
440 uint32_t mode, off_t offset, off_t len)
442 errno = ENOSYS;
443 return -1;
446 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
447 off_t offset, off_t count, int type)
449 errno = ENOSYS;
450 return false;
453 static int skel_kernel_flock(struct vfs_handle_struct *handle,
454 struct files_struct *fsp,
455 uint32_t share_mode, uint32_t access_mask)
457 errno = ENOSYS;
458 return -1;
461 static int skel_linux_setlease(struct vfs_handle_struct *handle,
462 struct files_struct *fsp, int leasetype)
464 errno = ENOSYS;
465 return -1;
468 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
469 off_t *poffset, off_t *pcount, int *ptype,
470 pid_t *ppid)
472 errno = ENOSYS;
473 return false;
476 static int skel_symlink(vfs_handle_struct *handle,
477 const char *link_contents,
478 const struct smb_filename *new_smb_fname)
480 errno = ENOSYS;
481 return -1;
484 static int skel_vfs_readlink(vfs_handle_struct *handle,
485 const struct smb_filename *smb_fname,
486 char *buf,
487 size_t bufsiz)
489 errno = ENOSYS;
490 return -1;
493 static int skel_link(vfs_handle_struct *handle,
494 const struct smb_filename *old_smb_fname,
495 const struct smb_filename *new_smb_fname)
497 errno = ENOSYS;
498 return -1;
501 static int skel_mknod(vfs_handle_struct *handle,
502 const struct smb_filename *smb_fname,
503 mode_t mode,
504 SMB_DEV_T dev)
506 errno = ENOSYS;
507 return -1;
510 static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
511 TALLOC_CTX *ctx,
512 const struct smb_filename *smb_fname)
514 errno = ENOSYS;
515 return NULL;
518 static int skel_chflags(vfs_handle_struct *handle,
519 const struct smb_filename *smb_fname,
520 uint flags)
522 errno = ENOSYS;
523 return -1;
526 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
527 const SMB_STRUCT_STAT *sbuf)
529 struct file_id id;
530 ZERO_STRUCT(id);
531 errno = ENOSYS;
532 return id;
535 struct skel_offload_read_state {
536 bool dummy;
539 static struct tevent_req *skel_offload_read_send(
540 TALLOC_CTX *mem_ctx,
541 struct tevent_context *ev,
542 struct vfs_handle_struct *handle,
543 struct files_struct *fsp,
544 uint32_t fsctl,
545 uint32_t ttl,
546 off_t offset,
547 size_t to_copy)
549 struct tevent_req *req = NULL;
550 struct skel_offload_read_state *state = NULL;
552 req = tevent_req_create(mem_ctx, &state, struct skel_offload_read_state);
553 if (req == NULL) {
554 return NULL;
557 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
558 return tevent_req_post(req, ev);
561 static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
562 struct vfs_handle_struct *handle,
563 TALLOC_CTX *mem_ctx,
564 DATA_BLOB *_token_blob)
566 NTSTATUS status;
568 if (tevent_req_is_nterror(req, &status)) {
569 tevent_req_received(req);
570 return status;
572 tevent_req_received(req);
574 return NT_STATUS_OK;
577 struct skel_cc_state {
578 uint64_t unused;
580 static struct tevent_req *skel_offload_write_send(struct vfs_handle_struct *handle,
581 TALLOC_CTX *mem_ctx,
582 struct tevent_context *ev,
583 uint32_t fsctl,
584 DATA_BLOB *token,
585 off_t transfer_offset,
586 struct files_struct *dest_fsp,
587 off_t dest_off,
588 off_t num)
590 struct tevent_req *req;
591 struct skel_cc_state *cc_state;
593 req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state);
594 if (req == NULL) {
595 return NULL;
598 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
599 return tevent_req_post(req, ev);
602 static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
603 struct tevent_req *req,
604 off_t *copied)
606 NTSTATUS status;
608 if (tevent_req_is_nterror(req, &status)) {
609 tevent_req_received(req);
610 return status;
612 tevent_req_received(req);
614 return NT_STATUS_OK;
617 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
618 TALLOC_CTX *mem_ctx,
619 struct files_struct *fsp,
620 struct smb_filename *smb_fname,
621 uint16_t *_compression_fmt)
623 return NT_STATUS_INVALID_DEVICE_REQUEST;
626 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
627 TALLOC_CTX *mem_ctx,
628 struct files_struct *fsp,
629 uint16_t compression_fmt)
631 return NT_STATUS_INVALID_DEVICE_REQUEST;
634 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
635 struct files_struct *fsp,
636 const struct smb_filename *smb_fname,
637 TALLOC_CTX *mem_ctx,
638 unsigned int *num_streams,
639 struct stream_struct **streams)
641 return NT_STATUS_NOT_IMPLEMENTED;
644 static int skel_get_real_filename(struct vfs_handle_struct *handle,
645 const char *path,
646 const char *name,
647 TALLOC_CTX *mem_ctx, char **found_name)
649 errno = ENOSYS;
650 return -1;
653 static const char *skel_connectpath(struct vfs_handle_struct *handle,
654 const struct smb_filename *smb_fname)
656 errno = ENOSYS;
657 return NULL;
660 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
661 struct byte_range_lock *br_lck,
662 struct lock_struct *plock,
663 bool blocking_lock)
665 return NT_STATUS_NOT_IMPLEMENTED;
668 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
669 struct messaging_context *msg_ctx,
670 struct byte_range_lock *br_lck,
671 const struct lock_struct *plock)
673 errno = ENOSYS;
674 return false;
677 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
678 struct byte_range_lock *br_lck,
679 struct lock_struct *plock)
681 errno = ENOSYS;
682 return false;
685 static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
686 struct files_struct *fsp,
687 struct lock_struct *plock)
689 errno = ENOSYS;
690 return false;
693 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
694 const char *mapped_name,
695 enum vfs_translate_direction direction,
696 TALLOC_CTX *mem_ctx, char **pmapped_name)
698 return NT_STATUS_NOT_IMPLEMENTED;
701 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
702 struct files_struct *fsp,
703 TALLOC_CTX *ctx,
704 uint32_t function,
705 uint16_t req_flags, /* Needed for UNICODE ... */
706 const uint8_t *_in_data,
707 uint32_t in_len,
708 uint8_t **_out_data,
709 uint32_t max_out_len, uint32_t *out_len)
711 return NT_STATUS_NOT_IMPLEMENTED;
714 static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
715 const struct smb_filename *fname,
716 TALLOC_CTX *mem_ctx,
717 struct readdir_attr_data **pattr_data)
719 return NT_STATUS_NOT_IMPLEMENTED;
722 static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
723 struct smb_filename *smb_fname,
724 uint32_t *dosmode)
726 return NT_STATUS_NOT_IMPLEMENTED;
729 static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
730 struct files_struct *fsp,
731 uint32_t *dosmode)
733 return NT_STATUS_NOT_IMPLEMENTED;
736 static NTSTATUS skel_set_dos_attributes(struct vfs_handle_struct *handle,
737 const struct smb_filename *smb_fname,
738 uint32_t dosmode)
740 return NT_STATUS_NOT_IMPLEMENTED;
743 static NTSTATUS skel_fset_dos_attributes(struct vfs_handle_struct *handle,
744 struct files_struct *fsp,
745 uint32_t dosmode)
747 return NT_STATUS_NOT_IMPLEMENTED;
750 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
751 uint32_t security_info,
752 TALLOC_CTX *mem_ctx,
753 struct security_descriptor **ppdesc)
755 return NT_STATUS_NOT_IMPLEMENTED;
758 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
759 const struct smb_filename *smb_fname,
760 uint32_t security_info,
761 TALLOC_CTX *mem_ctx,
762 struct security_descriptor **ppdesc)
764 return NT_STATUS_NOT_IMPLEMENTED;
767 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
768 uint32_t security_info_sent,
769 const struct security_descriptor *psd)
771 return NT_STATUS_NOT_IMPLEMENTED;
774 static int skel_chmod_acl(vfs_handle_struct *handle,
775 const struct smb_filename *smb_fname,
776 mode_t mode)
778 errno = ENOSYS;
779 return -1;
782 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
783 mode_t mode)
785 errno = ENOSYS;
786 return -1;
789 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
790 const struct smb_filename *smb_fname,
791 SMB_ACL_TYPE_T type,
792 TALLOC_CTX *mem_ctx)
794 errno = ENOSYS;
795 return (SMB_ACL_T) NULL;
798 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
799 files_struct *fsp, TALLOC_CTX *mem_ctx)
801 errno = ENOSYS;
802 return (SMB_ACL_T) NULL;
805 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
806 const struct smb_filename *smb_fname,
807 TALLOC_CTX *mem_ctx,
808 char **blob_description,
809 DATA_BLOB *blob)
811 errno = ENOSYS;
812 return -1;
815 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
816 files_struct *fsp, TALLOC_CTX *mem_ctx,
817 char **blob_description, DATA_BLOB *blob)
819 errno = ENOSYS;
820 return -1;
823 static int skel_sys_acl_set_file(vfs_handle_struct *handle,
824 const struct smb_filename *smb_fname,
825 SMB_ACL_TYPE_T acltype,
826 SMB_ACL_T theacl)
828 errno = ENOSYS;
829 return -1;
832 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
833 SMB_ACL_T theacl)
835 errno = ENOSYS;
836 return -1;
839 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
840 const struct smb_filename *smb_fname)
842 errno = ENOSYS;
843 return -1;
846 static ssize_t skel_getxattr(vfs_handle_struct *handle,
847 const struct smb_filename *smb_fname,
848 const char *name,
849 void *value,
850 size_t size)
852 errno = ENOSYS;
853 return -1;
856 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
857 struct files_struct *fsp, const char *name,
858 void *value, size_t size)
860 errno = ENOSYS;
861 return -1;
864 static ssize_t skel_listxattr(vfs_handle_struct *handle,
865 const struct smb_filename *smb_fname,
866 char *list,
867 size_t size)
869 errno = ENOSYS;
870 return -1;
873 static ssize_t skel_flistxattr(vfs_handle_struct *handle,
874 struct files_struct *fsp, char *list,
875 size_t size)
877 errno = ENOSYS;
878 return -1;
881 static int skel_removexattr(vfs_handle_struct *handle,
882 const struct smb_filename *smb_fname,
883 const char *name)
885 errno = ENOSYS;
886 return -1;
889 static int skel_fremovexattr(vfs_handle_struct *handle,
890 struct files_struct *fsp, const char *name)
892 errno = ENOSYS;
893 return -1;
894 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
897 static int skel_setxattr(vfs_handle_struct *handle,
898 const struct smb_filename *smb_fname,
899 const char *name,
900 const void *value,
901 size_t size,
902 int flags)
904 errno = ENOSYS;
905 return -1;
908 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
909 const char *name, const void *value, size_t size,
910 int flags)
912 errno = ENOSYS;
913 return -1;
916 static bool skel_aio_force(struct vfs_handle_struct *handle,
917 struct files_struct *fsp)
919 errno = ENOSYS;
920 return false;
923 /* VFS operations structure */
925 struct vfs_fn_pointers skel_opaque_fns = {
926 /* Disk operations */
928 .connect_fn = skel_connect,
929 .disconnect_fn = skel_disconnect,
930 .disk_free_fn = skel_disk_free,
931 .get_quota_fn = skel_get_quota,
932 .set_quota_fn = skel_set_quota,
933 .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
934 .statvfs_fn = skel_statvfs,
935 .fs_capabilities_fn = skel_fs_capabilities,
936 .get_dfs_referrals_fn = skel_get_dfs_referrals,
937 .snap_check_path_fn = skel_snap_check_path,
938 .snap_create_fn = skel_snap_create,
939 .snap_delete_fn = skel_snap_delete,
941 /* Directory operations */
943 .opendir_fn = skel_opendir,
944 .fdopendir_fn = skel_fdopendir,
945 .readdir_fn = skel_readdir,
946 .seekdir_fn = skel_seekdir,
947 .telldir_fn = skel_telldir,
948 .rewind_dir_fn = skel_rewind_dir,
949 .mkdir_fn = skel_mkdir,
950 .rmdir_fn = skel_rmdir,
951 .closedir_fn = skel_closedir,
953 /* File operations */
955 .open_fn = skel_open,
956 .create_file_fn = skel_create_file,
957 .close_fn = skel_close_fn,
958 .read_fn = skel_vfs_read,
959 .pread_fn = skel_pread,
960 .pread_send_fn = skel_pread_send,
961 .pread_recv_fn = skel_pread_recv,
962 .write_fn = skel_write,
963 .pwrite_fn = skel_pwrite,
964 .pwrite_send_fn = skel_pwrite_send,
965 .pwrite_recv_fn = skel_pwrite_recv,
966 .lseek_fn = skel_lseek,
967 .sendfile_fn = skel_sendfile,
968 .recvfile_fn = skel_recvfile,
969 .rename_fn = skel_rename,
970 .fsync_fn = skel_fsync,
971 .fsync_send_fn = skel_fsync_send,
972 .fsync_recv_fn = skel_fsync_recv,
973 .stat_fn = skel_stat,
974 .fstat_fn = skel_fstat,
975 .lstat_fn = skel_lstat,
976 .get_alloc_size_fn = skel_get_alloc_size,
977 .unlink_fn = skel_unlink,
978 .chmod_fn = skel_chmod,
979 .fchmod_fn = skel_fchmod,
980 .chown_fn = skel_chown,
981 .fchown_fn = skel_fchown,
982 .lchown_fn = skel_lchown,
983 .chdir_fn = skel_chdir,
984 .getwd_fn = skel_getwd,
985 .ntimes_fn = skel_ntimes,
986 .ftruncate_fn = skel_ftruncate,
987 .fallocate_fn = skel_fallocate,
988 .lock_fn = skel_lock,
989 .kernel_flock_fn = skel_kernel_flock,
990 .linux_setlease_fn = skel_linux_setlease,
991 .getlock_fn = skel_getlock,
992 .symlink_fn = skel_symlink,
993 .readlink_fn = skel_vfs_readlink,
994 .link_fn = skel_link,
995 .mknod_fn = skel_mknod,
996 .realpath_fn = skel_realpath,
997 .chflags_fn = skel_chflags,
998 .file_id_create_fn = skel_file_id_create,
999 .offload_read_send_fn = skel_offload_read_send,
1000 .offload_read_recv_fn = skel_offload_read_recv,
1001 .offload_write_send_fn = skel_offload_write_send,
1002 .offload_write_recv_fn = skel_offload_write_recv,
1003 .get_compression_fn = skel_get_compression,
1004 .set_compression_fn = skel_set_compression,
1006 .streaminfo_fn = skel_streaminfo,
1007 .get_real_filename_fn = skel_get_real_filename,
1008 .connectpath_fn = skel_connectpath,
1009 .brl_lock_windows_fn = skel_brl_lock_windows,
1010 .brl_unlock_windows_fn = skel_brl_unlock_windows,
1011 .brl_cancel_windows_fn = skel_brl_cancel_windows,
1012 .strict_lock_check_fn = skel_strict_lock_check,
1013 .translate_name_fn = skel_translate_name,
1014 .fsctl_fn = skel_fsctl,
1015 .readdir_attr_fn = skel_readdir_attr,
1017 /* DOS attributes. */
1018 .get_dos_attributes_fn = skel_get_dos_attributes,
1019 .fget_dos_attributes_fn = skel_fget_dos_attributes,
1020 .set_dos_attributes_fn = skel_set_dos_attributes,
1021 .fset_dos_attributes_fn = skel_fset_dos_attributes,
1023 /* NT ACL operations. */
1025 .fget_nt_acl_fn = skel_fget_nt_acl,
1026 .get_nt_acl_fn = skel_get_nt_acl,
1027 .fset_nt_acl_fn = skel_fset_nt_acl,
1029 /* POSIX ACL operations. */
1031 .chmod_acl_fn = skel_chmod_acl,
1032 .fchmod_acl_fn = skel_fchmod_acl,
1034 .sys_acl_get_file_fn = skel_sys_acl_get_file,
1035 .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
1036 .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
1037 .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
1038 .sys_acl_set_file_fn = skel_sys_acl_set_file,
1039 .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
1040 .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
1042 /* EA operations. */
1043 .getxattr_fn = skel_getxattr,
1044 .fgetxattr_fn = skel_fgetxattr,
1045 .listxattr_fn = skel_listxattr,
1046 .flistxattr_fn = skel_flistxattr,
1047 .removexattr_fn = skel_removexattr,
1048 .fremovexattr_fn = skel_fremovexattr,
1049 .setxattr_fn = skel_setxattr,
1050 .fsetxattr_fn = skel_fsetxattr,
1052 /* aio operations */
1053 .aio_force_fn = skel_aio_force,
1056 static_decl_vfs;
1057 NTSTATUS vfs_skel_opaque_init(TALLOC_CTX *ctx)
1059 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
1060 &skel_opaque_fns);