Class: Facter::Util::IP::Windows::Bindings4

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/util/ip/windows.rb

Direct Known Subclasses

Bindings6

Instance Method Summary collapse

Constructor Details

#initializeBindings4

Returns a new instance of Bindings4.



153
154
155
# File 'lib/facter/util/ip/windows.rb', line 153

def initialize
  @key = 'SYSTEM\CurrentControlSet\Services\Tcpip\Linkage'
end

Instance Method Details

#bindingsObject



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/facter/util/ip/windows.rb', line 157

def bindings
  require 'facter/util/registry'
  bindings = {}

  Facter::Util::Registry.hklm_read(@key, 'Bind').each_with_index do |entry, index|
    match_data = entry.match(/\\Device\\(\{.*\})/)
    unless match_data.nil?
      bindings[match_data[1]] = index
    end
  end

  bindings
rescue
  {}
end