sing-box/transport/wireguard/endpoint.go
世界 89c723e3e4
Improve read wait interface &
Refactor Authenticator interface to struct &
Update smux &
Update gVisor to 20231204.0 &
Update quic-go to v0.40.1 &
Update wireguard-go &
Add GSO support for TUN/WireGuard &
Fix router pre-start &
Fix bind forwarder to interface for systems stack
2024-01-03 12:21:47 +08:00

36 lines
563 B
Go

package wireguard
import (
"net/netip"
"github.com/sagernet/wireguard-go/conn"
)
var _ conn.Endpoint = (*Endpoint)(nil)
type Endpoint netip.AddrPort
func (e Endpoint) ClearSrc() {
}
func (e Endpoint) SrcToString() string {
return ""
}
func (e Endpoint) DstToString() string {
return (netip.AddrPort)(e).String()
}
func (e Endpoint) DstToBytes() []byte {
b, _ := (netip.AddrPort)(e).MarshalBinary()
return b
}
func (e Endpoint) DstIP() netip.Addr {
return (netip.AddrPort)(e).Addr()
}
func (e Endpoint) SrcIP() netip.Addr {
return netip.Addr{}
}