mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-12 16:18:50 +00:00
89c723e3e4
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
36 lines
563 B
Go
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{}
|
|
}
|