params_darwin.go 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. package water
  2. // MacOSDriverProvider enumerates possible MacOS TUN/TAP implementations
  3. type MacOSDriverProvider int
  4. const (
  5. // MacOSDriverSystem refers to the default P2P driver
  6. MacOSDriverSystem MacOSDriverProvider = 0
  7. // MacOSDriverTunTapOSX refers to the third-party tuntaposx driver
  8. // see https://sourceforge.net/p/tuntaposx
  9. MacOSDriverTunTapOSX MacOSDriverProvider = 1
  10. )
  11. // PlatformSpecificParams defines parameters in Config that are specific to
  12. // macOS. A zero-value of such type is valid, yielding an interface
  13. // with OS defined name.
  14. // Currently it is not possible to set the interface name in macOS.
  15. type PlatformSpecificParams struct {
  16. // Name is the name for the interface to be used.
  17. //
  18. // For TunTapOSXDriver, it should be something like "tap0".
  19. // For SystemDriver, the name should match `utun[0-9]+`, e.g. utun233
  20. Name string
  21. // Driver should be set if an alternative driver is desired
  22. // e.g. TunTapOSXDriver
  23. Driver MacOSDriverProvider
  24. }
  25. func defaultPlatformSpecificParams() PlatformSpecificParams {
  26. return PlatformSpecificParams{}
  27. }