Add Port as a type

This commit is contained in:
V2Ray committed 2015-12-02 12:47:54 +01:00
1 parent e8e6cf1429
commit cee85bdf26
16 files changed
+125 -98

No files matched your search

+2 -2
View File
@@ -67,7 +67,7 @@ func TestDetourConfig(t *testing.T) {
detour := detours[0]
assert.String(detour.Protocol()).Equals("dokodemo-door")
assert.Uint16(detour.PortRange().From()).Equals(uint16(28394))
assert.Uint16(detour.PortRange().To()).Equals(uint16(28394))
assert.Uint16(detour.PortRange().From().Value()).Equals(uint16(28394))
assert.Uint16(detour.PortRange().To().Value()).Equals(uint16(28394))
assert.Pointer(detour.Settings()).IsNotNil()
}
+4 -4
View File
@@ -24,15 +24,15 @@ type LogConfig struct {
}
type PortRange struct {
FromValue uint16
ToValue uint16
FromValue v2net.Port
ToValue v2net.Port
}
func (this *PortRange) From() uint16 {
func (this *PortRange) From() v2net.Port {
return this.FromValue
}
func (this *PortRange) To() uint16 {
func (this *PortRange) To() v2net.Port {
return this.ToValue
}