mirror of
https://github.com/fumiama/water.git
synced 2026-06-05 02:00:29 +08:00
Removes Deprecated "New" Functions
This commit is contained in:
26
if.go
26
if.go
@@ -1,6 +1,8 @@
|
||||
package water
|
||||
|
||||
import "io"
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Interface is a TUN/TAP interface.
|
||||
type Interface struct {
|
||||
@@ -49,28 +51,6 @@ func New(config Config) (ifce *Interface, err error) {
|
||||
return newDev(config)
|
||||
}
|
||||
|
||||
// NewTAP creates a new TAP interface whose name is ifName. If ifName is empty, a
|
||||
// default name (tap0, tap1, ... ) will be assigned. ifName should not exceed
|
||||
// 16 bytes. TAP interfaces are not supported on darwin.
|
||||
// ifName cannot be specified on windows, you will need ifce.Name() to use some cmds.
|
||||
//
|
||||
// Note: this function is deprecated and will be removed from the library.
|
||||
// Please use New() instead.
|
||||
func NewTAP(ifName string) (ifce *Interface, err error) {
|
||||
return newTAP(ifName)
|
||||
}
|
||||
|
||||
// NewTUN creates a new TUN interface whose name is ifName. If ifName is empty, a
|
||||
// default name (tap0, tap1, ... ) will be assigned. ifName should not exceed
|
||||
// ifName cannot be specified on windows, you will need ifce.Name() to use some cmds.
|
||||
//
|
||||
// Note: this function is deprecated and will be removed from the library.
|
||||
// Please use New() instead.
|
||||
// 16 bytes. Setting interface name is NOT supported on darwin.
|
||||
func NewTUN(ifName string) (ifce *Interface, err error) {
|
||||
return newTUN(ifName)
|
||||
}
|
||||
|
||||
// IsTUN returns true if ifce is a TUN interface.
|
||||
func (ifce *Interface) IsTUN() bool {
|
||||
return !ifce.isTAP
|
||||
|
||||
Reference in New Issue
Block a user