// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package turn

import (
	
	
	

	
	
)

// RelayAddressGeneratorNone returns the listener with no modifications.
type RelayAddressGeneratorNone struct {
	// Address is passed to Listen/ListenPacket when creating the Relay
	Address string

	Net transport.Net
}

// Validate is called on server startup and confirms the RelayAddressGenerator is properly configured.
func ( *RelayAddressGeneratorNone) () error {
	if .Net == nil {
		var  error
		.Net,  = stdnet.NewNet()
		if  != nil {
			return fmt.Errorf("failed to create network: %w", )
		}
	}

	switch {
	case .Address == "":
		return errListeningAddressInvalid
	default:
		return nil
	}
}

// AllocatePacketConn generates a new PacketConn to receive traffic on and the IP/Port
// to populate the allocation response with.
func ( *RelayAddressGeneratorNone) ( string,  int) (
	net.PacketConn,
	net.Addr,
	error,
) {
	,  := .Net.ListenPacket(, .Address+":"+strconv.Itoa())
	if  != nil {
		return nil, nil, 
	}

	return , .LocalAddr(), nil
}

// AllocateConn generates a new Conn to receive traffic on and the IP/Port
// to populate the allocation response with.
func ( *RelayAddressGeneratorNone) (string, int) (net.Conn, net.Addr, error) {
	return nil, nil, errTODO
}