Class: Facter::Resolvers::Solaris::FFI::Arpreq
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Facter::Resolvers::Solaris::FFI::Arpreq
- Defined in:
- lib/facter/resolvers/solaris/ffi/structs.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from FFI::Struct
Class Method Details
.new_for_ioctl(lifreq) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/facter/resolvers/solaris/ffi/structs.rb', line 34 def self.new_for_ioctl(lifreq) arp = Arpreq.new arp_addr = SockaddrIn.new(arp[:arp_pa].to_ptr) arp_addr[:sin_addr][:s_addr] = SockaddrIn.new(lifreq.lifru_addr.to_ptr).s_addr arp end |
Instance Method Details
#sa_data_to_mac ⇒ Object
28 29 30 31 32 |
# File 'lib/facter/resolvers/solaris/ffi/structs.rb', line 28 def sa_data_to_mac self[:arp_ha][:sa_data].entries[0, 6].map do |s| s.to_s(16).rjust(2, '0') end.join ':' end |