mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
Removes Deprecated "New" Functions
This commit is contained in:
parent
3f281b0517
commit
80f6655041
1 changed files with 3 additions and 23 deletions
26
if.go
26
if.go
|
@ -1,6 +1,8 @@
|
||||||
package water
|
package water
|
||||||
|
|
||||||
import "io"
|
import (
|
||||||
|
"io"
|
||||||
|
)
|
||||||
|
|
||||||
// Interface is a TUN/TAP interface.
|
// Interface is a TUN/TAP interface.
|
||||||
type Interface struct {
|
type Interface struct {
|
||||||
|
@ -49,28 +51,6 @@ func New(config Config) (ifce *Interface, err error) {
|
||||||
return newDev(config)
|
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.
|
// IsTUN returns true if ifce is a TUN interface.
|
||||||
func (ifce *Interface) IsTUN() bool {
|
func (ifce *Interface) IsTUN() bool {
|
||||||
return !ifce.isTAP
|
return !ifce.isTAP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue