lib/linux_admin/network_interface.rb
# Parses the IPv6 information from the output of `ip addr show <device>`
#
# @param ip_output [String] The command output
# @param scope     [Symbol] The IPv6 scope (either `:global` or `:local`)
Parses the IPv6 information from the output of `ip addr show `
Parses the IPv6 information from the output of ` ip addr show `
def parse_ip6(ip_output, scope)
      cidr_ip = parse_ip_output(ip_output, /inet6 .* scope #{scope}/, 1)
      return unless cidr_ip
      parts = cidr_ip.split('/')
      @network_conf["address6_#{scope}".to_sym] = parts[0]
      @network_conf["prefix6_#{scope}".to_sym] = parts[1].to_i
    end
def parse_ip6 ( ip_output , scope ) cidr_ip = parse_ip_output ( ip_output , / inet6 .* scope  #{ scope } / , 1 ) return unless cidr_ip parts = cidr_ip . split ( '/' ) @network_conf [ "address6_#{scope}" . to_sym ] = parts [ 0 ] @network_conf [ "prefix6_#{scope}" . to_sym ] = parts [ 1 ] . to_i end
Parses the IPv6 information from the output of `ip addr show <device>`
Parses the IPv6 information from the output of ` ip addr show <device > `
ip_output
The command output
The command output
scope
The IPv6 scope (either `:global` or `:local`)
The IPv6 scope ( either ` : global ` or ` : local ` )