2016-10-12 10:46:02 -04:00
|
|
|
package core
|
2015-10-06 17:11:08 -04:00
|
|
|
|
2015-11-21 15:43:40 -05:00
|
|
|
import (
|
2016-10-15 18:46:08 -04:00
|
|
|
"v2ray.com/core/common"
|
2016-10-17 08:35:13 -04:00
|
|
|
v2net "v2ray.com/core/common/net"
|
2015-11-21 15:43:40 -05:00
|
|
|
)
|
|
|
|
|
2016-10-14 16:21:45 -04:00
|
|
|
func (this *AllocationStrategyConcurrency) GetValue() uint32 {
|
|
|
|
if this == nil {
|
|
|
|
return 3
|
|
|
|
}
|
|
|
|
return this.Value
|
2015-12-28 17:17:38 -05:00
|
|
|
}
|
|
|
|
|
2016-10-14 16:21:45 -04:00
|
|
|
func (this *AllocationStrategyRefresh) GetValue() uint32 {
|
|
|
|
if this == nil {
|
|
|
|
return 5
|
|
|
|
}
|
|
|
|
return this.Value
|
2015-10-31 09:08:13 -04:00
|
|
|
}
|
|
|
|
|
2016-10-14 16:21:45 -04:00
|
|
|
func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy {
|
|
|
|
if this.AllocationStrategy == nil {
|
|
|
|
return &AllocationStrategy{}
|
|
|
|
}
|
|
|
|
return this.AllocationStrategy
|
2015-11-13 17:43:58 -05:00
|
|
|
}
|
|
|
|
|
2016-10-17 08:35:13 -04:00
|
|
|
func (this *InboundConnectionConfig) GetListenOnValue() v2net.Address {
|
|
|
|
if this.GetListenOn() == nil {
|
|
|
|
return v2net.AnyIP
|
|
|
|
}
|
|
|
|
return this.ListenOn.AsAddress()
|
|
|
|
}
|
|
|
|
|
2016-10-14 16:21:45 -04:00
|
|
|
func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
|
2016-10-15 18:46:08 -04:00
|
|
|
if this.GetSettings() == nil {
|
|
|
|
return nil, common.ErrBadConfiguration
|
|
|
|
}
|
|
|
|
return this.GetSettings().GetInstance()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error) {
|
|
|
|
if this.GetSettings() == nil {
|
|
|
|
return nil, common.ErrBadConfiguration
|
|
|
|
}
|
|
|
|
return this.GetSettings().GetInstance()
|
2016-01-17 15:43:10 -05:00
|
|
|
}
|