mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-25 05:16:09 -04:00
add address type classification function
This commit is contained in:
parent
7ee06c8239
commit
409c4e9c98
@ -139,3 +139,15 @@ func (pc *packetConnWrapper) Write(p []byte) (n int, err error) {
|
|||||||
func (pc *packetConnWrapper) Close() error {
|
func (pc *packetConnWrapper) Close() error {
|
||||||
return pc.Close()
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user