mirror of
				https://github.com/optim-enterprises-bv/Xray-core.git
				synced 2025-11-03 20:17:53 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			423 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			423 B
		
	
	
	
		
			Go
		
	
	
	
	
	
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
 | 
						|
}
 |