mirror of https://github.com/XTLS/Xray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
423 B
25 lines
423 B
4 years ago
|
package net
|
||
|
|
||
|
func (n Network) SystemString() string {
|
||
|
switch n {
|
||
|
case Network_TCP:
|
||
|
return "tcp"
|
||
|
case Network_UDP:
|
||
|
return "udp"
|
||
|
case Network_UNIX:
|
||
|
return "unix"
|
||
|
default:
|
||
|
return "unknown"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// HasNetwork returns true if the network list has a certain network.
|
||
|
func HasNetwork(list []Network, network Network) bool {
|
||
|
for _, value := range list {
|
||
|
if value == network {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|