Listing 1. Registering Your Module with Samba

#include "includes.h"
#include "smbd/smbd.h"

#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS

#define DEMO_MODULE_NAME "vfs_demo"

static struct vfs_fn_pointers vfs_demo_fns = {
        .connect_fn = demo_connect,
        .disconnect_fn = demo_disconnect,

        .opendir_fn = demo_opendir,
        .fdopendir_fn = demo_fdopendir,
        .mkdir_fn = demo_mkdir,
        .rmdir_fn = demo_rmdir,

        .open_fn = demo_open,
        .create_file_fn = demo_create_file,
};

NTSTATUS vfs_demo_init(void);
NTSTATUS vfs_demo_init(void)
{
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
                                DEMO_MODULE_NAME,
                                &vfs_demo_fns);
}

