Copyright 2011 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package net

import (
	

	
)

func ( int) ([]route.Message, error) {
	,  := route.FetchRIB(syscall.AF_UNSPEC, syscall.NET_RT_IFLIST, )
	if  != nil {
		return nil, 
	}
	return route.ParseRIB(syscall.NET_RT_IFLIST, )
}
interfaceMulticastAddrTable returns addresses for a specific interface.
func ( *Interface) ([]Addr, error) {
	,  := route.FetchRIB(syscall.AF_UNSPEC, syscall.NET_RT_IFLIST2, .Index)
	if  != nil {
		return nil, 
	}
	,  := route.ParseRIB(syscall.NET_RT_IFLIST2, )
	if  != nil {
		return nil, 
	}
	 := make([]Addr, 0, len())
	for ,  := range  {
		switch m := .(type) {
		case *route.InterfaceMulticastAddrMessage:
			if .Index != .Index {
				continue
			}
			var  IP
			switch sa := .Addrs[syscall.RTAX_IFA].(type) {
			case *route.Inet4Addr:
				 = IPv4(.IP[0], .IP[1], .IP[2], .IP[3])
			case *route.Inet6Addr:
				 = make(IP, IPv6len)
				copy(, .IP[:])
			}
			if  != nil {
				 = append(, &IPAddr{IP: })
			}
		}
	}
	return , nil