wgengine/magicsock, etc: remove mostly unused WriteTo methods

Updates #2331
Updates #5162

Change-Id: I8291884425481eeaedde38a54adfd8ed7292a497
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-04-15 07:43:30 -07:00
committed by Brad Fitzpatrick
parent 83c41f3697
commit 29f7df9d8f
3 changed files with 19 additions and 23 deletions

View File

@@ -6,8 +6,10 @@ package nettype
import (
"context"
"io"
"net"
"net/netip"
"time"
)
// PacketListener defines the ListenPacket method as implemented
@@ -28,9 +30,16 @@ func (Std) ListenPacket(ctx context.Context, network, address string) (net.Packe
return conf.ListenPacket(ctx, network, address)
}
// PacketConn is a net.PacketConn that's about halfway (as of 2023-04-15)
// converted to use netip.AddrPort.
type PacketConn interface {
net.PacketConn
WriteToUDPAddrPort([]byte, netip.AddrPort) (int, error)
ReadFrom(p []byte) (int, net.Addr, error)
io.Closer
LocalAddr() net.Addr
SetDeadline(time.Time) error
SetReadDeadline(time.Time) error
SetWriteDeadline(time.Time) error
}
func MakePacketListenerWithNetIP(ln PacketListener) PacketListenerWithNetIP {