mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +00:00
And reverts "refactor `mtu` to support setting IPv4/v6 separately" https://github.com/XTLS/Xray-core/pull/5891#issuecomment-4245677624 And fixes `autoOutboundsInterface` on Windows https://github.com/XTLS/Xray-core/pull/5887#issuecomment-4251719900 --------- Co-authored-by: LjhAUMEM <llnu14702@gmail.com>
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
//go:build !linux && !windows && !android && !darwin && !freebsd
|
|
|
|
package tun
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/xtls/xray-core/common/errors"
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
|
)
|
|
|
|
type DefaultTun struct {
|
|
}
|
|
|
|
// DefaultTun implements Tun
|
|
var _ Tun = (*DefaultTun)(nil)
|
|
|
|
// NewTun builds new tun interface handler
|
|
func NewTun(options *Config) (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) Name() (string, error) {
|
|
return "", errors.New("Tun is not supported on your platform")
|
|
}
|
|
|
|
func (t *DefaultTun) Index() (int, error) {
|
|
return 0, 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")
|
|
}
|
|
|
|
func setinterface(string, string, uintptr, *net.Interface) error {
|
|
return errors.New("Tun is not supported on your platform")
|
|
}
|