1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

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
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
3 changed files with 29 additions and 22 deletions

View File

@ -26,6 +26,7 @@ import (
_ "github.com/v2ray/v2ray-core/transport/internet/tcp" _ "github.com/v2ray/v2ray-core/transport/internet/tcp"
_ "github.com/v2ray/v2ray-core/transport/internet/udp" _ "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" _ "github.com/v2ray/v2ray-core/transport/internet/authenticators/srtp"
) )

View File

@ -85,25 +85,3 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
auth.Seal(payload) 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{} })
}

View File

@ -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{} })
}