github.com/psiphon-labs/psiphon-tunnel-core@v2.0.28+incompatible/psiphon/common/tun/tun_unsupported.go (about)

     1  //go:build !darwin && !linux
     2  // +build !darwin,!linux
     3  
     4  /*
     5   * Copyright (c) 2017, Psiphon Inc.
     6   * All rights reserved.
     7   *
     8   * This program is free software: you can redistribute it and/or modify
     9   * it under the terms of the GNU General Public License as published by
    10   * the Free Software Foundation, either version 3 of the License, or
    11   * (at your option) any later version.
    12   *
    13   * This program is distributed in the hope that it will be useful,
    14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16   * GNU General Public License for more details.
    17   *
    18   * You should have received a copy of the GNU General Public License
    19   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    20   *
    21   */
    22  
    23  package tun
    24  
    25  import (
    26  	"net"
    27  	"os"
    28  
    29  	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common"
    30  	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/errors"
    31  )
    32  
    33  const (
    34  	DEFAULT_PUBLIC_INTERFACE_NAME = ""
    35  )
    36  
    37  func IsSupported() bool {
    38  	return false
    39  }
    40  
    41  func makeDeviceInboundBuffer(_ int) []byte {
    42  	return nil
    43  }
    44  
    45  func makeDeviceOutboundBuffer(_ int) []byte {
    46  	return nil
    47  }
    48  
    49  func OpenTunDevice(_ string) (*os.File, string, error) {
    50  	return nil, "", errors.Trace(errUnsupported)
    51  }
    52  
    53  func (device *Device) readTunPacket() (int, int, error) {
    54  	return 0, 0, errors.Trace(errUnsupported)
    55  }
    56  
    57  func (device *Device) writeTunPacket(_ []byte) error {
    58  	return errors.Trace(errUnsupported)
    59  }
    60  
    61  func configureNetworkConfigSubprocessCapabilities() error {
    62  	return errors.Trace(errUnsupported)
    63  }
    64  
    65  func resetNATTables(_ *ServerConfig, _ net.IP) error {
    66  	return errors.Trace(errUnsupported)
    67  }
    68  
    69  func configureServerInterface(_ *ServerConfig, _ string) error {
    70  	return errors.Trace(errUnsupported)
    71  }
    72  
    73  func configureClientInterface(_ *ClientConfig, _ string) error {
    74  	return errors.Trace(errUnsupported)
    75  }
    76  
    77  func BindToDevice(_ int, _ string) error {
    78  	return errors.Trace(errUnsupported)
    79  }
    80  
    81  func fixBindToDevice(_ common.Logger, _ bool, _ string) error {
    82  	return nil
    83  }
    84  
    85  func fileFromFD(_ int, _ string) (*os.File, error) {
    86  	return nil, errors.Trace(errUnsupported)
    87  }