Class: Facter::Resolvers::Solaris::FFI::Lifconf

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/facter/resolvers/solaris/ffi/structs.rb

Overview

Since:

  • 2.0.0

Class Method Summary collapse

Methods inherited from FFI::Struct

read_list

Class Method Details

.new_for_ioctl(interface_count) ⇒ Object

Since:

  • 2.0.0



85
86
87
88
89
90
91
92
# File 'lib/facter/resolvers/solaris/ffi/structs.rb', line 85

def self.new_for_ioctl(interface_count)
  lifconf = new
  lifconf[:lifc_family] = 0
  lifconf[:lifc_flags] = 0
  lifconf[:lifc_len] = interface_count * Lifreq.size
  lifconf[:lifc_buf] = ::FFI::MemoryPointer.new(Lifreq, interface_count)
  lifconf
end