facter 3.11.6.cfacter.20181031 → 3.12.0.cfacter.20180918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/ext/facter/cpp-hocon/CMakeLists.txt +1 -1
- data/ext/facter/cpp-hocon/lib/inc/hocon/types.hpp +6 -0
- data/ext/facter/cpp-hocon/lib/src/parseable.cc +3 -0
- data/ext/facter/facter/CMakeLists.txt +1 -1
- data/ext/facter/facter/acceptance/lib/facter/acceptance/base_fact_utils.rb +1 -3
- data/ext/facter/facter/acceptance/tests/facts/dmi.rb +1 -1
- data/ext/facter/facter/appveyor.yml +17 -14
- data/ext/facter/facter/exe/facter.cc +1 -2
- data/ext/facter/facter/lib/CMakeLists.txt +17 -1
- data/ext/facter/facter/lib/Doxyfile +1 -1
- data/ext/facter/facter/lib/inc/facter/facts/os.hpp +8 -0
- data/ext/facter/facter/lib/inc/facter/ruby/ruby.hpp +0 -11
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/disk_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/filesystem_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/util/freebsd/geom.hpp +149 -0
- data/ext/facter/facter/lib/src/facts/collection.cc +0 -2
- data/ext/facter/facter/lib/src/facts/freebsd/collection.cc +4 -2
- data/ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc +34 -0
- data/ext/facter/facter/lib/src/facts/freebsd/filesystem_resolver.cc +37 -0
- data/ext/facter/facter/lib/src/facts/linux/os_linux.cc +4 -0
- data/ext/facter/facter/lib/src/facts/windows/dmi_resolver.cc +2 -3
- data/ext/facter/facter/lib/src/facts/windows/operating_system_resolver.cc +1 -23
- data/ext/facter/facter/lib/src/ruby/fact.cc +41 -57
- data/ext/facter/facter/lib/src/ruby/ruby.cc +3 -35
- data/ext/facter/facter/lib/src/util/freebsd/geom.cc +130 -0
- data/ext/facter/facter/lib/tests/CMakeLists.txt +25 -9
- data/ext/facter/facter/lib/tests/facts/collection.cc +1 -1
- data/ext/facter/facter/lib/tests/fixtures.cc +1 -0
- data/ext/facter/facter/locales/FACTER.pot +18 -18
- data/ext/facter/leatherman/CMakeLists.txt +1 -1
- data/ext/facter/leatherman/cmake/cflags.cmake +2 -2
- data/ext/facter/leatherman/dynamic_library/CMakeLists.txt +1 -1
- data/ext/facter/leatherman/locale/src/locale.cc +1 -0
- data/ext/facter/leatherman/ruby/inc/leatherman/ruby/api.hpp +0 -4
- data/ext/facter/leatherman/ruby/src/api.cc +0 -1
- data/ext/facter/leatherman/util/inc/leatherman/util/strings.hpp +3 -0
- data/ext/facter/leatherman/windows/CMakeLists.txt +1 -1
- data/ext/facter/leatherman/windows/inc/leatherman/windows/wmi.hpp +0 -5
- metadata +9 -4
- data/ext/facter/facter/acceptance/tests/custom_facts/conflicts_with_builtin_fact.rb +0 -106
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cc8cd770cb6a9b5a1b68e1cbc7bd8b233759bdb698b7b62da8e27506d2db26a5
|
4
|
+
data.tar.gz: c45b8f95b9399b73e0be9f33c466ff5ea37ca921ca37d76cca58e3ebf9730162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7555cfcc4c436b0d78507ec3e5eed077384cdf234166e8c33607e6d89d239bc083a2350610aaa1b77a1746061616da6be99096babeafd25686bc2fa3ed3ef70
|
7
|
+
data.tar.gz: 92c59436e8c16749fdd4a39c8c133f64885999e672cd09adaa14f42f1146382eae6cf0e518d176bd09a74f896c8591b4317f3ba0974abbe2fff516ccb869a687
|
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.2.2)
|
|
4
4
|
# Project Setup - modify to match project naming
|
5
5
|
## Source code for a simple command-line executable for a dynamic library will be generated from the project name.
|
6
6
|
## The command-line and library names will be based off the project name.
|
7
|
-
project(cpp-hocon VERSION 0.
|
7
|
+
project(cpp-hocon VERSION 0.2.0)
|
8
8
|
|
9
9
|
string(MAKE_C_IDENTIFIER ${PROJECT_NAME} PROJECT_C_NAME)
|
10
10
|
string(TOUPPER ${PROJECT_C_NAME} PROJECT_NAME_UPPER)
|
@@ -3,7 +3,13 @@
|
|
3
3
|
#include <memory>
|
4
4
|
#include <vector>
|
5
5
|
#include <unordered_map>
|
6
|
+
#pragma GCC diagnostic push
|
7
|
+
#pragma GCC diagnostic ignored "-Waddress"
|
8
|
+
#if defined(__GNUC__) && __GNUC__ > 5
|
9
|
+
#pragma GCC diagnostic ignored "-Wnonnull-compare"
|
10
|
+
#endif
|
6
11
|
#include "boost/variant.hpp"
|
12
|
+
#pragma GCC diagnostic pop
|
7
13
|
|
8
14
|
namespace hocon {
|
9
15
|
|
@@ -11,7 +11,10 @@
|
|
11
11
|
#include <internal/config_document_parser.hpp>
|
12
12
|
#include <internal/simple_include_context.hpp>
|
13
13
|
#include <internal/config_parser.hpp>
|
14
|
+
#pragma GCC diagnostic push
|
15
|
+
#pragma GCC diagnostic ignored "-Wunused-variable"
|
14
16
|
#include <boost/thread/tss.hpp>
|
17
|
+
#pragma GCC diagnostic pop
|
15
18
|
#include <vector>
|
16
19
|
#include <numeric>
|
17
20
|
#include <leatherman/util/scope_exit.hpp>
|
@@ -523,13 +523,11 @@ module Facter
|
|
523
523
|
elsif agent['platform'] =~ /2008/
|
524
524
|
os_version = '2008 R2'
|
525
525
|
elsif agent['platform'] =~ /2012/
|
526
|
-
os_version =
|
526
|
+
os_version = '2012 R2'
|
527
527
|
elsif agent['platform'] =~ /-10/
|
528
528
|
os_version = '10'
|
529
529
|
elsif agent['platform'] =~ /2016/
|
530
530
|
os_version = '2016'
|
531
|
-
elsif agent['platform'] =~ /2019/
|
532
|
-
os_version = '2019'
|
533
531
|
else
|
534
532
|
fail_test "Unknown Windows version #{agent['platform']}"
|
535
533
|
end
|
@@ -15,13 +15,13 @@ test_name "C96148: verify dmi facts" do
|
|
15
15
|
expected_facts = {
|
16
16
|
'dmi.manufacturer' => /\w+/,
|
17
17
|
'dmi.product.name' => /\w+/,
|
18
|
-
'dmi.product.uuid' => /[-0-9A-Fa-f]+/,
|
19
18
|
}
|
20
19
|
unless agent['platform'] =~ /windows/
|
21
20
|
expected_facts.merge!({'dmi.bios.release_date' => /\d+\/\d+\/\d+/,
|
22
21
|
'dmi.bios.vendor' => /\w+/,
|
23
22
|
'dmi.bios.version' => /\d+/,
|
24
23
|
'dmi.chassis.type' => /\w+/,
|
24
|
+
'dmi.product.uuid' => /[-0-9A-Fa-f]+/,
|
25
25
|
})
|
26
26
|
end
|
27
27
|
unless agent['platform'] =~ /windows|cisco|aarch64|el-/
|
@@ -1,21 +1,27 @@
|
|
1
1
|
version: 3.1.0.{build}
|
2
2
|
clone_depth: 10
|
3
3
|
environment:
|
4
|
-
LEATHERMAN_VERSION:
|
5
|
-
CPPHOCON_VERSION: 0.1.
|
4
|
+
LEATHERMAN_VERSION: 0.99.0
|
5
|
+
CPPHOCON_VERSION: 0.1.4
|
6
6
|
|
7
7
|
init:
|
8
8
|
- |
|
9
|
-
choco install
|
10
|
-
choco install -y cmake -Version 3.2.2 -source https://www.myget.org/F/puppetlabs
|
9
|
+
choco install mingw-w64 -y -Version 4.8.3 -source https://www.myget.org/F/puppetlabs
|
11
10
|
choco install -y gettext -Version 0.19.6 -source https://www.myget.org/F/puppetlabs
|
12
|
-
choco install -y pl-toolchain-x64 -Version 2015.12.01.1 -source https://www.myget.org/F/puppetlabs
|
13
|
-
choco install -y pl-boost-x64 -Version 1.58.0.2 -source https://www.myget.org/F/puppetlabs
|
14
|
-
choco install -y pl-openssl-x64 -Version 1.0.24.1 -source https://www.myget.org/F/puppetlabs
|
15
|
-
choco install -y pl-curl-x64 -Version 7.46.0.1 -source https://www.myget.org/F/puppetlabs
|
16
|
-
choco install -y pl-yaml-cpp-x64 -Version 0.5.1.2 -source https://www.myget.org/F/puppetlabs
|
17
11
|
cmake --version
|
18
12
|
- ps: |
|
13
|
+
$env:PATH = $env:PATH.Replace("Git\bin", "Git\cmd")
|
14
|
+
$env:PATH = $env:PATH.Replace("Git\usr\bin", "Git\cmd")
|
15
|
+
|
16
|
+
wget 'https://s3.amazonaws.com/kylo-pl-bucket/boost_1_57_0-x86_64_mingw-w64_4.8.3_win32_seh.7z' -OutFile "$env:temp\boost.7z"
|
17
|
+
7z.exe x $env:temp\boost.7z -oC:\tools | FIND /V "ing "
|
18
|
+
|
19
|
+
wget 'https://s3.amazonaws.com/kylo-pl-bucket/yaml-cpp-0.5.1-x86_64_mingw-w64_4.8.3_win32_seh.7z' -OutFile "$env:temp\yaml-cpp.7z"
|
20
|
+
7z.exe x $env:temp\yaml-cpp.7z -oC:\tools | FIND /V "ing "
|
21
|
+
|
22
|
+
wget 'https://s3.amazonaws.com/kylo-pl-bucket/curl-7.42.1-x86_64_mingw-w64_4.8.3_win32_seh.7z' -OutFile "$env:temp\curl-7.42.1-x86_64_mingw-w64_4.8.3_win32_seh.7z"
|
23
|
+
7z.exe x "$env:temp\curl-7.42.1-x86_64_mingw-w64_4.8.3_win32_seh.7z" -oC:\tools | FIND /V "ing "
|
24
|
+
|
19
25
|
wget "https://github.com/puppetlabs/leatherman/releases/download/$env:LEATHERMAN_VERSION/leatherman.7z" -OutFile "$env:temp\leatherman.7z"
|
20
26
|
7z.exe x $env:temp\leatherman.7z -oC:\tools | FIND /V "ing "
|
21
27
|
|
@@ -23,15 +29,12 @@ init:
|
|
23
29
|
7z.exe x $env:temp\cpp-hocon.7z -oC:\tools | FIND /V "ing "
|
24
30
|
|
25
31
|
install:
|
26
|
-
|
27
|
-
# Include Ruby and Powershell for unit tests.
|
28
|
-
- SET PATH=C:\tools\pl-build-tools\bin;C:\tools\mingw64\bin;C:\ProgramData\chocolatey\bin;C:\Ruby22-x64\bin;C:\Program Files\7-Zip;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\gettext-iconv
|
29
|
-
- ps: rm -r C:\OpenSSL-Win64
|
32
|
+
- SET PATH=C:\Ruby21-x64\bin;C:\tools\mingw64\bin;C:\Program Files\gettext-iconv;%PATH%
|
30
33
|
- bundle install --jobs 4 --retry 2 --gemfile=lib/Gemfile --quiet
|
31
34
|
|
32
35
|
build_script:
|
33
36
|
- ps: |
|
34
|
-
cmake -G "MinGW Makefiles" -
|
37
|
+
cmake -G "MinGW Makefiles" -DBOOST_ROOT="C:\tools\boost_1_57_0-x86_64_mingw-w64_4.8.3_win32_seh" -DYAMLCPP_ROOT="C:\tools\yaml-cpp-0.5.1-x86_64_mingw-w64_4.8.3_win32_seh" -DBOOST_STATIC=ON -DCURL_STATIC=ON -DCMAKE_INSTALL_PREFIX="C:\Program Files\FACTER" -DCMAKE_PREFIX_PATH="C:\tools\leatherman;C:\tools\curl-7.42.1-x86_64_mingw-w64_4.8.3_win32_seh;C:\tools\cpp-hocon" .
|
35
38
|
mingw32-make -j2
|
36
39
|
|
37
40
|
test_script:
|
@@ -332,8 +332,7 @@ int main(int argc, char **argv)
|
|
332
332
|
if (vm.count("custom-dir")) {
|
333
333
|
custom_directories = vm["custom-dir"].as<vector<string>>();
|
334
334
|
}
|
335
|
-
|
336
|
-
facter::ruby::load_custom_facts(facts, vm.count("puppet"), redirect_ruby_stdout, custom_directories);
|
335
|
+
facter::ruby::load_custom_facts(facts, vm.count("puppet"), custom_directories);
|
337
336
|
}
|
338
337
|
|
339
338
|
if (!vm["no-external-facts"].as<bool>()) {
|
@@ -203,6 +203,7 @@ elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
|
|
203
203
|
"src/facts/freebsd/collection.cc"
|
204
204
|
"src/facts/glib/load_average_resolver.cc"
|
205
205
|
"src/facts/bsd/filesystem_resolver.cc"
|
206
|
+
"src/facts/freebsd/filesystem_resolver.cc"
|
206
207
|
"src/facts/bsd/networking_resolver.cc"
|
207
208
|
"src/facts/bsd/uptime_resolver.cc"
|
208
209
|
"src/facts/freebsd/processor_resolver.cc"
|
@@ -214,6 +215,11 @@ elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
|
|
214
215
|
"src/facts/freebsd/virtualization_resolver.cc"
|
215
216
|
"src/facts/freebsd/memory_resolver.cc"
|
216
217
|
"src/facts/freebsd/operating_system_resolver.cc"
|
218
|
+
"src/util/freebsd/geom.cc"
|
219
|
+
"src/facts/freebsd/disk_resolver.cc"
|
220
|
+
)
|
221
|
+
set(LIBFACTER_PLATFORM_LIBRARIES
|
222
|
+
geom
|
217
223
|
)
|
218
224
|
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
|
219
225
|
set(LIBFACTER_PLATFORM_SOURCES
|
@@ -279,8 +285,18 @@ if (JRUBY_SUPPORT)
|
|
279
285
|
|
280
286
|
# javah does not atomically write the header file, so parallel builds can
|
281
287
|
# read it before it finishes writing if not careful.
|
288
|
+
# JDK versions after 9 don't provide javah. Use javac in these cases
|
289
|
+
|
290
|
+
if(Java_VERSION VERSION_LESS "10")
|
291
|
+
set(JAVAH_COMMAND javah)
|
292
|
+
set(JAVAH_ARG -classpath facter.jar -d "${CMAKE_CURRENT_LIST_DIR}/src/java" com.puppetlabs.Facter)
|
293
|
+
else()
|
294
|
+
set(JAVAH_COMMAND javac)
|
295
|
+
set(JAVAH_ARG -h "${CMAKE_CURRENT_LIST_DIR}/src/java" com/puppetlabs/Facter.java)
|
296
|
+
endif()
|
297
|
+
|
282
298
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/src/java/com_puppetlabs_Facter.h"
|
283
|
-
COMMAND
|
299
|
+
COMMAND ${JAVAH_COMMAND} ARGS ${JAVAH_ARG}
|
284
300
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
285
301
|
DEPENDS facter-jruby-jar)
|
286
302
|
# Anything that depends on facter-jruby wants both the jar AND the completely written header.
|
@@ -38,7 +38,7 @@ PROJECT_NAME = facter
|
|
38
38
|
# could be handy for archiving the generated documentation or if some version
|
39
39
|
# control system is used.
|
40
40
|
|
41
|
-
PROJECT_NUMBER = 3.
|
41
|
+
PROJECT_NUMBER = 3.12.0
|
42
42
|
|
43
43
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
44
44
|
# for a project that appears at the top of each page and should give viewer a
|
@@ -41,6 +41,10 @@ namespace facter { namespace facts {
|
|
41
41
|
* The Cloud Linux operating system.
|
42
42
|
*/
|
43
43
|
constexpr static char const* cloud_linux = "CloudLinux";
|
44
|
+
/**
|
45
|
+
* The Virtuozzo Linux operating system.
|
46
|
+
*/
|
47
|
+
constexpr static char const* virtuozzo_linux = "VirtuozzoLinux";
|
44
48
|
/**
|
45
49
|
* The Parallels Server Bare Metal operating system.
|
46
50
|
*/
|
@@ -65,6 +69,10 @@ namespace facter { namespace facts {
|
|
65
69
|
* The Xen Server Linux operating system.
|
66
70
|
*/
|
67
71
|
constexpr static char const* xen_server = "XenServer";
|
72
|
+
/**
|
73
|
+
* The XCP-ng Linux operating system.
|
74
|
+
*/
|
75
|
+
constexpr static char const* xcp_ng = "XCP-ng";
|
68
76
|
/**
|
69
77
|
* The Mint Linux operating system.
|
70
78
|
*/
|
@@ -21,17 +21,6 @@ namespace facter { namespace ruby {
|
|
21
21
|
*/
|
22
22
|
LIBFACTER_EXPORT bool initialize(bool include_stack_trace = false);
|
23
23
|
|
24
|
-
/**
|
25
|
-
* Loads custom facts into the given collection.
|
26
|
-
* Important: this function should be called from main().
|
27
|
-
* Calling this function from an arbitrary stack depth may result in segfaults during Ruby GC.
|
28
|
-
* @param facts The collection to populate with custom facts.
|
29
|
-
* @param initialize_puppet Whether puppet should be loaded to find additional facts.
|
30
|
-
* @param redirect_stdout Whether Ruby's stdout should be redirected to stderr
|
31
|
-
* @param paths The paths to search for custom facts.
|
32
|
-
*/
|
33
|
-
LIBFACTER_EXPORT void load_custom_facts(facter::facts::collection& facts, bool initialize_puppet, bool redirect_stdout, std::vector<std::string> const& paths = {});
|
34
|
-
|
35
24
|
/**
|
36
25
|
* Loads custom facts into the given collection.
|
37
26
|
* Important: this function should be called from main().
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* @file
|
3
|
+
* Declares the FreeBSD disk fact resolver.
|
4
|
+
*/
|
5
|
+
#pragma once
|
6
|
+
|
7
|
+
#include "../resolvers/disk_resolver.hpp"
|
8
|
+
|
9
|
+
namespace facter { namespace facts { namespace freebsd {
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Responsible for resolving disk facts.
|
13
|
+
*/
|
14
|
+
struct disk_resolver : resolvers::disk_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
/**
|
18
|
+
* Collects the resolver data.
|
19
|
+
* @param facts The fact collection that is resolving facts.
|
20
|
+
* @return Returns the resolver data.
|
21
|
+
*/
|
22
|
+
virtual data collect_data(collection& facts) override;
|
23
|
+
};
|
24
|
+
|
25
|
+
}}} // namespace facter::facts::freebsd
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* @file
|
3
|
+
* Declares the FreeBSD file system fact resolver.
|
4
|
+
*/
|
5
|
+
#pragma once
|
6
|
+
|
7
|
+
#include "../bsd/filesystem_resolver.hpp"
|
8
|
+
|
9
|
+
namespace facter { namespace facts { namespace freebsd {
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Responsible for resolving FreeBSD file system facts.
|
13
|
+
*/
|
14
|
+
struct filesystem_resolver : bsd::filesystem_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
/**
|
18
|
+
* Collects the file system data.
|
19
|
+
* @param facts The fact collection that is resolving facts.
|
20
|
+
* @return Returns the file system data.
|
21
|
+
*/
|
22
|
+
virtual data collect_data(collection& facts) override;
|
23
|
+
};
|
24
|
+
|
25
|
+
}}} // namespace facter::facts::freebsd
|
@@ -0,0 +1,149 @@
|
|
1
|
+
/**
|
2
|
+
* @file
|
3
|
+
* Declares geom.
|
4
|
+
*/
|
5
|
+
#pragma once
|
6
|
+
|
7
|
+
#include <string>
|
8
|
+
#include <vector>
|
9
|
+
|
10
|
+
#include <libgeom.h>
|
11
|
+
|
12
|
+
namespace facter { namespace util { namespace freebsd {
|
13
|
+
|
14
|
+
/**
|
15
|
+
* geom exceptions
|
16
|
+
*/
|
17
|
+
struct geom_exception : std::runtime_error
|
18
|
+
{
|
19
|
+
/**
|
20
|
+
* Constructs a geom_exception.
|
21
|
+
* @param message the exception message.
|
22
|
+
*/
|
23
|
+
explicit geom_exception(std::string const& message);
|
24
|
+
};
|
25
|
+
|
26
|
+
/**
|
27
|
+
* GEOM configuration.
|
28
|
+
* This is a wrapper for struct gconfig.
|
29
|
+
*/
|
30
|
+
class geom_config {
|
31
|
+
private:
|
32
|
+
std::string _name;
|
33
|
+
std::string _value;
|
34
|
+
public:
|
35
|
+
/**
|
36
|
+
* Constructs a GEOM configuration item.
|
37
|
+
* @param name the name of the item.
|
38
|
+
* @param value the valure of the item.
|
39
|
+
*/
|
40
|
+
geom_config(std::string name, std::string value);
|
41
|
+
/**
|
42
|
+
* Returns the name of the item.
|
43
|
+
* @return the name of the item.
|
44
|
+
*/
|
45
|
+
std::string name();
|
46
|
+
/**
|
47
|
+
* Returns the value of the item.
|
48
|
+
* @return the value of the item.
|
49
|
+
*/
|
50
|
+
std::string value();
|
51
|
+
};
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Base GEOM class capable of storing configuration.
|
55
|
+
*/
|
56
|
+
class geom_object_with_config {
|
57
|
+
private:
|
58
|
+
std::vector<geom_config> _configs;
|
59
|
+
protected:
|
60
|
+
/**
|
61
|
+
* Loads GEOM configuration.
|
62
|
+
* @param conf the first configuration item.
|
63
|
+
*/
|
64
|
+
geom_object_with_config(struct gconf *conf);
|
65
|
+
public:
|
66
|
+
/**
|
67
|
+
* Fetches a configuration value from the object.
|
68
|
+
* @param name the name of the configuration to get.
|
69
|
+
* @return the value of the configuration.
|
70
|
+
*/
|
71
|
+
std::string config(std::string name);
|
72
|
+
};
|
73
|
+
|
74
|
+
/**
|
75
|
+
* GEOM providers.
|
76
|
+
* This is a wrapper for struct gprovider.
|
77
|
+
*/
|
78
|
+
class geom_provider : public geom_object_with_config {
|
79
|
+
private:
|
80
|
+
std::string _name;
|
81
|
+
std::string _mode;
|
82
|
+
off_t _mediasize;
|
83
|
+
u_int _sectorsize;
|
84
|
+
off_t _stripeoffset;
|
85
|
+
off_t _stripesize;
|
86
|
+
public:
|
87
|
+
/**
|
88
|
+
* Loads a GEOM provider.
|
89
|
+
* @param provider the provider to load.
|
90
|
+
*/
|
91
|
+
geom_provider(struct gprovider* provider);
|
92
|
+
/**
|
93
|
+
* Returns the provider name.
|
94
|
+
* @return the name of the provider.
|
95
|
+
*/
|
96
|
+
std::string name();
|
97
|
+
/**
|
98
|
+
* Returns the provider media size.
|
99
|
+
* @return the media size in bytes.
|
100
|
+
*/
|
101
|
+
off_t mediasize();
|
102
|
+
};
|
103
|
+
|
104
|
+
/**
|
105
|
+
* GEOM geoms (sic).
|
106
|
+
* This is a wrapper for struct ggeom.
|
107
|
+
*/
|
108
|
+
class geom_geom : public geom_object_with_config {
|
109
|
+
private:
|
110
|
+
std::string _name;
|
111
|
+
public:
|
112
|
+
/**
|
113
|
+
* Loads a GEOM Geom.
|
114
|
+
* @param geom the Geom to load.
|
115
|
+
*/
|
116
|
+
geom_geom(struct ggeom *geom);
|
117
|
+
/**
|
118
|
+
* Providers attached to this Geom.
|
119
|
+
*/
|
120
|
+
std::vector<geom_provider> providers;
|
121
|
+
/**
|
122
|
+
* Returns the name of the Geom.
|
123
|
+
* @return the name of the Geom.
|
124
|
+
*/
|
125
|
+
std::string name();
|
126
|
+
};
|
127
|
+
|
128
|
+
/**
|
129
|
+
* GEOM classes.
|
130
|
+
* This is a wrapper for struct gclass.
|
131
|
+
*/
|
132
|
+
class geom_class {
|
133
|
+
private:
|
134
|
+
struct gmesh _mesh;
|
135
|
+
struct gclass *_class;
|
136
|
+
public:
|
137
|
+
/**
|
138
|
+
* Loads a GEOM class. Throws a geom_exception on failure.
|
139
|
+
* @param type the GEOM class to load.
|
140
|
+
*/
|
141
|
+
geom_class(std::string type);
|
142
|
+
~geom_class();
|
143
|
+
/**
|
144
|
+
* Geoms attached to this class.
|
145
|
+
*/
|
146
|
+
std::vector<geom_geom> geoms;
|
147
|
+
};
|
148
|
+
|
149
|
+
}}} // namespace facter::util::freebsd
|