1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00

network proto

This commit is contained in:
Darien Raymond
2016-09-20 10:44:44 +02:00
parent fbdb1e09d7
commit c518726910
21 changed files with 173 additions and 52 deletions

View File

@@ -20,25 +20,25 @@ type DestinationSubject struct {
}
func (this *DestinationSubject) IsTCP() {
if this.value.Network() != v2net.TCPNetwork {
if this.value.Network() != v2net.Network_TCP {
this.Fail("is", "a TCP destination")
}
}
func (this *DestinationSubject) IsNotTCP() {
if this.value.Network() == v2net.TCPNetwork {
if this.value.Network() == v2net.Network_TCP {
this.Fail("is not", "a TCP destination")
}
}
func (this *DestinationSubject) IsUDP() {
if this.value.Network() != v2net.UDPNetwork {
if this.value.Network() != v2net.Network_UDP {
this.Fail("is", "a UDP destination")
}
}
func (this *DestinationSubject) IsNotUDP() {
if this.value.Network() == v2net.UDPNetwork {
if this.value.Network() == v2net.Network_UDP {
this.Fail("is not", "a UDP destination")
}
}