class FFI::LibC::Ifaddrs
@since 0.1.0
Public Instance Methods
addr()
click to toggle source
The address of the Interface.
@return [Sockaddr]
The basic socket address.
# File lib/ffi/libc/ifaddrs.rb, line 57 def addr Sockaddr.new(self[:ifa_addr]) end
broadaddr()
click to toggle source
The broadcast address of the Interface.
@return [Sockaddr]
The broadcast address.
# File lib/ffi/libc/ifaddrs.rb, line 77 def broadaddr Sockaddr.new(self[:ifa_ifu][:ifu_broadaddr]) end
dstaddr()
click to toggle source
The destination address of the Interface.
@return [Sockaddr]
The destination address.
# File lib/ffi/libc/ifaddrs.rb, line 87 def dstaddr Sockaddr.new(self[:ifa_ifu][:ifu_dstaddr]) end
flags()
click to toggle source
The flags of the Interface.
@return [Integer]
The flags.
# File lib/ffi/libc/ifaddrs.rb, line 47 def flags self[:ifa_flags] end
name()
click to toggle source
The name of the Interface.
@return [String]
The name.
# File lib/ffi/libc/ifaddrs.rb, line 37 def name self[:ifa_name] end
netmask()
click to toggle source
The netmask of the Interface.
@return [Sockaddr]
The socket address containing the netmask.
# File lib/ffi/libc/ifaddrs.rb, line 67 def netmask Sockaddr.new(self[:ifa_netmask]) end
next()
click to toggle source
Gets the next Interface Address in the list.
@return [Ifaddrs, nil]
The next Interface Address in the list.
# File lib/ffi/libc/ifaddrs.rb, line 25 def next unless self[:ifa_next].null? Ifaddrs.new(self[:ifa_next]) end end