mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
35 lines
800 B
Go
35 lines
800 B
Go
//go:build !linux && !windows && !android
|
|
|
|
package tun
|
|
|
|
import (
|
|
"github.com/xtls/xray-core/common/errors"
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
|
)
|
|
|
|
type DefaultTun struct {
|
|
}
|
|
|
|
// DefaultTun implements Tun
|
|
var _ Tun = (*DefaultTun)(nil)
|
|
|
|
// DefaultTun implements GVisorTun
|
|
var _ GVisorTun = (*DefaultTun)(nil)
|
|
|
|
// NewTun builds new tun interface handler
|
|
func NewTun(options TunOptions) (Tun, error) {
|
|
return nil, errors.New("Tun is not supported on your platform")
|
|
}
|
|
|
|
func (t *DefaultTun) Start() error {
|
|
return errors.New("Tun is not supported on your platform")
|
|
}
|
|
|
|
func (t *DefaultTun) Close() error {
|
|
return errors.New("Tun is not supported on your platform")
|
|
}
|
|
|
|
func (t *DefaultTun) newEndpoint() (stack.LinkEndpoint, error) {
|
|
return nil, errors.New("Tun is not supported on your platform")
|
|
}
|