package madns

import (
	

	ma 
)

func ( ma.Multiaddr) ( bool) {
	ma.ForEach(, func( ma.Component) bool {
		switch .Protocol().Code {
		case dnsProtocol.Code, dns4Protocol.Code, dns6Protocol.Code, dnsaddrProtocol.Code:
			 = true
		}
		return !
	})
	return 
}

func ( context.Context,  ma.Multiaddr) ([]ma.Multiaddr, error) {
	return DefaultResolver.Resolve(, )
}

// counts the number of components in the multiaddr
func addrLen( ma.Multiaddr) int {
	 := 0
	ma.ForEach(, func( ma.Component) bool {
		++
		return true
	})
	return 
}

// trims `offset` components from the beginning of the multiaddr.
func offset( ma.Multiaddr,  int) ma.Multiaddr {
	,  := ma.SplitFunc(, func( ma.Component) bool {
		if  == 0 {
			return true
		}
		--
		return false
	})
	return 
}