package ssdp

import (
	
	
)

// LocationProvider provides address for Location header which can be reached from
// "from" address network.
type LocationProvider interface {
	// Location provides an address be reachable from the network located
	// by "from" address or "ifi" interface.
	// One of "from" or "ifi" must not be nil.
	Location(from net.Addr, ifi *net.Interface) string
}

// LocationProviderFunc type is an adapter to allow the use of ordinary
// functions are location providers.
type LocationProviderFunc func(net.Addr, *net.Interface) string

func ( LocationProviderFunc) ( net.Addr,  *net.Interface) string {
	return (, )
}

type fixedLocation string

func ( fixedLocation) (net.Addr, *net.Interface) string {
	return string()
}

func toLocationProvider( any) (LocationProvider, error) {
	switch w := .(type) {
	case string:
		return fixedLocation(), nil
	case LocationProvider:
		return , nil
	default:
		return nil, fmt.Errorf("location should be a string or a ssdp.LocationProvider but got %T", )
	}
}