Initial FreeBSD/OpenBSD/NetBSD support (doesn't have syscalls for interface config yet)

This commit is contained in:
Neil Alexander 2019-07-20 10:59:45 +01:00
parent 8567d15277
commit a31ac06cb2
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 69 additions and 2 deletions

20
params_bsd.go Normal file
View file

@ -0,0 +1,20 @@
// +build openbsd freebsd netbsd
package water
// PlatformSpecificParams defines parameters in Config that are specific to
// Linux. A zero-value of such type is valid, yielding an interface
// with OS defined name.
type PlatformSpecificParams struct {
// Name is the name to be set for the interface to be created. This overrides
// the default name assigned by OS such as tap0 or tun0. A zero-value of this
// field, i.e. an empty string, indicates that the default name should be
// used.
Name string
}
func defaultPlatformSpecificParams() PlatformSpecificParams {
return PlatformSpecificParams{
Name: "/dev/tap0",
}
}