1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-16 04:35:24 +00:00

add address type classification function

This commit is contained in:
Shelikhoo 2021-12-27 15:25:58 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent 7ee06c8239
commit 409c4e9c98

View File

@ -139,3 +139,15 @@ func (pc *packetConnWrapper) Write(p []byte) (n int, err error) {
func (pc *packetConnWrapper) Close() error {
return pc.Close()
}
func GetDestinationSubsetOf(dest net.Destination) (bool, error) {
if !dest.Address.Family().IsDomain() {
return false, errNotPacketConn
}
switch dest.Address.Domain() {
case seqPacketMagicAddress:
return false, nil
default:
return false, errNotPacketConn
}
}