VirtualBox

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

Last change on this file since 76707 was 76563, checked in by vboxsync, 6 years ago

Additions: Use GA_INCLUDED_ and variations_ as header guard prefixes with scm.

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

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