VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/sharedfolders/vbsfmount.h@ 76767

Last change on this file since 76767 was 76733, checked in by vboxsync, 6 years ago

vboxsf/linux: file headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: vbsfmount.h 76733 2019-01-09 12:58:33Z vboxsync $ */
2/** @file
3 * vboxsf - VBox Linux Shared Folders VFS, mount(2) parameter structure.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31#ifndef GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h
32#define GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h
33#ifndef RT_WITHOUT_PRAGMA_ONCE
34# pragma once
35#endif
36
37/* Linux constraints the size of data mount argument to PAGE_SIZE - 1. */
38#define MAX_HOST_NAME 256
39#define MAX_NLS_NAME 32
40
41#define VBSF_MOUNT_SIGNATURE_BYTE_0 '\377'
42#define VBSF_MOUNT_SIGNATURE_BYTE_1 '\376'
43#define VBSF_MOUNT_SIGNATURE_BYTE_2 '\375'
44
45struct vbsf_mount_info_new {
46 /*
47 * The old version of the mount_info struct started with a
48 * char name[MAX_HOST_NAME] field, where name cannot be '\0'.
49 * So the new version of the mount_info struct starts with a
50 * nullchar field which is always 0 so that we can detect and
51 * reject the old structure being passed.
52 */
53 char nullchar;
54 char signature[3]; /* signature */
55 int length; /* length of the whole structure */
56 char name[MAX_HOST_NAME]; /* share name */
57 char nls_name[MAX_NLS_NAME]; /* name of an I/O charset */
58 int uid; /* user ID for all entries, default 0=root */
59 int gid; /* group ID for all entries, default 0=root */
60 int ttl; /* time to live */
61 int dmode; /* mode for directories if != 0xffffffff */
62 int fmode; /* mode for regular files if != 0xffffffff */
63 int dmask; /* umask applied to directories */
64 int fmask; /* umask applied to regular files */
65 char tag[32]; /**< Mount tag for VBoxService automounter. @since 6.0 */
66};
67
68struct vbsf_mount_opts {
69 int uid;
70 int gid;
71 int ttl;
72 int dmode;
73 int fmode;
74 int dmask;
75 int fmask;
76 int ronly;
77 int sloppy;
78 int noexec;
79 int nodev;
80 int nosuid;
81 int remount;
82 char nls_name[MAX_NLS_NAME];
83 char *convertcp;
84};
85
86/** Completes the mount operation by adding the new mount point to mtab if required. */
87int vbsfmount_complete(const char *host_name, const char *mount_point,
88 unsigned long flags, struct vbsf_mount_opts *opts);
89
90#endif /* !GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette