VirtualBox

source: vbox/trunk/src/VBox/Main/include/ExtPackUtil.h@ 69237

Last change on this file since 69237 was 68828, checked in by vboxsync, 7 years ago

ExtPack: Split up main module of extension pack, have a mandatory one for VBoxSVC and an optional one for the VM process. This finally eliminates the need to drag VBoxVMM into VBoxSVC on some platforms. Many other small cleanups, including reliably calling the unload hook from within a VM process, copy/paste with forgotten adjustments (e.g. extpacks still talking about skeleton) and spelling fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/* $Id: ExtPackUtil.h 68828 2017-09-22 14:15:57Z vboxsync $ */
2/** @file
3 * VirtualBox Main - Extension Pack Utilities and definitions, VBoxC, VBoxSVC, ++.
4 */
5
6/*
7 * Copyright (C) 2010-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_EXTPACKUTIL
19#define ____H_EXTPACKUTIL
20
21#ifdef __cplusplus
22# include <iprt/cpp/ministring.h>
23#endif
24#include <iprt/fs.h>
25#include <iprt/vfs.h>
26
27
28/** @name VBOX_EXTPACK_DESCRIPTION_NAME
29 * The name of the description file in an extension pack. */
30#define VBOX_EXTPACK_DESCRIPTION_NAME "ExtPack.xml"
31/** @name VBOX_EXTPACK_DESCRIPTION_NAME
32 * The name of the manifest file in an extension pack. */
33#define VBOX_EXTPACK_MANIFEST_NAME "ExtPack.manifest"
34/** @name VBOX_EXTPACK_SIGNATURE_NAME
35 * The name of the signature file in an extension pack. */
36#define VBOX_EXTPACK_SIGNATURE_NAME "ExtPack.signature"
37/** @name VBOX_EXTPACK_LICENSE_NAME_PREFIX
38 * The name prefix of a license file in an extension pack. There can be
39 * several license files in a pack, the variations being on locale, language
40 * and format (HTML, RTF, plain text). All extension packages shall include
41 * a */
42#define VBOX_EXTPACK_LICENSE_NAME_PREFIX "ExtPack-license"
43/** @name VBOX_EXTPACK_SUFFIX
44 * The suffix of a extension pack tarball. */
45#define VBOX_EXTPACK_SUFFIX ".vbox-extpack"
46
47/** The minimum length (strlen) of a extension pack name. */
48#define VBOX_EXTPACK_NAME_MIN_LEN 3
49/** The max length (strlen) of a extension pack name. */
50#define VBOX_EXTPACK_NAME_MAX_LEN 64
51
52/** The architecture-dependent application data subdirectory where the
53 * extension packs are installed. Relative to RTPathAppPrivateArch. */
54#define VBOX_EXTPACK_INSTALL_DIR "ExtensionPacks"
55/** The architecture-independent application data subdirectory where the
56 * certificates are installed. Relative to RTPathAppPrivateNoArch. */
57#define VBOX_EXTPACK_CERT_DIR "ExtPackCertificates"
58
59/** The maximum entry name length.
60 * Play short and safe. */
61#define VBOX_EXTPACK_MAX_MEMBER_NAME_LENGTH 128
62
63
64#ifdef __cplusplus
65
66/**
67 * Plug-in descriptor.
68 */
69typedef struct VBOXEXTPACKPLUGINDESC
70{
71 /** The name. */
72 RTCString strName;
73 /** The module name. */
74 RTCString strModule;
75 /** The description. */
76 RTCString strDescription;
77 /** The frontend or component which it plugs into. */
78 RTCString strFrontend;
79} VBOXEXTPACKPLUGINDESC;
80/** Pointer to a plug-in descriptor. */
81typedef VBOXEXTPACKPLUGINDESC *PVBOXEXTPACKPLUGINDESC;
82
83/**
84 * Extension pack descriptor
85 *
86 * This is the internal representation of the ExtPack.xml.
87 */
88typedef struct VBOXEXTPACKDESC
89{
90 /** The name. */
91 RTCString strName;
92 /** The description. */
93 RTCString strDescription;
94 /** The version string. */
95 RTCString strVersion;
96 /** The edition string. */
97 RTCString strEdition;
98 /** The internal revision number. */
99 uint32_t uRevision;
100 /** The name of the main module. */
101 RTCString strMainModule;
102 /** The name of the main VM module, empty if none. */
103 RTCString strMainVMModule;
104 /** The name of the VRDE module, empty if none. */
105 RTCString strVrdeModule;
106 /** The number of plug-in descriptors. */
107 uint32_t cPlugIns;
108 /** Pointer to an array of plug-in descriptors. */
109 PVBOXEXTPACKPLUGINDESC paPlugIns;
110 /** Whether to show the license prior to installation. */
111 bool fShowLicense;
112} VBOXEXTPACKDESC;
113
114/** Pointer to a extension pack descriptor. */
115typedef VBOXEXTPACKDESC *PVBOXEXTPACKDESC;
116/** Pointer to a const extension pack descriptor. */
117typedef VBOXEXTPACKDESC const *PCVBOXEXTPACKDESC;
118
119
120void VBoxExtPackInitDesc(PVBOXEXTPACKDESC a_pExtPackDesc);
121RTCString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
122RTCString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
123RTCString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball);
124void VBoxExtPackFreeDesc(PVBOXEXTPACKDESC a_pExtPackDesc);
125bool VBoxExtPackIsValidName(const char *pszName);
126bool VBoxExtPackIsValidMangledName(const char *pszMangledName, size_t cchMax = RTSTR_MAX);
127RTCString *VBoxExtPackMangleName(const char *pszName);
128RTCString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cbMax);
129int VBoxExtPackCalcDir(char *pszExtPackDir, size_t cbExtPackDir, const char *pszParentDir, const char *pszName);
130bool VBoxExtPackIsValidVersionString(const char *pszVersion);
131bool VBoxExtPackIsValidEditionString(const char *pszEdition);
132bool VBoxExtPackIsValidModuleString(const char *pszModule);
133
134int VBoxExtPackValidateMember(const char *pszName, RTVFSOBJTYPE enmType, RTVFSOBJ hVfsObj, char *pszError, size_t cbError);
135int VBoxExtPackOpenTarFss(RTFILE hTarballFile, char *pszError, size_t cbError, PRTVFSFSSTREAM phTarFss, PRTMANIFEST phFileManifest);
136int VBoxExtPackValidateTarball(RTFILE hTarballFile, const char *pszExtPackName,
137 const char *pszTarball, const char *pszTarballDigest,
138 char *pszError, size_t cbError,
139 PRTMANIFEST phValidManifest, PRTVFSFILE phXmlFile, RTCString *pStrDigest);
140#endif /* __cplusplus */
141
142#endif
143
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