mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 20:07:38 +03:00
27 lines
422 B
Go
27 lines
422 B
Go
package metadata
|
|
|
|
type Family byte
|
|
|
|
const (
|
|
AddressFamilyIPv4 Family = iota
|
|
AddressFamilyIPv6
|
|
AddressFamilyFqdn
|
|
)
|
|
|
|
func (af Family) IsIPv4() bool {
|
|
return af == AddressFamilyIPv4
|
|
}
|
|
|
|
func (af Family) IsIPv6() bool {
|
|
return af == AddressFamilyIPv6
|
|
}
|
|
|
|
func (af Family) IsIP() bool {
|
|
return af != AddressFamilyFqdn
|
|
}
|
|
|
|
func (af Family) IsFqdn() bool {
|
|
return af == AddressFamilyFqdn
|
|
}
|
|
|
|
type FamilyParser func(byte) byte
|