File: params_darwin.go

package info (click to toggle)
golang-github-songgao-water 0.0~git20200317.2b4b6d7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: makefile: 21
file content (32 lines) | stat: -rw-r--r-- 1,074 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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{}
}