mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-10 19:50:30 +08:00
fix some error
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package lower
|
||||
|
||||
import "github.com/songgao/water"
|
||||
|
||||
var tuncfg = water.Config{DeviceType: water.TUN}
|
||||
@@ -1,15 +0,0 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package lower
|
||||
|
||||
import "github.com/songgao/water"
|
||||
|
||||
var tuncfg = water.Config{
|
||||
DeviceType: water.TUN,
|
||||
PlatformSpecificParams: water.PlatformSpecificParams{
|
||||
ComponentID: "root\\tap0901",
|
||||
InterfaceName: "OpenVPN TAP-Windows6",
|
||||
Network: "192.168.233.0/24",
|
||||
},
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/fumiama/water"
|
||||
"github.com/fumiama/water/waterutil"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/songgao/water"
|
||||
"github.com/songgao/water/waterutil"
|
||||
|
||||
"github.com/fumiama/WireGold/gold/head"
|
||||
"github.com/fumiama/WireGold/gold/link"
|
||||
@@ -23,7 +23,7 @@ type NIC struct {
|
||||
// NewNIC 新建 TUN 网络接口卡
|
||||
// 网卡地址为 ip, 所属子网为 subnet
|
||||
func NewNIC(ip, subnet string) (n *NIC) {
|
||||
ifce, err := water.New(tuncfg)
|
||||
ifce, err := water.New(water.Config{DeviceType: water.TUN})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user