facter 3.11.0.cfacter.20180319 → 3.11.2.cfacter.20180606
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/facter/facter/CMakeLists.txt +1 -1
- data/ext/facter/facter/acceptance/Gemfile +4 -3
- data/ext/facter/facter/acceptance/Rakefile +2 -342
- data/ext/facter/facter/acceptance/config/aio/options.rb +0 -6
- data/ext/facter/facter/acceptance/config/git/options.rb +1 -5
- data/ext/facter/facter/lib/Doxyfile +1 -1
- data/ext/facter/facter/lib/inc/internal/facts/aix/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/bsd/networking_resolver.hpp +2 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/networking_resolver.hpp +3 -2
- data/ext/facter/facter/lib/inc/internal/facts/solaris/networking_resolver.hpp +7 -0
- data/ext/facter/facter/lib/src/facts/aix/disk_resolver.cc +11 -2
- data/ext/facter/facter/lib/src/facts/aix/networking_resolver.cc +5 -0
- data/ext/facter/facter/lib/src/facts/bsd/networking_resolver.cc +60 -4
- data/ext/facter/facter/lib/src/facts/freebsd/networking_resolver.cc +10 -1
- data/ext/facter/facter/lib/src/facts/linux/networking_resolver.cc +10 -1
- data/ext/facter/facter/lib/src/facts/openbsd/networking_resolver.cc +10 -1
- data/ext/facter/facter/lib/src/facts/osx/networking_resolver.cc +10 -1
- data/ext/facter/facter/lib/src/facts/posix/networking_resolver.cc +2 -1
- data/ext/facter/facter/lib/src/facts/resolvers/networking_resolver.cc +23 -7
- data/ext/facter/facter/lib/src/facts/solaris/networking_resolver.cc +5 -0
- data/ext/facter/facter/locales/FACTER.pot +32 -1
- data/ext/facter/leatherman/CHANGELOG.md +9 -0
- data/ext/facter/leatherman/CMakeLists.txt +2 -1
- data/ext/facter/leatherman/cmake/FindICU.cmake +690 -0
- data/ext/facter/leatherman/locale/CMakeLists.txt +7 -0
- metadata +4 -9
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/010_Install.rb +0 -22
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/021_InstallAristaModule.rb +0 -12
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/022_Remove_LD_PRELOAD.rb +0 -11
- data/ext/facter/facter/acceptance/setup/common/00_EnvSetup.rb +0 -64
- data/ext/facter/facter/acceptance/setup/common/pre-suite/000-delete-puppet-when-none.rb +0 -11
- data/ext/facter/facter/acceptance/setup/git/pre-suite/01_TestSetup.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b40d1b9ed9140864264f7c8c36b3ecccf2e0094
|
4
|
+
data.tar.gz: 96db118a13a0d718c10410fdbb30a45e08cc7c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c47f60aaa79b8aae22f250d70d715fadf8f8bcdf16857a4dfd6d5e30371eaee6398c5d780d25855e49fdafe0f3480948a2ae96ea92f74ee01806641726ce2d41
|
7
|
+
data.tar.gz: 9650c0096ece5befe7d653a6ba3224d3b103c7d30c28a676fac759f4fbce4a94f44c0f850eabdd0f833b5d89c33e999bc8ea01bcda25066b3f5ff8259eace6c2
|
@@ -10,9 +10,10 @@ def location_for(place, fake_version = nil)
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || "~> 3.
|
14
|
-
gem
|
15
|
-
gem "beaker-
|
13
|
+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || "~> 3.34")
|
14
|
+
gem 'beaker-puppet', *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 0.13')
|
15
|
+
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || "~> 1.1")
|
16
|
+
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || "~> 0.5")
|
16
17
|
gem 'rake', "~> 10.1.0"
|
17
18
|
gem "multi_json", "~> 1.8"
|
18
19
|
|
@@ -1,342 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
require 'securerandom'
|
5
|
-
require 'fileutils'
|
6
|
-
require 'beaker-hostgenerator'
|
7
|
-
|
8
|
-
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
9
|
-
require 'puppet/acceptance/git_utils'
|
10
|
-
extend Puppet::Acceptance::GitUtils
|
11
|
-
|
12
|
-
ONE_DAY_IN_SECS = 24 * 60 * 60
|
13
|
-
REPO_CONFIGS_DIR = "repo-configs"
|
14
|
-
CLEAN.include('*.tar', REPO_CONFIGS_DIR, 'merged_options.rb')
|
15
|
-
|
16
|
-
module HarnessOptions
|
17
|
-
|
18
|
-
DEFAULTS = {
|
19
|
-
:type => 'git',
|
20
|
-
:helper => ['lib/helper.rb'],
|
21
|
-
:tests => ['tests'],
|
22
|
-
:log_level => 'debug',
|
23
|
-
:color => false,
|
24
|
-
:root_keys => true,
|
25
|
-
:ssh => {
|
26
|
-
:keys => ["~/.ssh/id_rsa-acceptance"],
|
27
|
-
},
|
28
|
-
:xml => true,
|
29
|
-
:timesync => false,
|
30
|
-
:repo_proxy => true,
|
31
|
-
:add_el_extras => false,
|
32
|
-
:preserve_hosts => 'onfail',
|
33
|
-
}
|
34
|
-
|
35
|
-
class Aggregator
|
36
|
-
attr_reader :mode
|
37
|
-
|
38
|
-
def initialize(mode)
|
39
|
-
@mode = mode
|
40
|
-
end
|
41
|
-
|
42
|
-
def get_options(file_path)
|
43
|
-
puts file_path
|
44
|
-
if File.exists? file_path
|
45
|
-
options = eval(File.read(file_path), binding)
|
46
|
-
else
|
47
|
-
puts "No options file found at #{File.expand_path(file_path)}"
|
48
|
-
end
|
49
|
-
options || {}
|
50
|
-
end
|
51
|
-
|
52
|
-
def get_mode_options
|
53
|
-
get_options("./config/#{mode}/options.rb")
|
54
|
-
end
|
55
|
-
|
56
|
-
def get_local_options
|
57
|
-
get_options("./local_options.rb")
|
58
|
-
end
|
59
|
-
|
60
|
-
def final_options(intermediary_options = {})
|
61
|
-
mode_options = get_mode_options
|
62
|
-
local_overrides = get_local_options
|
63
|
-
final_options = DEFAULTS.merge(mode_options)
|
64
|
-
final_options.merge!(intermediary_options)
|
65
|
-
final_options.merge!(local_overrides)
|
66
|
-
return final_options
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def self.options(mode, options)
|
71
|
-
final_options = Aggregator.new(mode).final_options(options)
|
72
|
-
final_options
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def beaker_test(mode = :aio, options = {})
|
77
|
-
final_options = HarnessOptions.options(mode, options)
|
78
|
-
|
79
|
-
if mode == :git
|
80
|
-
final_options[:install] ||= []
|
81
|
-
final_options[:install] << "#{build_giturl('facter')}##{sha}"
|
82
|
-
end
|
83
|
-
|
84
|
-
options_file = 'merged_options.rb'
|
85
|
-
File.open(options_file, 'w') do |merged|
|
86
|
-
merged.puts <<-EOS
|
87
|
-
# Copy this file to local_options.rb and adjust as needed if you wish to run
|
88
|
-
# with some local overrides.
|
89
|
-
EOS
|
90
|
-
merged.puts(final_options.pretty_inspect)
|
91
|
-
end
|
92
|
-
|
93
|
-
tests = ENV['TESTS'] || ENV['TEST']
|
94
|
-
tests_opt = "--tests=#{tests}" if tests
|
95
|
-
|
96
|
-
target = ENV['TEST_TARGET']
|
97
|
-
if config and File.exists?(config)
|
98
|
-
config_opt = "--hosts=#{config}"
|
99
|
-
elsif target
|
100
|
-
cli = BeakerHostGenerator::CLI.new([target, '--disable-default-role', '--osinfo-version', '1'])
|
101
|
-
ENV['BEAKER_HOSTS'] = "tmp/#{target}-#{SecureRandom.uuid}.yaml"
|
102
|
-
FileUtils.mkdir_p('tmp')
|
103
|
-
File.open(config, 'w') do |fh|
|
104
|
-
fh.print(cli.execute)
|
105
|
-
end
|
106
|
-
config_opt = "--hosts=#{config}"
|
107
|
-
end
|
108
|
-
|
109
|
-
overriding_options = ENV['OPTIONS']
|
110
|
-
|
111
|
-
args = ["--options-file", options_file, config_opt, tests_opt, overriding_options].compact
|
112
|
-
|
113
|
-
begin
|
114
|
-
sh("beaker", *args)
|
115
|
-
ensure
|
116
|
-
if (hosts_file = config || final_options[:hosts_file]) && hosts_file !~ /preserved_config/
|
117
|
-
cp(hosts_file, "log/latest/config.yml")
|
118
|
-
generate_config_for_latest_hosts if final_options[:preserve_hosts] || overriding_options =~ /--preserve-hosts/
|
119
|
-
end
|
120
|
-
mv(options_file, "log/latest")
|
121
|
-
puts "\n\n"
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
def generate_config_for_latest_hosts
|
126
|
-
preserved_config_hash = { 'HOSTS' => {} }
|
127
|
-
|
128
|
-
config_hash = YAML.load_file('log/latest/config.yml').to_hash
|
129
|
-
nodes = config_hash['HOSTS'].map do |node_label,hash|
|
130
|
-
{ :node_label => node_label, :platform => hash['platform'] }
|
131
|
-
end
|
132
|
-
|
133
|
-
pre_suite_log = File.read('log/latest/pre_suite-run.log')
|
134
|
-
nodes.each do |node_info|
|
135
|
-
possible_hostname_match = /^(\w+) \(#{node_info[:node_label]}\)/.match(pre_suite_log)
|
136
|
-
hostname = (possible_hostname_match || Array.new)[1]
|
137
|
-
fqdn = hostname ? "#{hostname}.delivery.puppetlabs.net" : "unknown"
|
138
|
-
preserved_config_hash['HOSTS'][fqdn] = {
|
139
|
-
'roles' => [ 'agent'],
|
140
|
-
'platform' => node_info[:platform],
|
141
|
-
}
|
142
|
-
preserved_config_hash['HOSTS'][fqdn]['roles'].unshift('master') if node_info[:node_label] =~ /master/
|
143
|
-
end
|
144
|
-
|
145
|
-
puts "\n\n"
|
146
|
-
pp preserved_config_hash
|
147
|
-
puts "\n\n"
|
148
|
-
|
149
|
-
File.open('log/latest/preserved_config.yaml', 'w') do |config_file|
|
150
|
-
YAML.dump(preserved_config_hash, config_file)
|
151
|
-
end
|
152
|
-
rescue Errno::ENOENT => e
|
153
|
-
puts "Couldn't generate log #{e}"
|
154
|
-
end
|
155
|
-
|
156
|
-
def list_preserved_configurations(secs_ago = ONE_DAY_IN_SECS)
|
157
|
-
preserved = {}
|
158
|
-
Dir.glob('log/*_*').each do |dir|
|
159
|
-
preserved_config_path = "#{dir}/preserved_config.yaml"
|
160
|
-
yesterday = Time.now - secs_ago.to_i
|
161
|
-
if preserved_config = File.exists?(preserved_config_path)
|
162
|
-
directory = File.new(dir)
|
163
|
-
if directory.ctime > yesterday
|
164
|
-
hosts = []
|
165
|
-
preserved_config = YAML.load_file(preserved_config_path).to_hash
|
166
|
-
preserved_config['HOSTS'].each do |hostname,values|
|
167
|
-
hosts << "#{hostname}: #{values['platform']}, #{values['roles']}"
|
168
|
-
end
|
169
|
-
preserved[hosts] = directory.to_path
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
preserved.map { |k,v| [v,k] }.sort { |a,b| a[0] <=> b[0] }.reverse
|
174
|
-
end
|
175
|
-
|
176
|
-
def list_preserved_hosts(secs_ago = ONE_DAY_IN_SECS)
|
177
|
-
hosts = Set.new
|
178
|
-
Dir.glob('log/**/pre*suite*run.log').each do |log|
|
179
|
-
yesterday = Time.now - secs_ago.to_i
|
180
|
-
File.open(log, 'r') do |file|
|
181
|
-
if file.ctime > yesterday
|
182
|
-
file.each_line do |line|
|
183
|
-
matchdata = /^(\w+) \(.*?\) \$/.match(line.encode!('UTF-8', 'UTF-8', :invalid => :replace))
|
184
|
-
hosts.add(matchdata[1]) if matchdata
|
185
|
-
end
|
186
|
-
end
|
187
|
-
end
|
188
|
-
end
|
189
|
-
hosts
|
190
|
-
end
|
191
|
-
|
192
|
-
# Plagiarized from Beaker::Vcloud#cleanup
|
193
|
-
def destroy_preserved_hosts(hosts = nil, secs_ago = ONE_DAY_IN_SECS)
|
194
|
-
secs_ago ||= ONE_DAY_IN_SECS
|
195
|
-
hosts ||= list_preserved_hosts(secs_ago)
|
196
|
-
|
197
|
-
require 'beaker/hypervisor/vsphere_helper'
|
198
|
-
vsphere_credentials = VsphereHelper.load_config("#{ENV['HOME']}/.fog")
|
199
|
-
|
200
|
-
puts "Connecting to vSphere at #{vsphere_credentials[:server]}" +
|
201
|
-
" with credentials for #{vsphere_credentials[:user]}"
|
202
|
-
|
203
|
-
vsphere_helper = VsphereHelper.new( vsphere_credentials )
|
204
|
-
|
205
|
-
vm_names = hosts.to_a
|
206
|
-
pp vm_names
|
207
|
-
vms = vsphere_helper.find_vms vm_names
|
208
|
-
vm_names.each do |name|
|
209
|
-
unless vm = vms[name]
|
210
|
-
puts "Couldn't find VM #{name} in vSphere!"
|
211
|
-
next
|
212
|
-
end
|
213
|
-
|
214
|
-
if vm.runtime.powerState == 'poweredOn'
|
215
|
-
puts "Shutting down #{vm.name}"
|
216
|
-
start = Time.now
|
217
|
-
vm.PowerOffVM_Task.wait_for_completion
|
218
|
-
puts "Spent %.2f seconds halting #{vm.name}" % (Time.now - start)
|
219
|
-
end
|
220
|
-
|
221
|
-
start = Time.now
|
222
|
-
vm.Destroy_Task
|
223
|
-
puts "Spent %.2f seconds destroying #{vm.name}" % (Time.now - start)
|
224
|
-
end
|
225
|
-
|
226
|
-
vsphere_helper.close
|
227
|
-
end
|
228
|
-
|
229
|
-
def print_preserved(preserved)
|
230
|
-
preserved.each_with_index do |entry,i|
|
231
|
-
puts "##{i}: #{entry[0]}"
|
232
|
-
entry[1].each { |h| puts " #{h}" }
|
233
|
-
end
|
234
|
-
end
|
235
|
-
|
236
|
-
def beaker_run_type
|
237
|
-
type = ENV['TYPE'] || :aio
|
238
|
-
type = type.to_sym
|
239
|
-
end
|
240
|
-
|
241
|
-
def sha
|
242
|
-
ENV['SHA']
|
243
|
-
end
|
244
|
-
|
245
|
-
def config
|
246
|
-
ENV['BEAKER_HOSTS']
|
247
|
-
end
|
248
|
-
|
249
|
-
namespace :ci do
|
250
|
-
|
251
|
-
task :check_env do
|
252
|
-
raise(USAGE) unless sha
|
253
|
-
end
|
254
|
-
|
255
|
-
namespace :test do
|
256
|
-
|
257
|
-
USAGE = <<-EOS
|
258
|
-
Requires commit SHA to be put under test as environment variable: SHA='<sha>'.
|
259
|
-
Also must set BEAKER_HOSTS=config/nodes/foo.yaml or include it in an options.rb for Beaker,
|
260
|
-
or specify TEST_TARGET in a form beaker-hostgenerator accepts, e.g. ubuntu1504-64a.
|
261
|
-
You may set TESTS=path/to/test,and/more/tests.
|
262
|
-
You may set additional Beaker OPTIONS='--more --options'
|
263
|
-
If testing from git checkouts, you may optionally set the github fork to checkout from using FORK='other-puppet-fork'.
|
264
|
-
You may also optionally set the git server to checkout from using GIT_SERVER='my.host.with.git.daemon', if you have set up a `git daemon` to pull local commits from. (In this case, the FORK should be set to the path to the repository, and you will need to allow the git daemon to serve the repo (see `git help daemon`)).
|
265
|
-
If there is a Beaker options hash in a ./local_options.rb, it will be included. Commandline options set through the above environment variables will override settings in this file.
|
266
|
-
EOS
|
267
|
-
|
268
|
-
desc <<-EOS
|
269
|
-
Run the acceptance tests through Beaker and install packages as part of the AIO puppet-agent installation.
|
270
|
-
#{USAGE}
|
271
|
-
EOS
|
272
|
-
task :aio => 'ci:check_env' do
|
273
|
-
beaker_test(:aio)
|
274
|
-
end
|
275
|
-
|
276
|
-
desc <<-EOS
|
277
|
-
Run the acceptance tests through Beaker and install from git on the configuration targets.
|
278
|
-
#{USAGE}
|
279
|
-
EOS
|
280
|
-
task :git => 'ci:check_env' do
|
281
|
-
beaker_test(:git)
|
282
|
-
end
|
283
|
-
end
|
284
|
-
|
285
|
-
desc "Capture the master and agent hostname from the latest log and construct a preserved_config.yaml for re-running against preserved hosts without provisioning."
|
286
|
-
task :extract_preserved_config do
|
287
|
-
generate_config_for_latest_hosts
|
288
|
-
end
|
289
|
-
|
290
|
-
desc <<-EOS
|
291
|
-
Run an acceptance test for a given node configuration and preserve the hosts.
|
292
|
-
Defaults to a packages run, but you can set it to 'git' with TYPE='git'.
|
293
|
-
#{USAGE}
|
294
|
-
EOS
|
295
|
-
task :test_and_preserve_hosts => 'ci:check_env' do
|
296
|
-
beaker_test(beaker_run_type, :preserve_hosts => 'always', :__preserve_config__ => true)
|
297
|
-
end
|
298
|
-
|
299
|
-
desc "List acceptance runs from the past day which had hosts preserved."
|
300
|
-
task :list_preserved do
|
301
|
-
preserved = list_preserved_configurations
|
302
|
-
print_preserved(preserved)
|
303
|
-
end
|
304
|
-
|
305
|
-
desc <<-EOS
|
306
|
-
Shutdown and destroy any hosts that we have preserved for testing. These should be reaped daily by scripts, but this will free up resources immediately.
|
307
|
-
Specify a list of comma separated HOST_NAMES if you have a set of dynamic vcloud host names you want to purge outside of what can be grepped from the logs.
|
308
|
-
You can go back through the last SECS_AGO logs. Default is one day ago in secs.
|
309
|
-
EOS
|
310
|
-
task :destroy_preserved_hosts do
|
311
|
-
host_names = ENV['HOST_NAMES'].split(',') if ENV['HOST_NAMES']
|
312
|
-
secs_ago = ENV['SECS_AGO']
|
313
|
-
destroy_preserved_hosts(host_names, secs_ago)
|
314
|
-
end
|
315
|
-
|
316
|
-
desc <<-EOS
|
317
|
-
Rerun an acceptance test using the last captured preserved_config.yaml to skip provisioning.
|
318
|
-
Or specify a CONFIG_NUMBER from `rake ci:list_preserved`.
|
319
|
-
Uses the setup/rsync/pre-suite to rsync the local puppet source onto master and agent.
|
320
|
-
You may specify an RSYNC_FILTER_FILE as well.
|
321
|
-
You may skip purging and reinstalling puppet packages by including SKIP_PACKAGE_REINSTALL.
|
322
|
-
You may skip rsyncing local puppet files over to the tests hosts by including SKIP_RSYNC.
|
323
|
-
Defaults to an aio run, but you can set it to 'git' with TYPE='git'.
|
324
|
-
EOS
|
325
|
-
task :test_against_preserved_hosts do
|
326
|
-
config_number = (ENV['CONFIG_NUMBER'] || 0).to_i
|
327
|
-
preserved = list_preserved_configurations
|
328
|
-
print_preserved(preserved)
|
329
|
-
config_path = preserved[config_number][0]
|
330
|
-
puts "Using ##{config_number}: #{config_path}"
|
331
|
-
beaker_test(beaker_run_type,
|
332
|
-
:hosts_file => "#{config_path}/preserved_config.yaml",
|
333
|
-
:no_provision => true,
|
334
|
-
:preserve_hosts => 'always',
|
335
|
-
:pre_suite => ['setup/rsync/pre-suite']
|
336
|
-
)
|
337
|
-
end
|
338
|
-
end
|
339
|
-
|
340
|
-
task :default do
|
341
|
-
sh('rake -T')
|
342
|
-
end
|
1
|
+
require 'beaker-puppet'
|
2
|
+
Beaker::DSL::Helpers::RakeHelpers.load_tasks
|
@@ -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.11.
|
41
|
+
PROJECT_NUMBER = 3.11.2
|
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
|
@@ -38,6 +38,13 @@ namespace facter { namespace facts { namespace aix {
|
|
38
38
|
*/
|
39
39
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
40
40
|
|
41
|
+
/**
|
42
|
+
* Gets the length of the link address.
|
43
|
+
* @param addr The socket address representing the link address.
|
44
|
+
* @return Returns the length of the address or 0 if not a link address.
|
45
|
+
*/
|
46
|
+
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
47
|
+
|
41
48
|
private:
|
42
49
|
using mtu_map = std::unordered_map<std::string, std::string>;
|
43
50
|
|
@@ -52,6 +52,8 @@ namespace facter { namespace facts { namespace bsd {
|
|
52
52
|
virtual std::string find_dhcp_server(std::string const& interface) const;
|
53
53
|
|
54
54
|
private:
|
55
|
+
void find_dhclient_dhcp_servers(std::map<std::string, std::string>& servers) const;
|
56
|
+
void find_networkd_dhcp_servers(std::map<std::string, std::string>& servers) const;
|
55
57
|
void populate_binding(interface& iface, ifaddrs const* addr) const;
|
56
58
|
void populate_mtu(interface& iface, ifaddrs const* addr) const;
|
57
59
|
};
|
@@ -37,6 +37,13 @@ namespace facter { namespace facts { namespace freebsd {
|
|
37
37
|
* @return Returns a pointer to the address bytes or nullptr if not a link address.
|
38
38
|
*/
|
39
39
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Gets the length of the link address.
|
43
|
+
* @param addr The socket address representing the link address.
|
44
|
+
* @return Returns the length of the address or 0 if not a link address.
|
45
|
+
*/
|
46
|
+
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
40
47
|
};
|
41
48
|
|
42
49
|
}}} // namespace facter::facts::freebsd
|
@@ -40,6 +40,13 @@ namespace facter { namespace facts { namespace linux {
|
|
40
40
|
*/
|
41
41
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
42
42
|
|
43
|
+
/**
|
44
|
+
* Gets the length of the link address.
|
45
|
+
* @param addr The socket address representing the link address.
|
46
|
+
* @return Returns the length of the address or 0 if not a link address.
|
47
|
+
*/
|
48
|
+
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
49
|
+
|
43
50
|
/**
|
44
51
|
* Gets the MTU of the link layer data.
|
45
52
|
* @param interface The name of the link layer interface.
|