mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-12 22:42:18 +00:00
dns cache command
This commit is contained in:
1 parent
367d17b44c
commit
8d6fdd014a
3 files changed
+113
No files matched your search
@@ -24,6 +24,18 @@ func (subject *AddressSubject) DisplayString() string {
|
||||
return subject.Subject.DisplayString(subject.value.String())
|
||||
}
|
||||
|
||||
func (subject *AddressSubject) Equals(another v2net.Address) {
|
||||
if subject.value.IsIPv4() && another.IsIPv4() {
|
||||
IP(subject.value.IP()).Equals(another.IP())
|
||||
} else if subject.value.IsIPv6() && another.IsIPv6() {
|
||||
IP(subject.value.IP()).Equals(another.IP())
|
||||
} else if subject.value.IsDomain() && another.IsDomain() {
|
||||
assert.StringLiteral(subject.value.Domain()).Equals(another.Domain())
|
||||
} else {
|
||||
subject.Fail(subject.DisplayString(), "equals to", another)
|
||||
}
|
||||
}
|
||||
|
||||
func (subject *AddressSubject) IsIPv4() {
|
||||
if !subject.value.IsIPv4() {
|
||||
subject.Fail(subject.DisplayString(), "is", serial.StringLiteral("an IPv4 address"))
|
||||
|
||||
Reference in new issue
Block a user