tun_unsupported.go 2.1 KB

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