more no-op authenticator into a separate folder

This commit is contained in:
v2ray
2016-08-07 00:38:23 +02:00
parent 8d6a9167b5
commit 6678da2fe2
3 changed files with 29 additions and 22 deletions
+1
View File
@@ -26,6 +26,7 @@ import (
_ "github.com/v2ray/v2ray-core/transport/internet/tcp"
_ "github.com/v2ray/v2ray-core/transport/internet/udp"
_ "github.com/v2ray/v2ray-core/transport/internet/authenticators/noop"
_ "github.com/v2ray/v2ray-core/transport/internet/authenticators/srtp"
)
-22
View File
@@ -85,25 +85,3 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
auth.Seal(payload)
}
}
type NoOpAuthenticator struct{}
func (this NoOpAuthenticator) Overhead() int {
return 0
}
func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
return true
}
func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
type NoOpAuthenticatorFactory struct{}
func (this NoOpAuthenticatorFactory) Create(config AuthenticatorConfig) Authenticator {
return NoOpAuthenticator{}
}
type NoOpAuthenticatorConfig struct{}
func init() {
RegisterAuthenticator("none", NoOpAuthenticatorFactory{}, func() interface{} { return NoOpAuthenticatorConfig{} })
}
@@ -0,0 +1,28 @@
package noop
import (
"github.com/v2ray/v2ray-core/common/alloc"
"github.com/v2ray/v2ray-core/transport/internet"
)
type NoOpAuthenticator struct{}
func (this NoOpAuthenticator) Overhead() int {
return 0
}
func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
return true
}
func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
type NoOpAuthenticatorFactory struct{}
func (this NoOpAuthenticatorFactory) Create(config internet.AuthenticatorConfig) internet.Authenticator {
return NoOpAuthenticator{}
}
type NoOpAuthenticatorConfig struct{}
func init() {
internet.RegisterAuthenticator("none", NoOpAuthenticatorFactory{}, func() interface{} { return NoOpAuthenticatorConfig{} })
}