1
0
mirror of https://github.com/fumiama/water.git synced 2026-06-05 02:00:29 +08:00
Files
water/params_darwin.go
eycorsican 2b4b6d7c09 macOS: Allow to specify a name for the TUN interface (#79)
* macOS: Allow to specify a name for the TUN interface

* Update syscalls_darwin.go

Co-Authored-By: Song Gao <song@gao.io>

* Add missing imports

* Update syscalls_darwin.go

Co-authored-by: Song Gao <song@gao.io>
2020-03-17 13:31:38 -07:00

33 lines
1.0 KiB
Go

package water
// MacOSDriverProvider enumerates possible MacOS TUN/TAP implementations
type MacOSDriverProvider int
const (
// MacOSDriverSystem refers to the default P2P driver
MacOSDriverSystem MacOSDriverProvider = 0
// MacOSDriverTunTapOSX refers to the third-party tuntaposx driver
// see https://sourceforge.net/p/tuntaposx
MacOSDriverTunTapOSX MacOSDriverProvider = 1
)
// PlatformSpecificParams defines parameters in Config that are specific to
// macOS. A zero-value of such type is valid, yielding an interface
// with OS defined name.
// Currently it is not possible to set the interface name in macOS.
type PlatformSpecificParams struct {
// Name is the name for the interface to be used.
//
// For TunTapOSXDriver, it should be something like "tap0".
// For SystemDriver, the name should match `utun[0-9]+`, e.g. utun233
Name string
// Driver should be set if an alternative driver is desired
// e.g. TunTapOSXDriver
Driver MacOSDriverProvider
}
func defaultPlatformSpecificParams() PlatformSpecificParams {
return PlatformSpecificParams{}
}