mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 12:41:14 +08:00
u
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ goodlink.json
|
||||
config.json
|
||||
*.upx
|
||||
debug.sh
|
||||
wintun.dll
|
||||
|
@@ -4,5 +4,5 @@ Website = "https://goodlink.kony.vip"
|
||||
Icon = "theme/favicon.png"
|
||||
Name = "goodlink-windows-amd64-ui"
|
||||
ID = "goodlink.kony.vip"
|
||||
Version = "1.6.32"
|
||||
Version = "2.0.0"
|
||||
Build = 0
|
||||
|
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
var (
|
||||
Arg_pprof_addr string
|
||||
Arg_tun_local_addr string
|
||||
Arg_tun_remote_addr string
|
||||
Arg_tun_local *bool
|
||||
Arg_tun_remote *bool
|
||||
Arg_redis_addr string
|
||||
Arg_redis_tls_addr string
|
||||
Arg_redis_pass string
|
||||
@@ -23,7 +23,6 @@ var (
|
||||
Arg_conn_n1 int
|
||||
Arg_conn_active_send_time int
|
||||
Arg_conn_passive_send_time int
|
||||
Arg_stun_svr_addr string
|
||||
M_version = "1.6"
|
||||
)
|
||||
|
||||
@@ -33,18 +32,16 @@ func Help() {
|
||||
Arg_stun_test = flag.Bool("stun_test", false, "检测STUN列表是否可用")
|
||||
flag.StringVar(&Arg_pprof_addr, "pprof_addr", "", "如果CPU/内存/网络异常, 可监测运行, 例如: 0.0.0.0:6060")
|
||||
|
||||
flag.StringVar(&Arg_redis_addr, "redis_addr", "", "Redis服务地址端口, 例如: 1.2.3.4:6379")
|
||||
flag.StringVar(&Arg_redis_tls_addr, "redis_tls_addr", "", "Redis服务TLS地址端口, 例如: 1.2.3.4:16378")
|
||||
flag.StringVar(&Arg_redis_addr, "redis_addr", "", "Redis服务地址, 例如: 1.2.3.4:6379")
|
||||
flag.StringVar(&Arg_redis_tls_addr, "redis_tls_addr", "", "Redis服务TLS地址, 例如: 1.2.3.4:16378")
|
||||
flag.StringVar(&Arg_redis_pass, "redis_pass", "", "Redis服务密码, 例如: 123456")
|
||||
flag.IntVar(&Arg_redis_id, "redis_id", 15, "Redis服务可使用的表ID")
|
||||
|
||||
flag.StringVar(&Arg_stun_svr_addr, "stun", "", "自定义的STUN服务器地址, 例如: stun.easyvoip.com:3478")
|
||||
Arg_tun_local = flag.Bool("local", false, "启动Local端")
|
||||
Arg_tun_remote = flag.Bool("remote", false, "启动Remote端")
|
||||
|
||||
flag.StringVar(&Arg_tun_local_addr, "local", "", "客户端监听的地址端口, 例如: 0.0.0.0:9022")
|
||||
flag.StringVar(&Arg_tun_remote_addr, "remote", "", "服务端所处网络中, 需要被远程访问的主机地址端口, 例如: 127.0.0.1:22")
|
||||
flag.StringVar(&Arg_tun_key, "key", "", "自定义, 必须客户端和服务端一致。建议: {name}_{YYYYMMDDHHMM}, 例如: kony_202412140928")
|
||||
flag.IntVar(&Arg_p2p_timeout, "time_out", 15, "最大连接超时, 单位: 秒")
|
||||
flag.IntVar(&Arg_conn_type, "conn", 0, "若超过10分钟无法连接, 可尝试更换连接方式: 0: 主动; 1: 被动")
|
||||
|
||||
flag.IntVar(&Arg_conn_n0, "n0", 256, "dev n0")
|
||||
flag.IntVar(&Arg_conn_n1, "n1", 4, "dev n1")
|
||||
|
25
go.mod
25
go.mod
@@ -1,26 +1,32 @@
|
||||
module goodlink
|
||||
|
||||
go 1.23.4
|
||||
go 1.24.1
|
||||
|
||||
require (
|
||||
fyne.io/fyne v1.4.3
|
||||
fyne.io/fyne/v2 v2.5.3
|
||||
github.com/atotto/clipboard v0.1.4
|
||||
github.com/go-redis/redis v6.15.9+incompatible
|
||||
github.com/google/gopacket v1.1.19
|
||||
github.com/imroc/req/v3 v3.49.1
|
||||
github.com/pion/stun/v2 v2.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/quic-go/quic-go v0.48.2
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/xjasonlyu/tun2socks/v2 v2.5.2
|
||||
gogo v0.0.0
|
||||
golang.org/x/net v0.34.0
|
||||
golang.org/x/net v0.37.0
|
||||
golang.org/x/sys v0.31.0
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
||||
goodlink2 v0.0.0
|
||||
gvisor.dev/gvisor v0.0.0-20250317184159-a24f13b091dc
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
fyne.io/systray v1.11.0 // indirect
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
|
||||
github.com/Dreamacro/go-shadowsocks2 v0.1.8 // indirect
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/bmizerany/pq v0.0.0-20131128184720-da2b95e392c1 // indirect
|
||||
github.com/cloudflare/circl v1.5.0 // indirect
|
||||
@@ -40,7 +46,10 @@ require (
|
||||
github.com/go-text/typesetting v0.2.1 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/netstack v0.0.0-20191123085552-55fcc16cd0eb // indirect
|
||||
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
@@ -77,16 +86,18 @@ require (
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
github.com/yuin/goldmark v1.7.8 // indirect
|
||||
go.mongodb.org/mongo-driver v1.17.2 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/mock v0.5.0 // indirect
|
||||
golang.org/x/crypto v0.32.0 // indirect
|
||||
golang.org/x/crypto v0.36.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
|
||||
golang.org/x/image v0.23.0 // indirect
|
||||
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3 // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.29.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/sync v0.12.0 // indirect
|
||||
golang.org/x/text v0.23.0 // indirect
|
||||
golang.org/x/time v0.7.0 // indirect
|
||||
golang.org/x/tools v0.29.0 // indirect
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||
gopkg.in/eapache/queue.v1 v1.1.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
160
go.sum
160
go.sum
@@ -46,13 +46,12 @@ fyne.io/fyne/v2 v2.5.3/go.mod h1:0GOXKqyvNwk3DLmsFu9v0oYM0ZcD1ysGnlHCerKoAmo=
|
||||
fyne.io/systray v1.11.0 h1:D9HISlxSkx+jHSniMBR6fCFOUjk1x/OOOJLa9lJYAKg=
|
||||
fyne.io/systray v1.11.0/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
|
||||
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/Dreamacro/go-shadowsocks2 v0.1.8/go.mod h1:51y4Q6tJoCE7e8TmYXcQRqfoxPfE9Cvn79V6pB6Df7Y=
|
||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
||||
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
@@ -90,36 +89,22 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
|
||||
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
|
||||
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
|
||||
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
|
||||
github.com/fredbi/uri v1.1.0 h1:OqLpTXtyRg9ABReqvDGdJPqZUxs8cyBDOMXBbskCaB8=
|
||||
github.com/fredbi/uri v1.1.0/go.mod h1:aYTUoAXBOq7BLfVJ8GnKmfcuURosB1xyHDIfWeC/iW4=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
|
||||
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe h1:A/wiwvQ0CAjPkuJytaD+SsXkPU0asQ+guQEIg1BJGX4=
|
||||
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe/go.mod h1:d4clgH0/GrRwWjRzJJQXxT/h1TyuNSfF/X64zb/3Ggg=
|
||||
github.com/fyne-io/gl-js v0.0.0-20230506162202-1fdaa286a934 h1:dZC5aKobSN07hf71oMivxUmAofFja5GrfPK2rBlttX4=
|
||||
github.com/fyne-io/gl-js v0.0.0-20230506162202-1fdaa286a934/go.mod h1:d4clgH0/GrRwWjRzJJQXxT/h1TyuNSfF/X64zb/3Ggg=
|
||||
github.com/fyne-io/glfw-js v0.0.0-20241126112943-313d8a0fe1d0 h1:/1YRWFv9bAWkoo3SuxpFfzpXH0D/bQnTjNXyF4ih7Os=
|
||||
github.com/fyne-io/glfw-js v0.0.0-20241126112943-313d8a0fe1d0/go.mod h1:gsGA2dotD4v0SR6PmPCYvS9JuOeMwAtmfvDE7mbYXMY=
|
||||
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 h1:hnLq+55b7Zh7/2IRzWCpiTcAvjv/P8ERF+N7+xXbZhk=
|
||||
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2/go.mod h1:eO7W361vmlPOrykIg+Rsh1SZ3tQBaOsfzZhsIOb/Lm0=
|
||||
github.com/fyne-io/image v0.0.0-20240417123036-dc0ee9e7c964 h1:0pTELtjlVAVGSazfwRNcqTVzqmkWb1GsNozCmmZfdZA=
|
||||
github.com/fyne-io/image v0.0.0-20240417123036-dc0ee9e7c964/go.mod h1:J9Uunu842kOcTjzQj4Eq8XIDmF55szvT1PTS1cUb1UE=
|
||||
github.com/fyne-io/mobile v0.1.2/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||
github.com/gaukas/godicttls v0.0.3 h1:YNDIf0d9adcxOijiLrEzpfZGAkNwLRzPaG6OjU7EITk=
|
||||
github.com/gaukas/godicttls v0.0.3/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
|
||||
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
|
||||
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
||||
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk=
|
||||
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
|
||||
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 h1:5BVwOaUSBTlVZowGO6VZGw2H/zl9nrd3eCZfYV+NfQA=
|
||||
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
|
||||
@@ -129,13 +114,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a h1:vxnBhFDDT+xzxf1jTJKMKZw3H0swfWk9RpWbBbDK5+0=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
|
||||
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
|
||||
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
@@ -145,13 +125,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/go-text/render v0.2.0 h1:LBYoTmp5jYiJ4NPqDc2pz17MLmA3wHw1dZSVGcOdeAc=
|
||||
github.com/go-text/render v0.2.0/go.mod h1:CkiqfukRGKJA5vZZISkjSYrcdtgKQWRa2HIzvwNN5SU=
|
||||
github.com/go-text/typesetting v0.2.0 h1:fbzsgbmk04KiWtE+c3ZD4W2nmCRzBqrqQOvYlwAOdho=
|
||||
github.com/go-text/typesetting v0.2.0/go.mod h1:2+owI/sxa73XA581LAzVuEBZ3WEEV2pXeDswCH/3i1I=
|
||||
github.com/go-text/typesetting v0.2.1 h1:x0jMOGyO3d1qFAPI0j4GSsh7M0Q3Ypjzr4+CEVg82V8=
|
||||
github.com/go-text/typesetting v0.2.1/go.mod h1:mTOxEwasOFpAMBjEQDhdWRckoLLeI/+qrQeBCTGEt6M=
|
||||
github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66 h1:GUrm65PQPlhFSKjLPGOZNPNxLCybjzjYBzjfoBGaDUY=
|
||||
github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
|
||||
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066 h1:qCuYC+94v2xrb1PoS4NIDe7DGYtLnU2wWiQe9a1B1c0=
|
||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
@@ -186,15 +161,13 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
|
||||
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
@@ -207,12 +180,12 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/netstack v0.0.0-20191123085552-55fcc16cd0eb/go.mod h1:r/rILWg3r1Qy9G1IFMhsqWLq2GjwuYoTuPgG7ckMAjk=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
@@ -224,20 +197,17 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9SN1TigNLn9ZnF3W4SYRKq2gAHs=
|
||||
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA=
|
||||
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
|
||||
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20211219123610-ec9572f70e60/go.mod h1:cz9oNYuRUWGdHmLF2IodMLkAhcPtXeULvcBNagUrxTI=
|
||||
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
|
||||
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/goxjs/gl v0.0.0-20210104184919-e3fafc6f8f2a/go.mod h1:dy/f2gjY09hwVfIyATps4G2ai7/hLwLkc5TrPqONuXY=
|
||||
@@ -269,14 +239,10 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imroc/req/v3 v3.37.2 h1:vEemuA0cq9zJ6lhe+mSRhsZm951bT0CdiSH47+KTn6I=
|
||||
github.com/imroc/req/v3 v3.37.2/go.mod h1:DECzjVIrj6jcUr5n6e+z0ygmCO93rx4Jy0RjOEe1YCI=
|
||||
github.com/imroc/req/v3 v3.49.1 h1:Nvwo02riiPEzh74ozFHeEJrtjakFxnoWNR3YZYuQm9U=
|
||||
github.com/imroc/req/v3 v3.49.1/go.mod h1:tsOk8K7zI6cU4xu/VWCZVtq9Djw9IWm4MslKzme5woU=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc=
|
||||
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49 h1:Po+wkNdMmN+Zj1tDsJQy7mJlPlwGNQd9JZoPjObagf8=
|
||||
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49/go.mod h1:YiutDnxPRLk5DLUFj6Rw4pRBBURZY07GFr54NdV9mQg=
|
||||
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08 h1:wMeVzrPO3mfHIWLZtDcSaGAe2I4PW9B/P5nMkRSwCAc=
|
||||
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08/go.mod h1:ZDXo8KHryOWSIqnsb/CiDq7hQUYryCgdVnxbj8tDG7o=
|
||||
github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE=
|
||||
@@ -285,30 +251,21 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e h1:LvL4XsI70QxOGHed6yhQtAU34Kx3Qq2wwBzGFKY8zKk=
|
||||
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e/go.mod h1:kLgvv7o6UM+0QSf0QjAse3wReFDsb9qbZJdfexWlrQw=
|
||||
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25 h1:YLvr1eE6cdCqjOe972w/cYF+FjW34v27+9Vo5106B4M=
|
||||
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25/go.mod h1:kLgvv7o6UM+0QSf0QjAse3wReFDsb9qbZJdfexWlrQw=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
|
||||
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
|
||||
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
@@ -325,22 +282,15 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=
|
||||
github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
||||
github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/nicksnyder/go-i18n/v2 v2.4.0 h1:3IcvPOAvnCKwNm0TB0dLDTuawWEj+ax/RERNC+diLMM=
|
||||
github.com/nicksnyder/go-i18n/v2 v2.4.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7gMc814+6wVyEI4=
|
||||
github.com/nicksnyder/go-i18n/v2 v2.4.1 h1:zwzjtX4uYyiaU02K5Ia3zSkpJZrByARkRB4V3YPrr0g=
|
||||
github.com/nicksnyder/go-i18n/v2 v2.4.1/go.mod h1:++Pl70FR6Cki7hdzZRnEEqdc2dJt+SAGotyFg/SvZMk=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/olivere/elastic/v7 v7.0.32 h1:R7CXvbu8Eq+WlsLgxmKVKPox0oOwAE/2T9Si5BnvK6E=
|
||||
github.com/olivere/elastic/v7 v7.0.32/go.mod h1:c7PVmLe3Fxq77PIfY/bZmxY/TAamBhCzZ8xDOE09a9k=
|
||||
@@ -348,18 +298,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||
github.com/onsi/ginkgo/v2 v2.10.0 h1:sfUl4qgLdvkChZrWCYndY2EAu9BRIw1YphNAzy1VNWs=
|
||||
github.com/onsi/ginkgo/v2 v2.10.0/go.mod h1:UDQOh5wbQUlMnkLfVaIUMtQ1Vus92oM+P2JX1aulgcE=
|
||||
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=
|
||||
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
|
||||
github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
|
||||
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8=
|
||||
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
|
||||
github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk=
|
||||
github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE=
|
||||
@@ -367,12 +311,10 @@ github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
||||
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
|
||||
github.com/pion/stun/v2 v2.0.0 h1:A5+wXKLAypxQri59+tmQKVs7+l6mMM+3d+eER9ifRU0=
|
||||
github.com/pion/stun/v2 v2.0.0/go.mod h1:22qRSh08fSEttYUmJZGlriq9+03jtVmXNODgLccj8GQ=
|
||||
github.com/pion/transport/v2 v2.2.1 h1:7qYnCBlpgSJNYMbLCKuSY9KbQdBFoETvPNETv0y4N7c=
|
||||
github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g=
|
||||
github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0=
|
||||
github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q=
|
||||
github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E=
|
||||
github.com/pion/transport/v3 v3.0.1 h1:gDTlPJwROfSfz6QfSi0ZmeCSkFcnWWiiR9ES0ouANiM=
|
||||
github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0=
|
||||
github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=
|
||||
github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo=
|
||||
@@ -381,8 +323,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
|
||||
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
|
||||
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@@ -390,20 +330,15 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||
github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=
|
||||
github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M=
|
||||
github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE=
|
||||
github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs=
|
||||
github.com/rbrahul/exception v1.0.6 h1:F8yQd5DQqtQeQ4BfJ1OOdsVzK9CYr6keH7riZl3ED9I=
|
||||
github.com/rbrahul/exception v1.0.6/go.mod h1:a4e3bYsy2NGQXI8Nu2FM7g2gVdsN9yVbFE8SW+IOdQg=
|
||||
github.com/refraction-networking/utls v1.3.2 h1:o+AkWB57mkcoW36ET7uJ002CpBWHu0KPxi6vzxvPnv8=
|
||||
github.com/refraction-networking/utls v1.3.2/go.mod h1:fmoaOww2bxzzEpIKOebIsnBvjQpqP7L2vcm/9KUfm/E=
|
||||
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
|
||||
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
@@ -445,29 +380,22 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
|
||||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
|
||||
github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU=
|
||||
github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||
github.com/xjasonlyu/tun2socks/v2 v2.5.2 h1:rbfaTSLzqMezs4Qya/EL777/uMhtyE57SIV7sa1m/Pc=
|
||||
github.com/xjasonlyu/tun2socks/v2 v2.5.2/go.mod h1:BzpNKVpWyi+yC8Cuo4bFVGtjtEX38IRhnc+A9CH9sZA=
|
||||
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
@@ -477,15 +405,11 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U=
|
||||
github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
|
||||
go.mongodb.org/mongo-driver v1.11.6 h1:XM7G6PjiGAO5betLF13BIa5TlLUUE3uJ/2Ox3Lz1K+o=
|
||||
go.mongodb.org/mongo-driver v1.11.6/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY=
|
||||
go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM=
|
||||
go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
@@ -496,8 +420,7 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
||||
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
|
||||
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
@@ -508,18 +431,14 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
|
||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -531,15 +450,11 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
|
||||
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA=
|
||||
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
|
||||
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
|
||||
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
|
||||
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -557,8 +472,6 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPI
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mobile v0.0.0-20211207041440-4e6c2922fdee/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ=
|
||||
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a h1:sYbmY3FwUWCBTodZL1S3JUuOvaW6kM2o+clDzzDNBWg=
|
||||
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a/go.mod h1:Ede7gF0KGoHlj822RtphAHK1jLdrcuRBZg0sF1Q+SPc=
|
||||
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3 h1:8LrYkH99trX3onYF3dT9frUSRDXokkceG+9tHBaDAFQ=
|
||||
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3/go.mod h1:sY92m3V/rTEa4JCJ1FkKHK978K6wxOSX1PStMYo+6wI=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
@@ -572,8 +485,6 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -615,17 +526,14 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
|
||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -651,10 +559,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -713,10 +619,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
|
||||
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
|
||||
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
@@ -738,15 +642,13 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
||||
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
|
||||
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -805,14 +707,16 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
|
||||
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
@@ -915,31 +819,29 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/eapache/queue.v1 v1.1.0 h1:EldqoJEGtXYiVCMRo2C9mePO2UUGnYn2+qLmlQSqPdc=
|
||||
gopkg.in/eapache/queue.v1 v1.1.0/go.mod h1:wNtmx1/O7kZSR9zNT1TTOJ7GLpm3Vn7srzlfylFbQwU=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gvisor.dev/gvisor v0.0.0-20250317184159-a24f13b091dc h1:J6cNomELwde1luDrL6hH2NeVEBIaAofaaC2Glwl0MsQ=
|
||||
gvisor.dev/gvisor v0.0.0-20250317184159-a24f13b091dc/go.mod h1:5DMfjtclAbTIjbXqO1qCe2K5GKKxWz2JHvCChuTcJEM=
|
||||
gvisor.dev/gvisor v0.0.0-20250327014526-523c82ffd030 h1:HS4I4oZYYW7u47bhE453/4qbZMVnDT70WZJz2ZKpSPs=
|
||||
gvisor.dev/gvisor v0.0.0-20250327014526-523c82ffd030/go.mod h1:3r5CMtNQMKIvBlrmM9xWUNamjKBYPOWyXOjmg5Kts3g=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
10
main_cmd.go
10
main_cmd.go
@@ -33,15 +33,13 @@ func main2() {
|
||||
return
|
||||
}
|
||||
|
||||
switch len(config.Arg_tun_local_addr) {
|
||||
case 0:
|
||||
pro.RunRemote(config.Arg_tun_remote_addr, config.Arg_tun_key)
|
||||
|
||||
default:
|
||||
if err := pro.RunLocal(config.Arg_conn_type, config.Arg_tun_local_addr, config.Arg_tun_key); err != nil {
|
||||
if *config.Arg_tun_local {
|
||||
if err := pro.RunLocal(config.Arg_tun_key); err != nil {
|
||||
log.Println(err)
|
||||
os.Exit(0)
|
||||
}
|
||||
} else if *config.Arg_tun_remote {
|
||||
pro.RunRemote(config.Arg_tun_key)
|
||||
}
|
||||
}()
|
||||
|
||||
|
194
netstack/endpoint.go
Normal file
194
netstack/endpoint.go
Normal file
@@ -0,0 +1,194 @@
|
||||
// Package iobased provides the implementation of io.ReadWriter
|
||||
// based data-link layer endpoints.
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/buffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
const (
|
||||
// Queue length for outbound packet, arriving for read. Overflow
|
||||
// causes packet drops.
|
||||
defaultOutQueueLen = 1 << 10
|
||||
)
|
||||
|
||||
// Endpoint implements the interface of stack.LinkEndpoint from io.ReadWriter.
|
||||
type Endpoint struct {
|
||||
*channel.Endpoint
|
||||
|
||||
// rw is the io.ReadWriter for reading and writing packets.
|
||||
rw io.ReadWriter
|
||||
|
||||
// mtu (maximum transmission unit) is the maximum size of a packet.
|
||||
mtu uint32
|
||||
|
||||
// offset can be useful when perform TUN device I/O with TUN_PI enabled.
|
||||
offset int
|
||||
|
||||
// once is used to perform the init action once when attaching.
|
||||
once sync.Once
|
||||
|
||||
// wg keeps track of running goroutines.
|
||||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
// New returns stack.LinkEndpoint(.*Endpoint) and error.
|
||||
func NewEndpoint(rw io.ReadWriter, mtu uint32, offset int) (*Endpoint, error) {
|
||||
// 校验MTU(最大传输单元)有效性
|
||||
if mtu == 0 {
|
||||
return nil, errors.New("MTU size is zero")
|
||||
}
|
||||
|
||||
// 确保IO接口有效
|
||||
if rw == nil {
|
||||
return nil, errors.New("RW interface is nil")
|
||||
}
|
||||
|
||||
// 校验偏移量合法性(用于TUN设备头)
|
||||
if offset < 0 {
|
||||
return nil, errors.New("offset must be non-negative")
|
||||
}
|
||||
|
||||
// 创建并初始化端点实例
|
||||
return &Endpoint{
|
||||
Endpoint: channel.New(
|
||||
defaultOutQueueLen, // 发包队列长度(1024)
|
||||
mtu, // 最大传输单元
|
||||
"", // 链路层名称(保留空)
|
||||
),
|
||||
rw: rw, // 底层IO读写接口
|
||||
mtu: mtu, // 保存MTU配置
|
||||
offset: offset, // TUN设备头偏移量
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Attach启动从io读取数据包的例程。读者和 //通过提供的分派器分派它们。
|
||||
// 调用Attach后,Endpoint将开始从底层IO接口读取数据包并
|
||||
func (e *Endpoint) Attach(dispatcher stack.NetworkDispatcher) {
|
||||
// 调用基类方法附加网络调度器
|
||||
e.Endpoint.Attach(dispatcher)
|
||||
|
||||
// 使用sync.Once确保初始化逻辑只执行一次
|
||||
e.once.Do(func() {
|
||||
// 创建带取消功能的上下文(用于goroutine退出控制)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
// 设置等待组计数器(两个后台goroutine)
|
||||
e.wg.Add(2)
|
||||
|
||||
// 启动发包处理协程
|
||||
go func() {
|
||||
e.outboundLoop(ctx) // 处理出站数据包
|
||||
e.wg.Done() // 协程结束计数器减1
|
||||
}()
|
||||
|
||||
// 启动收包处理协程
|
||||
go func() {
|
||||
e.dispatchLoop(cancel) // 处理入站数据包(传递cancel函数)
|
||||
e.wg.Done() // 协程结束计数器减1
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
func (e *Endpoint) Wait() {
|
||||
e.wg.Wait()
|
||||
}
|
||||
|
||||
// dispatchLoop dispatches packets to upper layer.
|
||||
func (e *Endpoint) dispatchLoop(cancel context.CancelFunc) {
|
||||
// 确保退出时取消上下文,通知outboundLoop终止
|
||||
defer cancel()
|
||||
|
||||
// 获取配置参数:数据偏移量和MTU值
|
||||
offset, mtu := e.offset, int(e.mtu)
|
||||
|
||||
// 数据包接收主循环
|
||||
for {
|
||||
// 创建带偏移量的接收缓冲区(用于TUN设备头)
|
||||
data := make([]byte, offset+mtu)
|
||||
|
||||
// 从IO接口读取原始数据
|
||||
n, err := e.rw.Read(data)
|
||||
if err != nil {
|
||||
break // 发生致命错误时退出循环
|
||||
}
|
||||
|
||||
// 过滤无效数据包:空包或超过MTU大小的包
|
||||
if n == 0 || n > mtu {
|
||||
continue
|
||||
}
|
||||
|
||||
// 检查端点是否已附加到协议栈
|
||||
if !e.IsAttached() {
|
||||
continue /* 未附加时丢弃数据包 */
|
||||
}
|
||||
|
||||
// 创建协议栈数据包缓冲区
|
||||
// 从偏移量开始截取有效载荷(跳过TUN头)
|
||||
pkt := stack.NewPacketBuffer(stack.PacketBufferOptions{
|
||||
Payload: buffer.MakeWithData(data[offset : offset+n]),
|
||||
})
|
||||
|
||||
// 根据IP版本分发数据包
|
||||
switch header.IPVersion(data[offset:]) {
|
||||
case header.IPv4Version:
|
||||
e.InjectInbound(header.IPv4ProtocolNumber, pkt) // 注入IPv4协议栈
|
||||
case header.IPv6Version:
|
||||
//e.InjectInbound(header.IPv6ProtocolNumber, pkt) // 注入IPv6协议栈
|
||||
}
|
||||
pkt.DecRef() // 释放数据包引用计数
|
||||
}
|
||||
}
|
||||
|
||||
// outboundLoop reads outbound packets from channel, and then it calls
|
||||
// writePacket to send those packets back to lower layer.
|
||||
func (e *Endpoint) outboundLoop(ctx context.Context) {
|
||||
// 出站数据包处理主循环
|
||||
for {
|
||||
// 从通道读取待发送数据包(支持上下文取消)
|
||||
pkt := e.ReadContext(ctx)
|
||||
|
||||
// 读取到nil表示通道已关闭或上下文取消
|
||||
if pkt == nil {
|
||||
break
|
||||
}
|
||||
|
||||
// 将数据包写入底层IO接口
|
||||
e.writePacket(pkt)
|
||||
}
|
||||
}
|
||||
|
||||
// writePacket writes outbound packets to the io.Writer.
|
||||
func (e *Endpoint) writePacket(pkt *stack.PacketBuffer) tcpip.Error {
|
||||
// 确保数据包引用计数最终释放
|
||||
defer pkt.DecRef()
|
||||
|
||||
// 转换数据包为可写缓冲区
|
||||
buf := pkt.ToBuffer()
|
||||
// 确保缓冲区资源最终释放
|
||||
defer buf.Release()
|
||||
|
||||
// 添加TUN设备头偏移(当offset非0时)
|
||||
if e.offset != 0 {
|
||||
// 创建空白头部缓冲区(长度等于offset)
|
||||
v := buffer.NewViewWithData(make([]byte, e.offset))
|
||||
// 将头部预置到数据缓冲区前
|
||||
_ = buf.Prepend(v)
|
||||
}
|
||||
|
||||
// 将数据写入底层设备(如TUN接口)
|
||||
if _, err := e.rw.Write(buf.Flatten()); err != nil {
|
||||
// 返回端点状态错误(写入失败时)
|
||||
return &tcpip.ErrInvalidEndpointState{}
|
||||
}
|
||||
return nil
|
||||
}
|
83
netstack/forward.go
Normal file
83
netstack/forward.go
Normal file
@@ -0,0 +1,83 @@
|
||||
//go:build windows
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
pool2 "goodlink/pool"
|
||||
"goodlink/proxy"
|
||||
"log"
|
||||
|
||||
"github.com/quic-go/quic-go"
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
||||
"gvisor.dev/gvisor/pkg/waiter"
|
||||
)
|
||||
|
||||
func ForwardTCPConn(originConn *TcpConn, stun_quic_conn quic.Connection) {
|
||||
new_quic_stream, err := stun_quic_conn.OpenStreamSync(context.Background())
|
||||
if err != nil {
|
||||
log.Println("打开quic流失败", err)
|
||||
originConn.Close()
|
||||
return
|
||||
}
|
||||
|
||||
portBytes := pool2.Malloc(2)
|
||||
defer pool2.Free(portBytes)
|
||||
|
||||
binary.BigEndian.PutUint16(portBytes, originConn.ID().LocalPort)
|
||||
new_quic_stream.Write(portBytes)
|
||||
|
||||
go proxy.ForwardQ2T(new_quic_stream, originConn, stun_quic_conn)
|
||||
go proxy.ForwardT2Q(originConn, new_quic_stream, stun_quic_conn)
|
||||
}
|
||||
|
||||
// 创建TCP转发器,处理新的TCP连接请求
|
||||
func NewTcpForwarder(s *stack.Stack, stun_quic_conn quic.Connection) *tcp.Forwarder {
|
||||
return tcp.NewForwarder(s, 0, 2048, func(r *tcp.ForwarderRequest) {
|
||||
var (
|
||||
wq waiter.Queue
|
||||
ep tcpip.Endpoint
|
||||
err tcpip.Error
|
||||
id = r.ID()
|
||||
)
|
||||
|
||||
if stun_quic_conn == nil {
|
||||
r.Complete(true) // 拒绝连接
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("forward tcp request: %s:%d->%s:%d",
|
||||
id.RemoteAddress, id.RemotePort, id.LocalAddress, id.LocalPort)
|
||||
|
||||
// 延迟处理错误日志
|
||||
defer func() {
|
||||
if err != nil {
|
||||
log.Printf("forward tcp request: %s:%d->%s:%d: %s",
|
||||
id.RemoteAddress, id.RemotePort, id.LocalAddress, id.LocalPort, err)
|
||||
}
|
||||
}()
|
||||
|
||||
// 执行TCP三次握手
|
||||
ep, err = r.CreateEndpoint(&wq)
|
||||
if err != nil {
|
||||
// 发送RST:防止潜在的半开TCP连接泄漏
|
||||
r.Complete(true)
|
||||
return
|
||||
}
|
||||
defer r.Complete(false)
|
||||
|
||||
// 设置TCP套接字选项
|
||||
err = setSocketOptions(s, ep)
|
||||
|
||||
// 创建TCP连接对象并调用处理器
|
||||
conn := &TcpConn{
|
||||
TCPConn: gonet.NewTCPConn(&wq, ep),
|
||||
id: id,
|
||||
}
|
||||
ForwardTCPConn(conn, stun_quic_conn)
|
||||
})
|
||||
}
|
26
netstack/setup_linux.go
Normal file
26
netstack/setup_linux.go
Normal file
@@ -0,0 +1,26 @@
|
||||
//go:build linux
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"github.com/quic-go/quic-go"
|
||||
)
|
||||
|
||||
// setupNetstack 初始化并配置网络栈
|
||||
// 该函数负责创建协议栈、设置网络接口、配置IP地址和路由表
|
||||
// 返回:
|
||||
// - *stack.Stack: 配置好的网络栈实例
|
||||
// - error: 初始化过程中的错误信息
|
||||
func Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetForWarder(stun_quic_conn quic.Connection) {
|
||||
}
|
||||
|
||||
func GetRemoteIP() string {
|
||||
return "Linux暂不支持Local端"
|
||||
}
|
||||
|
||||
func Stop() {
|
||||
}
|
189
netstack/setup_windows.go
Normal file
189
netstack/setup_windows.go
Normal file
@@ -0,0 +1,189 @@
|
||||
//go:build windows
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"gogo"
|
||||
"goodlink/winipcfg"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/quic-go/quic-go"
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
||||
)
|
||||
|
||||
func SetWinTunIP(wintunEP *Device, ip string, mask int, ip2r string, mask2r int) error {
|
||||
var ipf netip.Prefix
|
||||
var err error
|
||||
|
||||
// 将LUID转换为Windows网络接口标识
|
||||
// LUID: 本地唯一接口标识符(Local Unique Identifier)
|
||||
// 用于唯一标识网络接口,通常用于网络配置和管理
|
||||
link := winipcfg.LUID((*wintunEP).(*TUN).GetNt().LUID())
|
||||
|
||||
// 将IP地址和掩码组合为CIDR格式(如192.168.1.1/24)
|
||||
if ipf, err = netip.ParsePrefix(fmt.Sprintf("%s/%d", ip, mask)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 设置接口的主IP地址
|
||||
if err = link.SetIPAddresses([]netip.Prefix{ipf}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ipf, err = netip.ParsePrefix(fmt.Sprintf("%s/%d", ip2r, mask2r)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 配置路由规则参数
|
||||
routeData := &winipcfg.RouteData{
|
||||
Destination: ipf, // 目标网络(CIDR格式)
|
||||
NextHop: netip.MustParseAddr(ip), // 下一跳地址(本机IP)
|
||||
Metric: 0, // 路由优先级(数值越小优先级越高)
|
||||
}
|
||||
|
||||
// 应用路由配置到网络接口
|
||||
if err = link.SetRoutes([]*winipcfg.RouteData{
|
||||
routeData,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetNetStackIP(s *stack.Stack, nicID tcpip.NICID, ip string, mask int, ip2r, mask2r string) error {
|
||||
// 设置IP地址
|
||||
// 配置网络接口的IPv4地址为192.168.3.3/24
|
||||
protocolAddr := tcpip.ProtocolAddress{
|
||||
Protocol: ipv4.ProtocolNumber,
|
||||
AddressWithPrefix: tcpip.AddressWithPrefix{
|
||||
Address: tcpip.AddrFromSlice(net.ParseIP(ip).To4()), // 设置IP地址
|
||||
PrefixLen: mask, // 设置子网掩码长度
|
||||
},
|
||||
}
|
||||
// 将IP地址添加到网络接口,设置为静态配置的主端点
|
||||
if err := s.AddProtocolAddress(nicID, protocolAddr, stack.AddressProperties{
|
||||
PEB: stack.CanBePrimaryEndpoint, // 允许作为主端点
|
||||
ConfigType: stack.AddressConfigStatic, // 使用静态配置
|
||||
}); err != nil {
|
||||
return fmt.Errorf("AddProtocolAddress failed: %v", err)
|
||||
}
|
||||
|
||||
// 设置路由
|
||||
// 配置默认路由,将所有192.168.3.0/24网段的流量转发到该接口
|
||||
subnet, err := tcpip.NewSubnet(
|
||||
tcpip.AddrFromSlice(net.ParseIP(ip2r).To4()), // 设置目标网段
|
||||
tcpip.MaskFromBytes(net.ParseIP(mask2r).To4()), // 设置子网掩码
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("NewSubnet failed: %v", err)
|
||||
}
|
||||
// 设置路由表,将指定网段的流量转发到NIC ID 1
|
||||
s.SetRouteTable([]tcpip.Route{
|
||||
{
|
||||
Destination: subnet, // 目标网段
|
||||
NIC: nicID, // 使用的网络接口
|
||||
},
|
||||
})
|
||||
|
||||
// 设置网络接口为混杂模式
|
||||
// 允许接收所有网络数据包,用于网络数据包的转发
|
||||
s.SetPromiscuousMode(nicID, true)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
init_stack_suss = false
|
||||
netstack_stack *stack.Stack
|
||||
)
|
||||
|
||||
func InitWintunDll() error {
|
||||
if !gogo.Utils().FileExist("wintun.dll") {
|
||||
var res []byte
|
||||
var err error
|
||||
var resp *http.Response
|
||||
|
||||
client := &http.Client{
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: true, // 跳过证书验证
|
||||
},
|
||||
},
|
||||
Timeout: 3 * time.Second,
|
||||
}
|
||||
if resp, err = client.Get("https://gitee.com/konyshe/goodlink_conf/raw/master/wintun.dll"); err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if res, err = io.ReadAll(resp.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
gogo.Utils().FileAppend("wintun.dll", res)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// setupNetstack 初始化并配置网络栈
|
||||
// 该函数负责创建协议栈、设置网络接口、配置IP地址和路由表
|
||||
// 返回:
|
||||
// - *stack.Stack: 配置好的网络栈实例
|
||||
// - error: 初始化过程中的错误信息
|
||||
func Start() error {
|
||||
InitWintunDll()
|
||||
|
||||
if init_stack_suss {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Sudo()
|
||||
|
||||
// 创建协议栈
|
||||
// 创建新的协议栈实例,配置网络层和传输层协议
|
||||
netstack_stack = stack.New(stack.Options{
|
||||
NetworkProtocols: []stack.NetworkProtocolFactory{ipv4.NewProtocol}, // 配置IPv4协议
|
||||
TransportProtocols: []stack.TransportProtocolFactory{tcp.NewProtocol}, // 配置TCP协议
|
||||
})
|
||||
|
||||
// 使用Open函数创建TUN设备,设备名称为"GoodLink",MTU为0表示使用系统默认值
|
||||
wintunEP, err := Open("GoodLink", 1400) //因为要加自定义的头,防止超出1500,造成不必要的性能损耗
|
||||
if err != nil {
|
||||
return fmt.Errorf("请管理员权限运行")
|
||||
}
|
||||
|
||||
SetWinTunIP(&wintunEP, "192.17.19.1", 32, "192.17.19.1", 32)
|
||||
|
||||
// 创建网络接口
|
||||
// 将TUN设备注册到协议栈中,使用NIC ID 1
|
||||
nicID := tcpip.NICID(1)
|
||||
if err := netstack_stack.CreateNIC(nicID, wintunEP); err != nil {
|
||||
return fmt.Errorf("设备注册: %v", err)
|
||||
}
|
||||
|
||||
SetNetStackIP(netstack_stack, nicID, "192.17.19.1", 32, "192.17.19.0", "255.255.255.0")
|
||||
|
||||
init_stack_suss = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetForWarder(stun_quic_conn quic.Connection) {
|
||||
// 设置TCP协议处理器
|
||||
netstack_stack.SetTransportProtocolHandler(tcp.ProtocolNumber, NewTcpForwarder(netstack_stack, stun_quic_conn).HandlePacket)
|
||||
}
|
||||
|
||||
func GetRemoteIP() string {
|
||||
return "192.17.19.1"
|
||||
}
|
42
netstack/sudo_windows.go
Normal file
42
netstack/sudo_windows.go
Normal file
@@ -0,0 +1,42 @@
|
||||
//go:build windows
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func Sudo() {
|
||||
// 获取当前进程的令牌
|
||||
var token windows.Token
|
||||
err := windows.OpenProcessToken(windows.CurrentProcess(), windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to open process token:", err)
|
||||
return
|
||||
}
|
||||
|
||||
// 定义LUID结构体
|
||||
var luid windows.LUID
|
||||
err = windows.LookupPrivilegeValue(nil, windows.StringToUTF16Ptr("SeDebugPrivilege"), &luid)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to lookup privilege value:", err)
|
||||
return
|
||||
}
|
||||
|
||||
// 创建TOKEN_PRIVILEGES结构体
|
||||
var tp windows.Tokenprivileges
|
||||
tp.PrivilegeCount = 1
|
||||
tp.Privileges[0].Luid = luid
|
||||
tp.Privileges[0].Attributes = windows.SE_PRIVILEGE_ENABLED
|
||||
|
||||
// 提升权限
|
||||
err = windows.AdjustTokenPrivileges(token, false, &tp, 0, nil, nil)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to adjust token privileges:", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Privilege escalation successful")
|
||||
}
|
117
netstack/svr.go
Normal file
117
netstack/svr.go
Normal file
@@ -0,0 +1,117 @@
|
||||
//go:build windows
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
||||
"gvisor.dev/gvisor/pkg/waiter"
|
||||
)
|
||||
|
||||
func handleConnection(ep tcpip.Endpoint, wq *waiter.Queue) {
|
||||
// 确保连接最终关闭
|
||||
defer ep.Close()
|
||||
|
||||
// 创建等待队列用于读取事件通知
|
||||
// var wq waiter.Queue
|
||||
|
||||
// 创建可读事件监听器(waiter.Entry)
|
||||
// EventIn: 当端点有数据可读时触发
|
||||
waitEntry, notifyCh := waiter.NewChannelEntry(waiter.EventIn)
|
||||
wq.EventRegister(&waitEntry)
|
||||
// 退出时自动取消事件注册
|
||||
defer wq.EventUnregister(&waitEntry)
|
||||
|
||||
// 连接处理主循环
|
||||
for {
|
||||
var buf bytes.Buffer
|
||||
// 尝试读取数据(非阻塞模式)
|
||||
_, err := ep.Read(&buf, tcpip.ReadOptions{})
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case *tcpip.ErrWouldBlock: // 处理暂时无数据的情况
|
||||
<-notifyCh // 等待可读事件通知
|
||||
continue
|
||||
case *tcpip.ErrNotConnected: // 处理连接关闭的情况
|
||||
log.Println("Connection closed") // 打印连接关闭信息
|
||||
return // 结束连接处理
|
||||
}
|
||||
log.Println(err) // 打印错误信息
|
||||
return // 其他错误直接返回
|
||||
}
|
||||
|
||||
// 回显数据:将接收到的数据原样写回
|
||||
var r bytes.Reader
|
||||
r.Reset(buf.Bytes()) // 将缓冲区数据载入读取器
|
||||
// 写入数据到TCP连接
|
||||
_, err = ep.Write(&r, tcpip.WriteOptions{})
|
||||
if err != nil {
|
||||
return // 写入失败时结束连接
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func startTCPServer(s *stack.Stack) {
|
||||
// 创建事件等待队列(用于异步I/O通知)
|
||||
var wq waiter.Queue
|
||||
|
||||
// 创建TCP端点(相当于socket)
|
||||
// 参数说明:
|
||||
// - tcp.ProtocolNumber: TCP协议号(6)
|
||||
// - ipv4.ProtocolNumber: IPv4协议号(0x0800)
|
||||
// - &wq: 关联的等待队列
|
||||
ep, err := s.NewEndpoint(tcp.ProtocolNumber, ipv4.ProtocolNumber, &wq)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// 绑定到指定网络接口(NIC 1)和端口
|
||||
// NIC: 网络接口控制器编号(虚拟网卡)
|
||||
if err := ep.Bind(tcpip.FullAddress{
|
||||
NIC: 1,
|
||||
// Addr: tcpip.AddrFromSlice(net.ParseIP("192.168.3.3").To4()),
|
||||
Addr: tcpip.Address{}, // 零值表示所有IP地址
|
||||
Port: 80,
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// 启动监听,设置最大等待连接队列长度
|
||||
if err := ep.Listen(10); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// 持续接受新连接的循环
|
||||
for {
|
||||
var addr tcpip.FullAddress
|
||||
// 非阻塞式接受连接
|
||||
newEP, waitq, err := ep.Accept(&addr)
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case *tcpip.ErrWouldBlock: // 处理暂时无连接的情况
|
||||
// 注册读事件监听
|
||||
waitEntry, notifyCh := waiter.NewChannelEntry(waiter.EventIn)
|
||||
wq.EventRegister(&waitEntry)
|
||||
// 阻塞等待直到新连接到达
|
||||
<-notifyCh
|
||||
wq.EventUnregister(&waitEntry)
|
||||
continue
|
||||
case *tcpip.ErrInvalidEndpointState: // 处理端点状态错误
|
||||
continue
|
||||
default:
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Accepted connection from %s:%d\n", addr.Addr, addr.Port)
|
||||
|
||||
// 获取新连接的端点
|
||||
go handleConnection(newEP, waitq) // 传递正确的连接端点
|
||||
}
|
||||
}
|
80
netstack/tcp.go
Normal file
80
netstack/tcp.go
Normal file
@@ -0,0 +1,80 @@
|
||||
//go:build windows
|
||||
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
const (
|
||||
// defaultWndSize 如果设置为零,则使用默认的接收窗口缓冲区大小
|
||||
defaultWndSize = 0
|
||||
|
||||
// maxConnAttempts 指定最大并发TCP连接尝试数
|
||||
maxConnAttempts = 2 << 10
|
||||
|
||||
// tcpKeepaliveCount 在放弃并关闭连接之前发送的最大TCP保活探测次数
|
||||
// 如果在另一端没有收到响应
|
||||
tcpKeepaliveCount = 9
|
||||
|
||||
// tcpKeepaliveIdle 指定在发送第一个TCP保活数据包之前连接必须保持空闲的时间
|
||||
// 一旦达到这个时间,就使用tcpKeepaliveInterval选项
|
||||
tcpKeepaliveIdle = 60 * time.Second
|
||||
|
||||
// tcpKeepaliveInterval 指定发送TCP保活数据包之间的间隔时间
|
||||
tcpKeepaliveInterval = 30 * time.Second
|
||||
)
|
||||
|
||||
// setSocketOptions 设置TCP套接字选项
|
||||
func setSocketOptions(s *stack.Stack, ep tcpip.Endpoint) tcpip.Error {
|
||||
{ /* TCP保活选项 */
|
||||
ep.SocketOptions().SetKeepAlive(true)
|
||||
|
||||
// 设置保活空闲时间
|
||||
idle := tcpip.KeepaliveIdleOption(tcpKeepaliveIdle)
|
||||
if err := ep.SetSockOpt(&idle); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 设置保活探测间隔
|
||||
interval := tcpip.KeepaliveIntervalOption(tcpKeepaliveInterval)
|
||||
if err := ep.SetSockOpt(&interval); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 设置保活探测次数
|
||||
if err := ep.SetSockOptInt(tcpip.KeepaliveCountOption, tcpKeepaliveCount); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
{ /* TCP接收/发送缓冲区大小 */
|
||||
// 设置发送缓冲区大小
|
||||
var ss tcpip.TCPSendBufferSizeRangeOption
|
||||
if err := s.TransportProtocolOption(header.TCPProtocolNumber, &ss); err == nil {
|
||||
ep.SocketOptions().SetSendBufferSize(int64(ss.Default), false)
|
||||
}
|
||||
|
||||
// 设置接收缓冲区大小
|
||||
var rs tcpip.TCPReceiveBufferSizeRangeOption
|
||||
if err := s.TransportProtocolOption(header.TCPProtocolNumber, &rs); err == nil {
|
||||
ep.SocketOptions().SetReceiveBufferSize(int64(rs.Default), false)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// tcpConn 实现了TCP连接接口
|
||||
type TcpConn struct {
|
||||
*gonet.TCPConn
|
||||
id stack.TransportEndpointID
|
||||
}
|
||||
|
||||
// ID 返回连接的传输端点ID
|
||||
func (c *TcpConn) ID() *stack.TransportEndpointID {
|
||||
return &c.id
|
||||
}
|
166
netstack/tun_wireguard.go
Normal file
166
netstack/tun_wireguard.go
Normal file
@@ -0,0 +1,166 @@
|
||||
//go:build windows
|
||||
|
||||
// Package netstack 提供了基于 WireGuard TUN 设备的网络栈实现
|
||||
// 该包实现了虚拟网络接口,允许在用户空间处理网络数据包
|
||||
// 主要用于实现 VPN 和网络代理功能
|
||||
package netstack
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"golang.zx2c4.com/wireguard/tun"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
// Device is the interface that implemented by network layer devices (e.g. tun),
|
||||
// and easy to use as stack.LinkEndpoint.
|
||||
type Device interface {
|
||||
stack.LinkEndpoint
|
||||
|
||||
// Name returns the current name of the device.
|
||||
Name() string
|
||||
|
||||
// Type returns the driver type of the device.
|
||||
Type() string
|
||||
}
|
||||
|
||||
// 常量定义
|
||||
const (
|
||||
offset = 0 // 数据包偏移量,用于处理TUN_PI头,0表示不使用TUN_PI
|
||||
defaultMTU = 0 // 默认MTU值,0表示使用系统自动配置的MTU
|
||||
)
|
||||
|
||||
// TUN 结构体实现了 TUN 设备的核心功能
|
||||
// 它封装了 WireGuard 的 TUN 接口和基本的 I/O 操作
|
||||
// 该结构体实现了 Device 接口,提供了与网络栈交互的能力
|
||||
type TUN struct {
|
||||
*Endpoint // 嵌入Endpoint接口,提供网络栈接口功能,实现数据包的收发
|
||||
|
||||
nt *tun.NativeTun // 原生的 TUN 设备接口,用于与系统TUN设备交互
|
||||
mtu uint32 // 最大传输单元,限制单个数据包的最大大小
|
||||
name string // TUN 设备名称,用于系统识别
|
||||
offset int // 数据包偏移量,用于处理TUN_PI头
|
||||
|
||||
rSizes []int // 读取数据包大小数组,用于存储每个数据包的实际大小
|
||||
rBuffs [][]byte // 读取缓冲区数组,用于存储接收到的数据包
|
||||
wBuffs [][]byte // 写入缓冲区数组,用于存储待发送的数据包
|
||||
rMutex sync.Mutex // 读取互斥锁,保护并发读取操作
|
||||
wMutex sync.Mutex // 写入互斥锁,保护并发写入操作
|
||||
}
|
||||
|
||||
// Open 创建一个新的 TUN 设备
|
||||
// 该函数负责初始化TUN设备,设置MTU,并创建必要的端点
|
||||
// 参数:
|
||||
// - name: TUN 设备名称,用于系统识别
|
||||
// - mtu: 最大传输单元大小,如果为 0 则使用系统默认值
|
||||
//
|
||||
// 返回:
|
||||
// - Device: 实现了Device接口的TUN设备
|
||||
// - error: 创建过程中的错误信息
|
||||
func Open(name string, mtu uint32) (_ Device, err error) {
|
||||
// 使用defer和recover处理可能的panic,确保错误被正确捕获和包装
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = fmt.Errorf("open tun: %v", r)
|
||||
}
|
||||
}()
|
||||
|
||||
// 初始化 TUN 结构体,设置基本参数
|
||||
t := &TUN{
|
||||
name: name, // 设置设备名称
|
||||
mtu: mtu, // 设置MTU值
|
||||
offset: offset, // 设置数据包偏移量
|
||||
rSizes: make([]int, 1), // 初始化大小为1的数组,用于存储单个数据包大小
|
||||
rBuffs: make([][]byte, 1), // 初始化大小为1的数组,用于存储单个接收缓冲区
|
||||
wBuffs: make([][]byte, 1), // 初始化大小为1的数组,用于存储单个发送缓冲区
|
||||
}
|
||||
|
||||
// 设置 MTU,如果指定了MTU则使用指定值,否则使用系统默认值
|
||||
forcedMTU := defaultMTU
|
||||
if t.mtu > 0 {
|
||||
forcedMTU = int(t.mtu)
|
||||
}
|
||||
|
||||
// 创建 TUN 设备,使用WireGuard的tun包创建原生TUN接口
|
||||
nt, err := tun.CreateTUN(t.name, forcedMTU)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create tun: %w", err)
|
||||
}
|
||||
t.nt = nt.(*tun.NativeTun) // 类型断言,确保使用NativeTun实现
|
||||
|
||||
// 获取实际的 MTU 值,从系统获取TUN设备的实际MTU
|
||||
tunMTU, err := nt.MTU()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("get mtu: %w", err)
|
||||
}
|
||||
t.mtu = uint32(tunMTU) // 更新为系统实际的MTU值
|
||||
|
||||
// 创建 I/O 端点,用于处理数据包的收发
|
||||
ep, err := NewEndpoint(t, t.mtu, offset)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create endpoint: %w", err)
|
||||
}
|
||||
t.Endpoint = ep // 设置端点,使TUN设备能够与网络栈交互
|
||||
|
||||
return t, nil
|
||||
}
|
||||
|
||||
// Read 从 TUN 设备读取数据包
|
||||
// 该方法实现了io.Reader接口,用于从TUN设备读取网络数据包
|
||||
// 参数:
|
||||
// - packet: 用于存储读取到的数据包的缓冲区
|
||||
//
|
||||
// 返回:
|
||||
// - int: 读取的字节数
|
||||
// - error: 读取过程中的错误信息
|
||||
func (t *TUN) Read(packet []byte) (int, error) {
|
||||
t.rMutex.Lock() // 加锁保护并发读取
|
||||
defer t.rMutex.Unlock()
|
||||
t.rBuffs[0] = packet // 设置接收缓冲区,将传入的缓冲区设置为读取目标
|
||||
_, err := t.nt.Read(t.rBuffs, t.rSizes, t.offset) // 从TUN设备读取数据,rSizes[0]将被设置为实际读取的字节数
|
||||
return t.rSizes[0], err // 返回读取的字节数和错误
|
||||
}
|
||||
|
||||
// Name 返回 TUN 设备的名称
|
||||
// 该方法实现了Device接口的Name方法
|
||||
// 返回:
|
||||
// - string: TUN设备的名称
|
||||
func (t *TUN) Name() string {
|
||||
name, _ := t.nt.Name() // 忽略错误,因为设备名称获取失败不影响主要功能
|
||||
return name
|
||||
}
|
||||
|
||||
// Close 关闭 TUN 设备
|
||||
// 该方法负责清理资源,确保TUN设备和相关端点被正确关闭
|
||||
func (t *TUN) Close() {
|
||||
defer t.Endpoint.Close() // 确保端点被正确关闭,使用defer确保即使后续操作失败也能关闭端点
|
||||
t.nt.Close() // 关闭TUN设备
|
||||
}
|
||||
|
||||
// Write 向 TUN 设备写入数据包
|
||||
// 该方法实现了io.Writer接口,用于向TUN设备写入网络数据包
|
||||
// 参数:
|
||||
// - packet: 要发送的数据包
|
||||
//
|
||||
// 返回:
|
||||
// - int: 写入的字节数
|
||||
// - error: 写入过程中的错误信息
|
||||
func (t *TUN) Write(packet []byte) (int, error) {
|
||||
t.wMutex.Lock() // 加锁保护并发写入
|
||||
defer t.wMutex.Unlock()
|
||||
t.wBuffs[0] = packet // 设置发送缓冲区,将待发送的数据包放入缓冲区
|
||||
return t.nt.Write(t.wBuffs, t.offset) // 向TUN设备写入数据,offset用于处理TUN_PI头
|
||||
}
|
||||
|
||||
// Type 返回设备类型,用于标识这是一个TUN设备
|
||||
// 该方法实现了Device接口的Type方法
|
||||
// 返回:
|
||||
// - string: 设备类型标识符
|
||||
func (t *TUN) Type() string {
|
||||
return "tun" // 返回固定的设备类型标识符
|
||||
}
|
||||
|
||||
func (t *TUN) GetNt() *tun.NativeTun {
|
||||
return t.nt
|
||||
}
|
40
pro/local.go
40
pro/local.go
@@ -2,10 +2,9 @@ package pro
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"goodlink/config"
|
||||
"goodlink/md5"
|
||||
"goodlink/proxy"
|
||||
"goodlink/netstack"
|
||||
"goodlink/utils"
|
||||
"goodlink2/tun"
|
||||
"log"
|
||||
@@ -20,7 +19,7 @@ var (
|
||||
m_local_state = 0 //0: 停止, 1: 启动, 2: 连接成功
|
||||
)
|
||||
|
||||
func GetLocalQuicConn(conn *net.UDPConn, addr *tun.AddrType, conn_type2 int, count int) (*tun.TunActive, *tun.TunPassive, quic.Connection, quic.Stream, error) {
|
||||
func GetLocalQuicConn(conn *net.UDPConn, addr *tun.AddrType, count int) (*tun.TunActive, *tun.TunPassive, quic.Connection, quic.Stream, error) {
|
||||
var tun_active *tun.TunActive
|
||||
var tun_passive *tun.TunPassive
|
||||
|
||||
@@ -148,22 +147,9 @@ func StopLocal() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func RunLocal(conn_type int, tun_local_addr string, tun_key string) error {
|
||||
func RunLocal(tun_key string) error {
|
||||
m_local_state = 1
|
||||
|
||||
utils.Log().DebugF("绑定端口: %v", tun_local_addr)
|
||||
|
||||
chain := make(chan int, 1)
|
||||
|
||||
listener, err := net.Listen("tcp", tun_local_addr)
|
||||
if listener == nil || err != nil {
|
||||
return fmt.Errorf("绑定端口失败: %v", tun_local_addr)
|
||||
}
|
||||
defer func() {
|
||||
listener.Close()
|
||||
close(chain)
|
||||
}()
|
||||
|
||||
m_tun_key = tun_key
|
||||
m_md5_tun_key = md5.Encode(tun_key)
|
||||
|
||||
@@ -172,6 +158,10 @@ func RunLocal(conn_type int, tun_local_addr string, tun_key string) error {
|
||||
var udp_conn *net.UDPConn
|
||||
var addr tun.AddrType
|
||||
|
||||
if err := netstack.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for m_local_state == 1 {
|
||||
|
||||
if udp_conn != nil {
|
||||
@@ -183,7 +173,7 @@ func RunLocal(conn_type int, tun_local_addr string, tun_key string) error {
|
||||
|
||||
count++
|
||||
|
||||
tun_active, tun_passive, quic_conn, health, err := GetLocalQuicConn(udp_conn, &addr, conn_type, count)
|
||||
tun_active, tun_passive, quic_conn, health, err := GetLocalQuicConn(udp_conn, &addr, count)
|
||||
if err != nil {
|
||||
Release(tun_active, tun_passive)
|
||||
return err
|
||||
@@ -196,10 +186,9 @@ func RunLocal(conn_type int, tun_local_addr string, tun_key string) error {
|
||||
m_tun_active = tun_active
|
||||
m_tun_passive = tun_passive
|
||||
|
||||
go func() {
|
||||
proxy.ProcessProxyClient(listener, quic_conn)
|
||||
chain <- 1
|
||||
}()
|
||||
netstack.SetForWarder(quic_conn)
|
||||
utils.Log().DebugF("对端IP: %s", netstack.GetRemoteIP())
|
||||
log.Printf("对端IP: %s", netstack.GetRemoteIP())
|
||||
|
||||
m_local_state = 2
|
||||
tun.ProcessHealth(health)
|
||||
@@ -209,12 +198,7 @@ func RunLocal(conn_type int, tun_local_addr string, tun_key string) error {
|
||||
utils.Log().DebugF("释放连接: %v", quic_conn.LocalAddr())
|
||||
Release(tun_active, tun_passive)
|
||||
|
||||
if tcp_client_conn, err := net.Dial("tcp", tun_local_addr); tcp_client_conn != nil && err == nil {
|
||||
tcp_client_conn.Write([]byte("hello"))
|
||||
tcp_client_conn.Close() // 关闭连接
|
||||
}
|
||||
|
||||
<-chain
|
||||
netstack.SetForWarder(nil)
|
||||
count = 0
|
||||
}
|
||||
|
||||
|
@@ -207,7 +207,7 @@ func StopRemote() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func RunRemote(remote_addr string, tun_key string) error {
|
||||
func RunRemote(tun_key string) error {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
tun_active_list = make([]*tun.TunActive, 0)
|
||||
@@ -240,7 +240,7 @@ func RunRemote(remote_addr string, tun_key string) error {
|
||||
lock_remote.Unlock()
|
||||
|
||||
wg.Add(1)
|
||||
go func(tun_active2 *tun.TunActive, tun_passive2 *tun.TunPassive, remote_addr2 string, quic_conn2 quic.Connection) {
|
||||
go func(tun_active2 *tun.TunActive, tun_passive2 *tun.TunPassive, quic_conn2 quic.Connection) {
|
||||
defer func() {
|
||||
Release(tun_active2, tun_passive2)
|
||||
wg.Done()
|
||||
@@ -249,13 +249,12 @@ func RunRemote(remote_addr string, tun_key string) error {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
proxy.ProcessProxyServer(remote_addr2, quic_conn2)
|
||||
proxy.ProcessProxyServer(quic_conn2)
|
||||
}()
|
||||
|
||||
tun.ProcessHealth(health)
|
||||
utils.Log().DebugF("释放连接: %v", quic_conn2.LocalAddr())
|
||||
}(tun_active, tun_passive, remote_addr, quic_conn)
|
||||
|
||||
}(tun_active, tun_passive, quic_conn)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/quic-go/quic-go"
|
||||
)
|
||||
|
||||
func stunT2QProcess1(tc net.Conn, qc quic.Stream, stun_quic_conn quic.Connection) {
|
||||
func ForwardT2Q(tc net.Conn, qc quic.Stream, stun_quic_conn quic.Connection) {
|
||||
buf := pool.Malloc(1500)
|
||||
|
||||
defer func() {
|
||||
@@ -20,7 +20,7 @@ func stunT2QProcess1(tc net.Conn, qc quic.Stream, stun_quic_conn quic.Connection
|
||||
io.CopyBuffer(tc, qc, buf)
|
||||
}
|
||||
|
||||
func stunQ2TProcess1(qc quic.Stream, tc net.Conn, stun_quic_conn quic.Connection) {
|
||||
func ForwardQ2T(qc quic.Stream, tc net.Conn, stun_quic_conn quic.Connection) {
|
||||
buf := pool.Malloc(1500)
|
||||
|
||||
defer func() {
|
||||
|
@@ -16,8 +16,8 @@ func ProcessProxyClient(listener net.Listener, stun_quic_conn quic.Connection) {
|
||||
if err == nil {
|
||||
new_quic_stream, err := stun_quic_conn.OpenStreamSync(context.Background())
|
||||
if err == nil {
|
||||
go stunT2QProcess1(new_tcp_conn, new_quic_stream, stun_quic_conn)
|
||||
go stunQ2TProcess1(new_quic_stream, new_tcp_conn, stun_quic_conn)
|
||||
go ForwardT2Q(new_tcp_conn, new_quic_stream, stun_quic_conn)
|
||||
go ForwardQ2T(new_quic_stream, new_tcp_conn, stun_quic_conn)
|
||||
continue
|
||||
}
|
||||
break
|
||||
|
@@ -2,6 +2,9 @@ package proxy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
pool2 "goodlink/pool"
|
||||
"goodlink/socks5"
|
||||
"goodlink/utils"
|
||||
"log"
|
||||
@@ -19,8 +22,8 @@ func ProcessProxyServer_Quic(remote_addr string, stun_quic_conn quic.Connection)
|
||||
if err == nil {
|
||||
new_tcp_conn, err := net.Dial("tcp", remote_addr)
|
||||
if err == nil {
|
||||
go stunT2QProcess1(new_tcp_conn, new_quic_stream, stun_quic_conn)
|
||||
go stunQ2TProcess1(new_quic_stream, new_tcp_conn, stun_quic_conn)
|
||||
go ForwardT2Q(new_tcp_conn, new_quic_stream, stun_quic_conn)
|
||||
go ForwardQ2T(new_quic_stream, new_tcp_conn, stun_quic_conn)
|
||||
continue
|
||||
}
|
||||
break
|
||||
@@ -50,7 +53,45 @@ func ProcessProxyServer_Socks5(remote_addr string, stun_quic_conn quic.Connectio
|
||||
}
|
||||
}
|
||||
|
||||
func ProcessProxyServer(remote_addr string, stun_quic_conn quic.Connection) {
|
||||
func ProcessProxyServer(stun_quic_conn quic.Connection) {
|
||||
buf := pool2.Malloc(1500)
|
||||
defer pool2.Free(buf)
|
||||
|
||||
for {
|
||||
fewfgwegwe:
|
||||
new_quic_stream, err := stun_quic_conn.AcceptStream(context.Background())
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
head_len := 2
|
||||
buf_len := 0
|
||||
for buf_len < head_len {
|
||||
log.Printf("读取头部: %d/%d", buf_len, head_len)
|
||||
buf_len2, err := new_quic_stream.Read(buf[buf_len:])
|
||||
if err != nil {
|
||||
log.Println("读取头部失败", err)
|
||||
new_quic_stream.Close()
|
||||
goto fewfgwegwe
|
||||
}
|
||||
buf_len += buf_len2
|
||||
}
|
||||
remotePort := binary.BigEndian.Uint16(buf[:head_len])
|
||||
remoteAddr := fmt.Sprintf("127.0.0.1:%d", remotePort)
|
||||
log.Printf("转发地址: %s", remoteAddr)
|
||||
new_tcp_conn, err := net.Dial("tcp", remoteAddr)
|
||||
if err == nil {
|
||||
if buf_len > head_len {
|
||||
new_tcp_conn.Write(buf[head_len:buf_len])
|
||||
}
|
||||
go ForwardT2Q(new_tcp_conn, new_quic_stream, stun_quic_conn)
|
||||
go ForwardQ2T(new_quic_stream, new_tcp_conn, stun_quic_conn)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ProcessProxyServer2(remote_addr string, stun_quic_conn quic.Connection) {
|
||||
if stun_quic_conn == nil {
|
||||
log.Println(" 隧道建立失败!")
|
||||
return
|
||||
|
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
@@ -53,9 +52,9 @@ func (c *LocalUI) GetLocalAddr() (string, error) {
|
||||
|
||||
func (c *LocalUI) GetContainer() *fyne.Container {
|
||||
return container.NewVBox(
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("连接方式: "), c.radio_conn_type),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("访问权限: "), c.radio1),
|
||||
container.New(layout.NewFormLayout(), widget.NewRichTextWithText("访问端口: "), c.box_local_port),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("连接方式: "), c.radio_conn_type),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("访问权限: "), c.radio1),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("访问端口: "), c.box_local_port),
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
@@ -53,9 +52,9 @@ func (c *RemoteUI) GetRemoteAddr() (string, error) {
|
||||
|
||||
func (c *RemoteUI) GetContainer() *fyne.Container {
|
||||
return container.NewVBox(
|
||||
container.New(layout.NewFormLayout(), widget.NewRichTextWithText("工作模式: "), c.radio),
|
||||
container.New(layout.NewFormLayout(), widget.NewRichTextWithText("转发目标地址: "), c.box_remote_ip),
|
||||
container.New(layout.NewFormLayout(), widget.NewRichTextWithText("转发目标端口: "), c.box_remote_port),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("工作模式: "), c.radio),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("转发目标地址: "), c.box_remote_ip),
|
||||
//container.New(layout.NewFormLayout(), widget.NewRichTextWithText("转发目标端口: "), c.box_remote_port),
|
||||
)
|
||||
}
|
||||
|
||||
|
16
ui2/start.go
16
ui2/start.go
@@ -55,9 +55,6 @@ func start_button_click() {
|
||||
m_lock_start.Lock()
|
||||
defer m_lock_start.Unlock()
|
||||
|
||||
var err error
|
||||
var remote_addr string
|
||||
|
||||
//先对需要填写的数据进行校验
|
||||
switch m_stats_start_button {
|
||||
case 0:
|
||||
@@ -68,18 +65,13 @@ func start_button_click() {
|
||||
switch m_radio_work_type.Selected {
|
||||
case "Local":
|
||||
if m_ui_local.GetLocalPort() == "" {
|
||||
SetLogLabel("请填写访问端口号")
|
||||
return
|
||||
//SetLogLabel("请填写访问端口号")
|
||||
//return
|
||||
}
|
||||
case "Remote":
|
||||
switch m_ui_remote.GetRemoteType() {
|
||||
case "代理模式":
|
||||
remote_addr = "" //代理模式, 这里必须设置为空
|
||||
case "转发模式":
|
||||
if remote_addr, err = m_ui_remote.GetRemoteAddr(); err != nil {
|
||||
SetLogLabel(err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +134,7 @@ func start_button_click() {
|
||||
m_mg_start.Add(1)
|
||||
go func() {
|
||||
defer m_mg_start.Done()
|
||||
if err := pro.RunLocal(m_ui_local.GetConnType(), "0.0.0.0:"+m_ui_local.GetLocalPort(), m_validated_key.Text); err != nil {
|
||||
if err := pro.RunLocal(m_validated_key.Text); err != nil {
|
||||
SetLogLabel(err.Error())
|
||||
}
|
||||
m_stats_start_button = 0
|
||||
@@ -168,7 +160,7 @@ func start_button_click() {
|
||||
m_mg_start.Add(1)
|
||||
go func() {
|
||||
defer m_mg_start.Done()
|
||||
if err := pro.RunRemote(remote_addr, m_validated_key.Text); err != nil {
|
||||
if err := pro.RunRemote(m_validated_key.Text); err != nil {
|
||||
SetLogLabel(err.Error())
|
||||
}
|
||||
m_stats_start_button = 0
|
||||
|
384
winipcfg/luid.go
Normal file
384
winipcfg/luid.go
Normal file
@@ -0,0 +1,384 @@
|
||||
//go:build windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/netip"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// LUID represents a network interface.
|
||||
type LUID uint64
|
||||
|
||||
// IPInterface method retrieves IP information for the specified interface on the local computer.
|
||||
func (luid LUID) IPInterface(family AddressFamily) (*MibIPInterfaceRow, error) {
|
||||
row := &MibIPInterfaceRow{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
row.Family = family
|
||||
err := row.get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return row, nil
|
||||
}
|
||||
|
||||
// Interface method retrieves information for the specified adapter on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getifentry2
|
||||
func (luid LUID) Interface() (*MibIfRow2, error) {
|
||||
row := &MibIfRow2{}
|
||||
row.InterfaceLUID = luid
|
||||
err := row.get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return row, nil
|
||||
}
|
||||
|
||||
// GUID method converts a locally unique identifier (LUID) for a network interface to a globally unique identifier (GUID) for the interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-convertinterfaceluidtoguid
|
||||
func (luid LUID) GUID() (*windows.GUID, error) {
|
||||
guid := &windows.GUID{}
|
||||
err := convertInterfaceLUIDToGUID(&luid, guid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return guid, nil
|
||||
}
|
||||
|
||||
// LUIDFromGUID function converts a globally unique identifier (GUID) for a network interface to the locally unique identifier (LUID) for the interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-convertinterfaceguidtoluid
|
||||
func LUIDFromGUID(guid *windows.GUID) (LUID, error) {
|
||||
var luid LUID
|
||||
err := convertInterfaceGUIDToLUID(guid, &luid)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return luid, nil
|
||||
}
|
||||
|
||||
// LUIDFromIndex function converts a local index for a network interface to the locally unique identifier (LUID) for the interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-convertinterfaceindextoluid
|
||||
func LUIDFromIndex(index uint32) (LUID, error) {
|
||||
var luid LUID
|
||||
err := convertInterfaceIndexToLUID(index, &luid)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return luid, nil
|
||||
}
|
||||
|
||||
// IPAddress method returns MibUnicastIPAddressRow struct that matches to provided 'ip' argument. Corresponds to GetUnicastIpAddressEntry
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getunicastipaddressentry)
|
||||
func (luid LUID) IPAddress(addr netip.Addr) (*MibUnicastIPAddressRow, error) {
|
||||
row := &MibUnicastIPAddressRow{InterfaceLUID: luid}
|
||||
|
||||
err := row.Address.SetAddr(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = row.get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return row, nil
|
||||
}
|
||||
|
||||
// AddIPAddress method adds new unicast IP address to the interface. Corresponds to CreateUnicastIpAddressEntry function
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-createunicastipaddressentry).
|
||||
func (luid LUID) AddIPAddress(address netip.Prefix) error {
|
||||
row := &MibUnicastIPAddressRow{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
row.DadState = DadStatePreferred
|
||||
row.ValidLifetime = 0xffffffff
|
||||
row.PreferredLifetime = 0xffffffff
|
||||
err := row.Address.SetAddr(address.Addr())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
row.OnLinkPrefixLength = uint8(address.Bits())
|
||||
return row.Create()
|
||||
}
|
||||
|
||||
// AddIPAddresses method adds multiple new unicast IP addresses to the interface. Corresponds to CreateUnicastIpAddressEntry function
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-createunicastipaddressentry).
|
||||
func (luid LUID) AddIPAddresses(addresses []netip.Prefix) error {
|
||||
for i := range addresses {
|
||||
err := luid.AddIPAddress(addresses[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetIPAddresses method sets new unicast IP addresses to the interface.
|
||||
func (luid LUID) SetIPAddresses(addresses []netip.Prefix) error {
|
||||
err := luid.FlushIPAddresses(windows.AF_UNSPEC)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return luid.AddIPAddresses(addresses)
|
||||
}
|
||||
|
||||
// SetIPAddressesForFamily method sets new unicast IP addresses for a specific family to the interface.
|
||||
func (luid LUID) SetIPAddressesForFamily(family AddressFamily, addresses []netip.Prefix) error {
|
||||
err := luid.FlushIPAddresses(family)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for i := range addresses {
|
||||
if !addresses[i].Addr().Is4() && family == windows.AF_INET {
|
||||
continue
|
||||
} else if !addresses[i].Addr().Is6() && family == windows.AF_INET6 {
|
||||
continue
|
||||
}
|
||||
err := luid.AddIPAddress(addresses[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteIPAddress method deletes interface's unicast IP address. Corresponds to DeleteUnicastIpAddressEntry function
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-deleteunicastipaddressentry).
|
||||
func (luid LUID) DeleteIPAddress(address netip.Prefix) error {
|
||||
row := &MibUnicastIPAddressRow{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
err := row.Address.SetAddr(address.Addr())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Note: OnLinkPrefixLength member is ignored by DeleteUnicastIpAddressEntry().
|
||||
row.OnLinkPrefixLength = uint8(address.Bits())
|
||||
return row.Delete()
|
||||
}
|
||||
|
||||
// FlushIPAddresses method deletes all interface's unicast IP addresses.
|
||||
func (luid LUID) FlushIPAddresses(family AddressFamily) error {
|
||||
var tab *mibUnicastIPAddressTable
|
||||
err := getUnicastIPAddressTable(family, &tab)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t := tab.get()
|
||||
for i := range t {
|
||||
if t[i].InterfaceLUID == luid {
|
||||
t[i].Delete()
|
||||
}
|
||||
}
|
||||
tab.free()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Route method returns route determined with the input arguments. Corresponds to GetIpForwardEntry2 function
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipforwardentry2).
|
||||
// NOTE: If the corresponding route isn't found, the method will return error.
|
||||
func (luid LUID) Route(destination netip.Prefix, nextHop netip.Addr) (*MibIPforwardRow2, error) {
|
||||
row := &MibIPforwardRow2{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
row.ValidLifetime = 0xffffffff
|
||||
row.PreferredLifetime = 0xffffffff
|
||||
err := row.DestinationPrefix.SetPrefix(destination)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = row.NextHop.SetAddr(nextHop)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = row.get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return row, nil
|
||||
}
|
||||
|
||||
// AddRoute method adds a route to the interface. Corresponds to CreateIpForwardEntry2 function, with added splitDefault feature.
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-createipforwardentry2)
|
||||
func (luid LUID) AddRoute(destination netip.Prefix, nextHop netip.Addr, metric uint32) error {
|
||||
row := &MibIPforwardRow2{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
err := row.DestinationPrefix.SetPrefix(destination)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = row.NextHop.SetAddr(nextHop)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
row.Metric = metric
|
||||
return row.Create()
|
||||
}
|
||||
|
||||
// AddRoutes method adds multiple routes to the interface.
|
||||
func (luid LUID) AddRoutes(routesData []*RouteData) error {
|
||||
for _, rd := range routesData {
|
||||
err := luid.AddRoute(rd.Destination, rd.NextHop, rd.Metric)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetRoutes method sets (flush than add) multiple routes to the interface.
|
||||
func (luid LUID) SetRoutes(routesData []*RouteData) error {
|
||||
err := luid.FlushRoutes(windows.AF_UNSPEC)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return luid.AddRoutes(routesData)
|
||||
}
|
||||
|
||||
// SetRoutesForFamily method sets (flush than add) multiple routes for a specific family to the interface.
|
||||
func (luid LUID) SetRoutesForFamily(family AddressFamily, routesData []*RouteData) error {
|
||||
err := luid.FlushRoutes(family)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, rd := range routesData {
|
||||
if !rd.Destination.Addr().Is4() && family == windows.AF_INET {
|
||||
continue
|
||||
} else if !rd.Destination.Addr().Is6() && family == windows.AF_INET6 {
|
||||
continue
|
||||
}
|
||||
err := luid.AddRoute(rd.Destination, rd.NextHop, rd.Metric)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteRoute method deletes a route that matches the criteria. Corresponds to DeleteIpForwardEntry2 function
|
||||
// (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-deleteipforwardentry2).
|
||||
func (luid LUID) DeleteRoute(destination netip.Prefix, nextHop netip.Addr) error {
|
||||
row := &MibIPforwardRow2{}
|
||||
row.Init()
|
||||
row.InterfaceLUID = luid
|
||||
err := row.DestinationPrefix.SetPrefix(destination)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = row.NextHop.SetAddr(nextHop)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = row.get()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return row.Delete()
|
||||
}
|
||||
|
||||
// FlushRoutes method deletes all interface's routes.
|
||||
// It continues on failures, and returns the last error afterwards.
|
||||
func (luid LUID) FlushRoutes(family AddressFamily) error {
|
||||
var tab *mibIPforwardTable2
|
||||
err := getIPForwardTable2(family, &tab)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t := tab.get()
|
||||
for i := range t {
|
||||
if t[i].InterfaceLUID == luid {
|
||||
err2 := t[i].Delete()
|
||||
if err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
}
|
||||
}
|
||||
tab.free()
|
||||
return err
|
||||
}
|
||||
|
||||
// DNS method returns all DNS server addresses associated with the adapter.
|
||||
func (luid LUID) DNS() ([]netip.Addr, error) {
|
||||
addresses, err := GetAdaptersAddresses(windows.AF_UNSPEC, GAAFlagDefault)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r := make([]netip.Addr, 0, len(addresses))
|
||||
for _, addr := range addresses {
|
||||
if addr.LUID == luid {
|
||||
for dns := addr.FirstDNSServerAddress; dns != nil; dns = dns.Next {
|
||||
if ip := dns.Address.IP(); ip != nil {
|
||||
if a, ok := netip.AddrFromSlice(ip); ok {
|
||||
r = append(r, a)
|
||||
}
|
||||
} else {
|
||||
return nil, windows.ERROR_INVALID_PARAMETER
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
// SetDNS method clears previous and associates new DNS servers and search domains with the adapter for a specific family.
|
||||
func (luid LUID) SetDNS(family AddressFamily, servers []netip.Addr, domains []string) error {
|
||||
if family != windows.AF_INET && family != windows.AF_INET6 {
|
||||
return windows.ERROR_PROTOCOL_UNREACHABLE
|
||||
}
|
||||
|
||||
var filteredServers []string
|
||||
for _, server := range servers {
|
||||
if (server.Is4() && family == windows.AF_INET) || (server.Is6() && family == windows.AF_INET6) {
|
||||
filteredServers = append(filteredServers, server.String())
|
||||
}
|
||||
}
|
||||
servers16, err := windows.UTF16PtrFromString(strings.Join(filteredServers, ","))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
domains16, err := windows.UTF16PtrFromString(strings.Join(domains, ","))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
guid, err := luid.GUID()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dnsInterfaceSettings := &DnsInterfaceSettings{
|
||||
Version: DnsInterfaceSettingsVersion1,
|
||||
Flags: DnsInterfaceSettingsFlagNameserver | DnsInterfaceSettingsFlagSearchList,
|
||||
NameServer: servers16,
|
||||
SearchList: domains16,
|
||||
}
|
||||
if family == windows.AF_INET6 {
|
||||
dnsInterfaceSettings.Flags |= DnsInterfaceSettingsFlagIPv6
|
||||
}
|
||||
// For >= Windows 10 1809
|
||||
err = SetInterfaceDnsSettings(*guid, dnsInterfaceSettings)
|
||||
if err == nil || !errors.Is(err, windows.ERROR_PROC_NOT_FOUND) {
|
||||
return err
|
||||
}
|
||||
|
||||
// For < Windows 10 1809
|
||||
err = luid.fallbackSetDNSForFamily(family, servers)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(domains) > 0 {
|
||||
return luid.fallbackSetDNSDomain(domains[0])
|
||||
} else {
|
||||
return luid.fallbackSetDNSDomain("")
|
||||
}
|
||||
}
|
||||
|
||||
// FlushDNS method clears all DNS servers associated with the adapter.
|
||||
func (luid LUID) FlushDNS(family AddressFamily) error {
|
||||
return luid.SetDNS(family, nil, nil)
|
||||
}
|
5
winipcfg/mksyscall.go
Normal file
5
winipcfg/mksyscall.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zwinipcfg_windows.go winipcfg.go
|
105
winipcfg/netsh.go
Normal file
105
winipcfg/netsh.go
Normal file
@@ -0,0 +1,105 @@
|
||||
//go:build windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/netip"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
"golang.org/x/sys/windows/registry"
|
||||
)
|
||||
|
||||
func runNetsh(cmds []string) error {
|
||||
system32, err := windows.GetSystemDirectory()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cmd := exec.Command(filepath.Join(system32, "netsh.exe"))
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
|
||||
|
||||
stdin, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
return fmt.Errorf("runNetsh stdin pipe - %w", err)
|
||||
}
|
||||
go func() {
|
||||
defer stdin.Close()
|
||||
io.WriteString(stdin, strings.Join(append(cmds, "exit\r\n"), "\r\n"))
|
||||
}()
|
||||
output, err := cmd.CombinedOutput()
|
||||
// Horrible kludges, sorry.
|
||||
cleaned := bytes.ReplaceAll(output, []byte{'\r', '\n'}, []byte{'\n'})
|
||||
cleaned = bytes.ReplaceAll(cleaned, []byte("netsh>"), []byte{})
|
||||
cleaned = bytes.ReplaceAll(cleaned, []byte("There are no Domain Name Servers (DNS) configured on this computer."), []byte{})
|
||||
cleaned = bytes.TrimSpace(cleaned)
|
||||
if len(cleaned) != 0 && err == nil {
|
||||
return fmt.Errorf("netsh: %#q", string(cleaned))
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("netsh: %v: %#q", err, string(cleaned))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
const (
|
||||
netshCmdTemplateFlush4 = "interface ipv4 set dnsservers name=%d source=static address=none validate=no register=both"
|
||||
netshCmdTemplateFlush6 = "interface ipv6 set dnsservers name=%d source=static address=none validate=no register=both"
|
||||
netshCmdTemplateAdd4 = "interface ipv4 add dnsservers name=%d address=%s validate=no"
|
||||
netshCmdTemplateAdd6 = "interface ipv6 add dnsservers name=%d address=%s validate=no"
|
||||
)
|
||||
|
||||
func (luid LUID) fallbackSetDNSForFamily(family AddressFamily, dnses []netip.Addr) error {
|
||||
var templateFlush string
|
||||
if family == windows.AF_INET {
|
||||
templateFlush = netshCmdTemplateFlush4
|
||||
} else if family == windows.AF_INET6 {
|
||||
templateFlush = netshCmdTemplateFlush6
|
||||
}
|
||||
|
||||
cmds := make([]string, 0, 1+len(dnses))
|
||||
ipif, err := luid.IPInterface(family)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cmds = append(cmds, fmt.Sprintf(templateFlush, ipif.InterfaceIndex))
|
||||
for i := 0; i < len(dnses); i++ {
|
||||
if dnses[i].Is4() && family == windows.AF_INET {
|
||||
cmds = append(cmds, fmt.Sprintf(netshCmdTemplateAdd4, ipif.InterfaceIndex, dnses[i].String()))
|
||||
} else if dnses[i].Is6() && family == windows.AF_INET6 {
|
||||
cmds = append(cmds, fmt.Sprintf(netshCmdTemplateAdd6, ipif.InterfaceIndex, dnses[i].String()))
|
||||
}
|
||||
}
|
||||
return runNetsh(cmds)
|
||||
}
|
||||
|
||||
func (luid LUID) fallbackSetDNSDomain(domain string) error {
|
||||
guid, err := luid.GUID()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error converting luid to guid: %w", err)
|
||||
}
|
||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, fmt.Sprintf("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Adapters\\%v", guid), registry.QUERY_VALUE)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error opening adapter-specific TCP/IP network registry key: %w", err)
|
||||
}
|
||||
paths, _, err := key.GetStringsValue("IpConfig")
|
||||
key.Close()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error reading IpConfig registry key: %w", err)
|
||||
}
|
||||
if len(paths) == 0 {
|
||||
return errors.New("No TCP/IP interfaces found on adapter")
|
||||
}
|
||||
key, err = registry.OpenKey(registry.LOCAL_MACHINE, fmt.Sprintf("SYSTEM\\CurrentControlSet\\Services\\%s", paths[0]), registry.SET_VALUE)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to open TCP/IP network registry key: %w", err)
|
||||
}
|
||||
err = key.SetStringValue("Domain", domain)
|
||||
key.Close()
|
||||
return err
|
||||
}
|
1015
winipcfg/types.go
Normal file
1015
winipcfg/types.go
Normal file
File diff suppressed because it is too large
Load Diff
227
winipcfg/types_32.go
Normal file
227
winipcfg/types_32.go
Normal file
@@ -0,0 +1,227 @@
|
||||
//go:build (386 || arm) && windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// IPAdapterWINSServerAddress structure stores a single Windows Internet Name Service (WINS) server address in a linked list of WINS server addresses for a particular adapter.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_wins_server_address_lh
|
||||
type IPAdapterWINSServerAddress struct {
|
||||
Length uint32
|
||||
_ uint32
|
||||
Next *IPAdapterWINSServerAddress
|
||||
Address windows.SocketAddress
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
// IPAdapterGatewayAddress structure stores a single gateway address in a linked list of gateway addresses for a particular adapter.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_gateway_address_lh
|
||||
type IPAdapterGatewayAddress struct {
|
||||
Length uint32
|
||||
_ uint32
|
||||
Next *IPAdapterGatewayAddress
|
||||
Address windows.SocketAddress
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
// IPAdapterAddresses structure is the header node for a linked list of addresses for a particular adapter. This structure can simultaneously be used as part of a linked list of IP_ADAPTER_ADDRESSES structures.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_addresses_lh
|
||||
// This is a modified and extended version of windows.IpAdapterAddresses.
|
||||
type IPAdapterAddresses struct {
|
||||
Length uint32
|
||||
IfIndex uint32
|
||||
Next *IPAdapterAddresses
|
||||
adapterName *byte
|
||||
FirstUnicastAddress *windows.IpAdapterUnicastAddress
|
||||
FirstAnycastAddress *windows.IpAdapterAnycastAddress
|
||||
FirstMulticastAddress *windows.IpAdapterMulticastAddress
|
||||
FirstDNSServerAddress *windows.IpAdapterDnsServerAdapter
|
||||
dnsSuffix *uint16
|
||||
description *uint16
|
||||
friendlyName *uint16
|
||||
physicalAddress [windows.MAX_ADAPTER_ADDRESS_LENGTH]byte
|
||||
physicalAddressLength uint32
|
||||
Flags IPAAFlags
|
||||
MTU uint32
|
||||
IfType IfType
|
||||
OperStatus IfOperStatus
|
||||
IPv6IfIndex uint32
|
||||
ZoneIndices [16]uint32
|
||||
FirstPrefix *windows.IpAdapterPrefix
|
||||
TransmitLinkSpeed uint64
|
||||
ReceiveLinkSpeed uint64
|
||||
FirstWINSServerAddress *IPAdapterWINSServerAddress
|
||||
FirstGatewayAddress *IPAdapterGatewayAddress
|
||||
Ipv4Metric uint32
|
||||
Ipv6Metric uint32
|
||||
LUID LUID
|
||||
DHCPv4Server windows.SocketAddress
|
||||
CompartmentID uint32
|
||||
NetworkGUID windows.GUID
|
||||
ConnectionType NetIfConnectionType
|
||||
TunnelType TunnelType
|
||||
DHCPv6Server windows.SocketAddress
|
||||
dhcpv6ClientDUID [maxDHCPv6DUIDLength]byte
|
||||
dhcpv6ClientDUIDLength uint32
|
||||
DHCPv6IAID uint32
|
||||
FirstDNSSuffix *IPAdapterDNSSuffix
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
// MibIPInterfaceRow structure stores interface management information for a particular IP address family on a network interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipinterface_row
|
||||
type MibIPInterfaceRow struct {
|
||||
Family AddressFamily
|
||||
_ [4]byte
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
MaxReassemblySize uint32
|
||||
InterfaceIdentifier uint64
|
||||
MinRouterAdvertisementInterval uint32
|
||||
MaxRouterAdvertisementInterval uint32
|
||||
AdvertisingEnabled bool
|
||||
ForwardingEnabled bool
|
||||
WeakHostSend bool
|
||||
WeakHostReceive bool
|
||||
UseAutomaticMetric bool
|
||||
UseNeighborUnreachabilityDetection bool
|
||||
ManagedAddressConfigurationSupported bool
|
||||
OtherStatefulConfigurationSupported bool
|
||||
AdvertiseDefaultRoute bool
|
||||
RouterDiscoveryBehavior RouterDiscoveryBehavior
|
||||
DadTransmits uint32
|
||||
BaseReachableTime uint32
|
||||
RetransmitTime uint32
|
||||
PathMTUDiscoveryTimeout uint32
|
||||
LinkLocalAddressBehavior LinkLocalAddressBehavior
|
||||
LinkLocalAddressTimeout uint32
|
||||
ZoneIndices [ScopeLevelCount]uint32
|
||||
SitePrefixLength uint32
|
||||
Metric uint32
|
||||
NLMTU uint32
|
||||
Connected bool
|
||||
SupportsWakeUpPatterns bool
|
||||
SupportsNeighborDiscovery bool
|
||||
SupportsRouterDiscovery bool
|
||||
ReachableTime uint32
|
||||
TransmitOffload OffloadRod
|
||||
ReceiveOffload OffloadRod
|
||||
DisableDefaultRoutes bool
|
||||
}
|
||||
|
||||
// mibIPInterfaceTable structure contains a table of IP interface entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipinterface_table
|
||||
type mibIPInterfaceTable struct {
|
||||
numEntries uint32
|
||||
_ [4]byte
|
||||
table [anySize]MibIPInterfaceRow
|
||||
}
|
||||
|
||||
// MibIfRow2 structure stores information about a particular interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_row2
|
||||
type MibIfRow2 struct {
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
InterfaceGUID windows.GUID
|
||||
alias [ifMaxStringSize + 1]uint16
|
||||
description [ifMaxStringSize + 1]uint16
|
||||
physicalAddressLength uint32
|
||||
physicalAddress [ifMaxPhysAddressLength]byte
|
||||
permanentPhysicalAddress [ifMaxPhysAddressLength]byte
|
||||
MTU uint32
|
||||
Type IfType
|
||||
TunnelType TunnelType
|
||||
MediaType NdisMedium
|
||||
PhysicalMediumType NdisPhysicalMedium
|
||||
AccessType NetIfAccessType
|
||||
DirectionType NetIfDirectionType
|
||||
InterfaceAndOperStatusFlags InterfaceAndOperStatusFlags
|
||||
OperStatus IfOperStatus
|
||||
AdminStatus NetIfAdminStatus
|
||||
MediaConnectState NetIfMediaConnectState
|
||||
NetworkGUID windows.GUID
|
||||
ConnectionType NetIfConnectionType
|
||||
_ [4]byte
|
||||
TransmitLinkSpeed uint64
|
||||
ReceiveLinkSpeed uint64
|
||||
InOctets uint64
|
||||
InUcastPkts uint64
|
||||
InNUcastPkts uint64
|
||||
InDiscards uint64
|
||||
InErrors uint64
|
||||
InUnknownProtos uint64
|
||||
InUcastOctets uint64
|
||||
InMulticastOctets uint64
|
||||
InBroadcastOctets uint64
|
||||
OutOctets uint64
|
||||
OutUcastPkts uint64
|
||||
OutNUcastPkts uint64
|
||||
OutDiscards uint64
|
||||
OutErrors uint64
|
||||
OutUcastOctets uint64
|
||||
OutMulticastOctets uint64
|
||||
OutBroadcastOctets uint64
|
||||
OutQLen uint64
|
||||
}
|
||||
|
||||
// mibIfTable2 structure contains a table of logical and physical interface entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_table2
|
||||
type mibIfTable2 struct {
|
||||
numEntries uint32
|
||||
_ [4]byte
|
||||
table [anySize]MibIfRow2
|
||||
}
|
||||
|
||||
// MibUnicastIPAddressRow structure stores information about a unicast IP address.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_unicastipaddress_row
|
||||
type MibUnicastIPAddressRow struct {
|
||||
Address RawSockaddrInet
|
||||
_ [4]byte
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
PrefixOrigin PrefixOrigin
|
||||
SuffixOrigin SuffixOrigin
|
||||
ValidLifetime uint32
|
||||
PreferredLifetime uint32
|
||||
OnLinkPrefixLength uint8
|
||||
SkipAsSource bool
|
||||
DadState DadState
|
||||
ScopeID uint32
|
||||
CreationTimeStamp int64
|
||||
}
|
||||
|
||||
// mibUnicastIPAddressTable structure contains a table of unicast IP address entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_unicastipaddress_table
|
||||
type mibUnicastIPAddressTable struct {
|
||||
numEntries uint32
|
||||
_ [4]byte
|
||||
table [anySize]MibUnicastIPAddressRow
|
||||
}
|
||||
|
||||
// MibAnycastIPAddressRow structure stores information about an anycast IP address.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_anycastipaddress_row
|
||||
type MibAnycastIPAddressRow struct {
|
||||
Address RawSockaddrInet
|
||||
_ [4]byte
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
ScopeID uint32
|
||||
}
|
||||
|
||||
// mibAnycastIPAddressTable structure contains a table of anycast IP address entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-mib_anycastipaddress_table
|
||||
type mibAnycastIPAddressTable struct {
|
||||
numEntries uint32
|
||||
_ [4]byte
|
||||
table [anySize]MibAnycastIPAddressRow
|
||||
}
|
||||
|
||||
// mibIPforwardTable2 structure contains a table of IP route entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipforward_table2
|
||||
type mibIPforwardTable2 struct {
|
||||
numEntries uint32
|
||||
_ [4]byte
|
||||
table [anySize]MibIPforwardRow2
|
||||
}
|
220
winipcfg/types_64.go
Normal file
220
winipcfg/types_64.go
Normal file
@@ -0,0 +1,220 @@
|
||||
//go:build (amd64 || arm64) && windows
|
||||
|
||||
/* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
|
||||
*/
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// IPAdapterWINSServerAddress structure stores a single Windows Internet Name Service (WINS) server address in a linked list of WINS server addresses for a particular adapter.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_wins_server_address_lh
|
||||
type IPAdapterWINSServerAddress struct {
|
||||
Length uint32
|
||||
_ uint32
|
||||
Next *IPAdapterWINSServerAddress
|
||||
Address windows.SocketAddress
|
||||
}
|
||||
|
||||
// IPAdapterGatewayAddress structure stores a single gateway address in a linked list of gateway addresses for a particular adapter.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_gateway_address_lh
|
||||
type IPAdapterGatewayAddress struct {
|
||||
Length uint32
|
||||
_ uint32
|
||||
Next *IPAdapterGatewayAddress
|
||||
Address windows.SocketAddress
|
||||
}
|
||||
|
||||
// IPAdapterAddresses structure is the header node for a linked list of addresses for a particular adapter. This structure can simultaneously be used as part of a linked list of IP_ADAPTER_ADDRESSES structures.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_addresses_lh
|
||||
// This is a modified and extended version of windows.IpAdapterAddresses.
|
||||
type IPAdapterAddresses struct {
|
||||
Length uint32
|
||||
IfIndex uint32
|
||||
Next *IPAdapterAddresses
|
||||
adapterName *byte
|
||||
FirstUnicastAddress *windows.IpAdapterUnicastAddress
|
||||
FirstAnycastAddress *windows.IpAdapterAnycastAddress
|
||||
FirstMulticastAddress *windows.IpAdapterMulticastAddress
|
||||
FirstDNSServerAddress *windows.IpAdapterDnsServerAdapter
|
||||
dnsSuffix *uint16
|
||||
description *uint16
|
||||
friendlyName *uint16
|
||||
physicalAddress [windows.MAX_ADAPTER_ADDRESS_LENGTH]byte
|
||||
physicalAddressLength uint32
|
||||
Flags IPAAFlags
|
||||
MTU uint32
|
||||
IfType IfType
|
||||
OperStatus IfOperStatus
|
||||
IPv6IfIndex uint32
|
||||
ZoneIndices [16]uint32
|
||||
FirstPrefix *windows.IpAdapterPrefix
|
||||
TransmitLinkSpeed uint64
|
||||
ReceiveLinkSpeed uint64
|
||||
FirstWINSServerAddress *IPAdapterWINSServerAddress
|
||||
FirstGatewayAddress *IPAdapterGatewayAddress
|
||||
Ipv4Metric uint32
|
||||
Ipv6Metric uint32
|
||||
LUID LUID
|
||||
DHCPv4Server windows.SocketAddress
|
||||
CompartmentID uint32
|
||||
NetworkGUID windows.GUID
|
||||
ConnectionType NetIfConnectionType
|
||||
TunnelType TunnelType
|
||||
DHCPv6Server windows.SocketAddress
|
||||
dhcpv6ClientDUID [maxDHCPv6DUIDLength]byte
|
||||
dhcpv6ClientDUIDLength uint32
|
||||
DHCPv6IAID uint32
|
||||
FirstDNSSuffix *IPAdapterDNSSuffix
|
||||
}
|
||||
|
||||
// MibIPInterfaceRow structure stores interface management information for a particular IP address family on a network interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipinterface_row
|
||||
type MibIPInterfaceRow struct {
|
||||
Family AddressFamily
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
MaxReassemblySize uint32
|
||||
InterfaceIdentifier uint64
|
||||
MinRouterAdvertisementInterval uint32
|
||||
MaxRouterAdvertisementInterval uint32
|
||||
AdvertisingEnabled bool
|
||||
ForwardingEnabled bool
|
||||
WeakHostSend bool
|
||||
WeakHostReceive bool
|
||||
UseAutomaticMetric bool
|
||||
UseNeighborUnreachabilityDetection bool
|
||||
ManagedAddressConfigurationSupported bool
|
||||
OtherStatefulConfigurationSupported bool
|
||||
AdvertiseDefaultRoute bool
|
||||
RouterDiscoveryBehavior RouterDiscoveryBehavior
|
||||
DadTransmits uint32
|
||||
BaseReachableTime uint32
|
||||
RetransmitTime uint32
|
||||
PathMTUDiscoveryTimeout uint32
|
||||
LinkLocalAddressBehavior LinkLocalAddressBehavior
|
||||
LinkLocalAddressTimeout uint32
|
||||
ZoneIndices [ScopeLevelCount]uint32
|
||||
SitePrefixLength uint32
|
||||
Metric uint32
|
||||
NLMTU uint32
|
||||
Connected bool
|
||||
SupportsWakeUpPatterns bool
|
||||
SupportsNeighborDiscovery bool
|
||||
SupportsRouterDiscovery bool
|
||||
ReachableTime uint32
|
||||
TransmitOffload OffloadRod
|
||||
ReceiveOffload OffloadRod
|
||||
DisableDefaultRoutes bool
|
||||
}
|
||||
|
||||
// mibIPInterfaceTable structure contains a table of IP interface entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipinterface_table
|
||||
type mibIPInterfaceTable struct {
|
||||
numEntries uint32
|
||||
table [anySize]MibIPInterfaceRow
|
||||
}
|
||||
|
||||
// MibIfRow2 structure stores information about a particular interface.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_row2
|
||||
type MibIfRow2 struct {
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
InterfaceGUID windows.GUID
|
||||
alias [ifMaxStringSize + 1]uint16
|
||||
description [ifMaxStringSize + 1]uint16
|
||||
physicalAddressLength uint32
|
||||
physicalAddress [ifMaxPhysAddressLength]byte
|
||||
permanentPhysicalAddress [ifMaxPhysAddressLength]byte
|
||||
MTU uint32
|
||||
Type IfType
|
||||
TunnelType TunnelType
|
||||
MediaType NdisMedium
|
||||
PhysicalMediumType NdisPhysicalMedium
|
||||
AccessType NetIfAccessType
|
||||
DirectionType NetIfDirectionType
|
||||
InterfaceAndOperStatusFlags InterfaceAndOperStatusFlags
|
||||
OperStatus IfOperStatus
|
||||
AdminStatus NetIfAdminStatus
|
||||
MediaConnectState NetIfMediaConnectState
|
||||
NetworkGUID windows.GUID
|
||||
ConnectionType NetIfConnectionType
|
||||
TransmitLinkSpeed uint64
|
||||
ReceiveLinkSpeed uint64
|
||||
InOctets uint64
|
||||
InUcastPkts uint64
|
||||
InNUcastPkts uint64
|
||||
InDiscards uint64
|
||||
InErrors uint64
|
||||
InUnknownProtos uint64
|
||||
InUcastOctets uint64
|
||||
InMulticastOctets uint64
|
||||
InBroadcastOctets uint64
|
||||
OutOctets uint64
|
||||
OutUcastPkts uint64
|
||||
OutNUcastPkts uint64
|
||||
OutDiscards uint64
|
||||
OutErrors uint64
|
||||
OutUcastOctets uint64
|
||||
OutMulticastOctets uint64
|
||||
OutBroadcastOctets uint64
|
||||
OutQLen uint64
|
||||
}
|
||||
|
||||
// mibIfTable2 structure contains a table of logical and physical interface entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_table2
|
||||
type mibIfTable2 struct {
|
||||
numEntries uint32
|
||||
table [anySize]MibIfRow2
|
||||
}
|
||||
|
||||
// MibUnicastIPAddressRow structure stores information about a unicast IP address.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_unicastipaddress_row
|
||||
type MibUnicastIPAddressRow struct {
|
||||
Address RawSockaddrInet
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
PrefixOrigin PrefixOrigin
|
||||
SuffixOrigin SuffixOrigin
|
||||
ValidLifetime uint32
|
||||
PreferredLifetime uint32
|
||||
OnLinkPrefixLength uint8
|
||||
SkipAsSource bool
|
||||
DadState DadState
|
||||
ScopeID uint32
|
||||
CreationTimeStamp int64
|
||||
}
|
||||
|
||||
// mibUnicastIPAddressTable structure contains a table of unicast IP address entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_unicastipaddress_table
|
||||
type mibUnicastIPAddressTable struct {
|
||||
numEntries uint32
|
||||
table [anySize]MibUnicastIPAddressRow
|
||||
}
|
||||
|
||||
// MibAnycastIPAddressRow structure stores information about an anycast IP address.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_anycastipaddress_row
|
||||
type MibAnycastIPAddressRow struct {
|
||||
Address RawSockaddrInet
|
||||
InterfaceLUID LUID
|
||||
InterfaceIndex uint32
|
||||
ScopeID uint32
|
||||
}
|
||||
|
||||
// mibAnycastIPAddressTable structure contains a table of anycast IP address entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-mib_anycastipaddress_table
|
||||
type mibAnycastIPAddressTable struct {
|
||||
numEntries uint32
|
||||
table [anySize]MibAnycastIPAddressRow
|
||||
}
|
||||
|
||||
// mibIPforwardTable2 structure contains a table of IP route entries.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipforward_table2
|
||||
type mibIPforwardTable2 struct {
|
||||
numEntries uint32
|
||||
table [anySize]MibIPforwardRow2
|
||||
}
|
193
winipcfg/winipcfg.go
Normal file
193
winipcfg/winipcfg.go
Normal file
@@ -0,0 +1,193 @@
|
||||
//go:build windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
//
|
||||
// Common functions
|
||||
//
|
||||
|
||||
//sys freeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable
|
||||
|
||||
//
|
||||
// Interface-related functions
|
||||
//
|
||||
|
||||
//sys initializeIPInterfaceEntry(row *MibIPInterfaceRow) = iphlpapi.InitializeIpInterfaceEntry
|
||||
//sys getIPInterfaceTable(family AddressFamily, table **mibIPInterfaceTable) (ret error) = iphlpapi.GetIpInterfaceTable
|
||||
//sys getIPInterfaceEntry(row *MibIPInterfaceRow) (ret error) = iphlpapi.GetIpInterfaceEntry
|
||||
//sys setIPInterfaceEntry(row *MibIPInterfaceRow) (ret error) = iphlpapi.SetIpInterfaceEntry
|
||||
//sys getIfEntry2(row *MibIfRow2) (ret error) = iphlpapi.GetIfEntry2
|
||||
//sys getIfTable2Ex(level MibIfEntryLevel, table **mibIfTable2) (ret error) = iphlpapi.GetIfTable2Ex
|
||||
//sys convertInterfaceLUIDToGUID(interfaceLUID *LUID, interfaceGUID *windows.GUID) (ret error) = iphlpapi.ConvertInterfaceLuidToGuid
|
||||
//sys convertInterfaceGUIDToLUID(interfaceGUID *windows.GUID, interfaceLUID *LUID) (ret error) = iphlpapi.ConvertInterfaceGuidToLuid
|
||||
//sys convertInterfaceIndexToLUID(interfaceIndex uint32, interfaceLUID *LUID) (ret error) = iphlpapi.ConvertInterfaceIndexToLuid
|
||||
|
||||
// GetAdaptersAddresses function retrieves the addresses associated with the adapters on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/iphlpapi/nf-iphlpapi-getadaptersaddresses
|
||||
func GetAdaptersAddresses(family AddressFamily, flags GAAFlags) ([]*IPAdapterAddresses, error) {
|
||||
var b []byte
|
||||
size := uint32(15000)
|
||||
|
||||
for {
|
||||
b = make([]byte, size)
|
||||
err := windows.GetAdaptersAddresses(uint32(family), uint32(flags), 0, (*windows.IpAdapterAddresses)(unsafe.Pointer(&b[0])), &size)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
if err != windows.ERROR_BUFFER_OVERFLOW || size <= uint32(len(b)) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
result := make([]*IPAdapterAddresses, 0, uintptr(size)/unsafe.Sizeof(IPAdapterAddresses{}))
|
||||
for wtiaa := (*IPAdapterAddresses)(unsafe.Pointer(&b[0])); wtiaa != nil; wtiaa = wtiaa.Next {
|
||||
result = append(result, wtiaa)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GetIPInterfaceTable function retrieves the IP interface entries on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipinterfacetable
|
||||
func GetIPInterfaceTable(family AddressFamily) ([]MibIPInterfaceRow, error) {
|
||||
var tab *mibIPInterfaceTable
|
||||
err := getIPInterfaceTable(family, &tab)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := append(make([]MibIPInterfaceRow, 0, tab.numEntries), tab.get()...)
|
||||
tab.free()
|
||||
return t, nil
|
||||
}
|
||||
|
||||
// GetIfTable2Ex function retrieves the MIB-II interface table.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getiftable2ex
|
||||
func GetIfTable2Ex(level MibIfEntryLevel) ([]MibIfRow2, error) {
|
||||
var tab *mibIfTable2
|
||||
err := getIfTable2Ex(level, &tab)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := append(make([]MibIfRow2, 0, tab.numEntries), tab.get()...)
|
||||
tab.free()
|
||||
return t, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Unicast IP address-related functions
|
||||
//
|
||||
|
||||
//sys getUnicastIPAddressTable(family AddressFamily, table **mibUnicastIPAddressTable) (ret error) = iphlpapi.GetUnicastIpAddressTable
|
||||
//sys initializeUnicastIPAddressEntry(row *MibUnicastIPAddressRow) = iphlpapi.InitializeUnicastIpAddressEntry
|
||||
//sys getUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) = iphlpapi.GetUnicastIpAddressEntry
|
||||
//sys setUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) = iphlpapi.SetUnicastIpAddressEntry
|
||||
//sys createUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) = iphlpapi.CreateUnicastIpAddressEntry
|
||||
//sys deleteUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) = iphlpapi.DeleteUnicastIpAddressEntry
|
||||
|
||||
// GetUnicastIPAddressTable function retrieves the unicast IP address table on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getunicastipaddresstable
|
||||
func GetUnicastIPAddressTable(family AddressFamily) ([]MibUnicastIPAddressRow, error) {
|
||||
var tab *mibUnicastIPAddressTable
|
||||
err := getUnicastIPAddressTable(family, &tab)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := append(make([]MibUnicastIPAddressRow, 0, tab.numEntries), tab.get()...)
|
||||
tab.free()
|
||||
return t, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Anycast IP address-related functions
|
||||
//
|
||||
|
||||
//sys getAnycastIPAddressTable(family AddressFamily, table **mibAnycastIPAddressTable) (ret error) = iphlpapi.GetAnycastIpAddressTable
|
||||
//sys getAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) = iphlpapi.GetAnycastIpAddressEntry
|
||||
//sys createAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) = iphlpapi.CreateAnycastIpAddressEntry
|
||||
//sys deleteAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) = iphlpapi.DeleteAnycastIpAddressEntry
|
||||
|
||||
// GetAnycastIPAddressTable function retrieves the anycast IP address table on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getanycastipaddresstable
|
||||
func GetAnycastIPAddressTable(family AddressFamily) ([]MibAnycastIPAddressRow, error) {
|
||||
var tab *mibAnycastIPAddressTable
|
||||
err := getAnycastIPAddressTable(family, &tab)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := append(make([]MibAnycastIPAddressRow, 0, tab.numEntries), tab.get()...)
|
||||
tab.free()
|
||||
return t, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Routing-related functions
|
||||
//
|
||||
|
||||
//sys getIPForwardTable2(family AddressFamily, table **mibIPforwardTable2) (ret error) = iphlpapi.GetIpForwardTable2
|
||||
//sys initializeIPForwardEntry(route *MibIPforwardRow2) = iphlpapi.InitializeIpForwardEntry
|
||||
//sys getIPForwardEntry2(route *MibIPforwardRow2) (ret error) = iphlpapi.GetIpForwardEntry2
|
||||
//sys setIPForwardEntry2(route *MibIPforwardRow2) (ret error) = iphlpapi.SetIpForwardEntry2
|
||||
//sys createIPForwardEntry2(route *MibIPforwardRow2) (ret error) = iphlpapi.CreateIpForwardEntry2
|
||||
//sys deleteIPForwardEntry2(route *MibIPforwardRow2) (ret error) = iphlpapi.DeleteIpForwardEntry2
|
||||
|
||||
// GetIPForwardTable2 function retrieves the IP route entries on the local computer.
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipforwardtable2
|
||||
func GetIPForwardTable2(family AddressFamily) ([]MibIPforwardRow2, error) {
|
||||
var tab *mibIPforwardTable2
|
||||
err := getIPForwardTable2(family, &tab)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t := append(make([]MibIPforwardRow2, 0, tab.numEntries), tab.get()...)
|
||||
tab.free()
|
||||
return t, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Notifications-related functions
|
||||
//
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-notifyipinterfacechange
|
||||
//sys notifyIPInterfaceChange(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) = iphlpapi.NotifyIpInterfaceChange
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-notifyunicastipaddresschange
|
||||
//sys notifyUnicastIPAddressChange(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) = iphlpapi.NotifyUnicastIpAddressChange
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-notifyroutechange2
|
||||
//sys notifyRouteChange2(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) = iphlpapi.NotifyRouteChange2
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-cancelmibchangenotify2
|
||||
//sys cancelMibChangeNotify2(notificationHandle windows.Handle) (ret error) = iphlpapi.CancelMibChangeNotify2
|
||||
|
||||
//
|
||||
// DNS-related functions
|
||||
//
|
||||
|
||||
//sys setInterfaceDnsSettingsByPtr(guid *windows.GUID, settings *DnsInterfaceSettings) (ret error) = iphlpapi.SetInterfaceDnsSettings?
|
||||
//sys setInterfaceDnsSettingsByQwords(guid1 uintptr, guid2 uintptr, settings *DnsInterfaceSettings) (ret error) = iphlpapi.SetInterfaceDnsSettings?
|
||||
//sys setInterfaceDnsSettingsByDwords(guid1 uintptr, guid2 uintptr, guid3 uintptr, guid4 uintptr, settings *DnsInterfaceSettings) (ret error) = iphlpapi.SetInterfaceDnsSettings?
|
||||
|
||||
// The GUID is passed by value, not by reference, which means different
|
||||
// things on different calling conventions. On amd64, this means it's
|
||||
// passed by reference anyway, while on arm, arm64, and 386, it's split
|
||||
// into words.
|
||||
func SetInterfaceDnsSettings(guid windows.GUID, settings *DnsInterfaceSettings) error {
|
||||
words := (*[4]uintptr)(unsafe.Pointer(&guid))
|
||||
switch runtime.GOARCH {
|
||||
case "amd64":
|
||||
return setInterfaceDnsSettingsByPtr(&guid, settings)
|
||||
case "arm64":
|
||||
return setInterfaceDnsSettingsByQwords(words[0], words[1], settings)
|
||||
case "arm", "386":
|
||||
return setInterfaceDnsSettingsByDwords(words[0], words[1], words[2], words[3], settings)
|
||||
default:
|
||||
panic("unknown calling convention")
|
||||
}
|
||||
}
|
350
winipcfg/zwinipcfg_windows.go
Normal file
350
winipcfg/zwinipcfg_windows.go
Normal file
@@ -0,0 +1,350 @@
|
||||
//go:build windows
|
||||
|
||||
package winipcfg
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
var _ unsafe.Pointer
|
||||
|
||||
// Do the interface allocations only once for common
|
||||
// Errno values.
|
||||
const (
|
||||
errnoERROR_IO_PENDING = 997
|
||||
)
|
||||
|
||||
var (
|
||||
errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
|
||||
errERROR_EINVAL error = syscall.EINVAL
|
||||
)
|
||||
|
||||
// errnoErr returns common boxed Errno values, to prevent
|
||||
// allocations at runtime.
|
||||
func errnoErr(e syscall.Errno) error {
|
||||
switch e {
|
||||
case 0:
|
||||
return errERROR_EINVAL
|
||||
case errnoERROR_IO_PENDING:
|
||||
return errERROR_IO_PENDING
|
||||
}
|
||||
// TODO: add more here, after collecting data on the common
|
||||
// error values see on Windows. (perhaps when running
|
||||
// all.bat?)
|
||||
return e
|
||||
}
|
||||
|
||||
var (
|
||||
modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
|
||||
|
||||
procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2")
|
||||
procConvertInterfaceGuidToLuid = modiphlpapi.NewProc("ConvertInterfaceGuidToLuid")
|
||||
procConvertInterfaceIndexToLuid = modiphlpapi.NewProc("ConvertInterfaceIndexToLuid")
|
||||
procConvertInterfaceLuidToGuid = modiphlpapi.NewProc("ConvertInterfaceLuidToGuid")
|
||||
procCreateAnycastIpAddressEntry = modiphlpapi.NewProc("CreateAnycastIpAddressEntry")
|
||||
procCreateIpForwardEntry2 = modiphlpapi.NewProc("CreateIpForwardEntry2")
|
||||
procCreateUnicastIpAddressEntry = modiphlpapi.NewProc("CreateUnicastIpAddressEntry")
|
||||
procDeleteAnycastIpAddressEntry = modiphlpapi.NewProc("DeleteAnycastIpAddressEntry")
|
||||
procDeleteIpForwardEntry2 = modiphlpapi.NewProc("DeleteIpForwardEntry2")
|
||||
procDeleteUnicastIpAddressEntry = modiphlpapi.NewProc("DeleteUnicastIpAddressEntry")
|
||||
procFreeMibTable = modiphlpapi.NewProc("FreeMibTable")
|
||||
procGetAnycastIpAddressEntry = modiphlpapi.NewProc("GetAnycastIpAddressEntry")
|
||||
procGetAnycastIpAddressTable = modiphlpapi.NewProc("GetAnycastIpAddressTable")
|
||||
procGetIfEntry2 = modiphlpapi.NewProc("GetIfEntry2")
|
||||
procGetIfTable2Ex = modiphlpapi.NewProc("GetIfTable2Ex")
|
||||
procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2")
|
||||
procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2")
|
||||
procGetIpInterfaceEntry = modiphlpapi.NewProc("GetIpInterfaceEntry")
|
||||
procGetIpInterfaceTable = modiphlpapi.NewProc("GetIpInterfaceTable")
|
||||
procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry")
|
||||
procGetUnicastIpAddressTable = modiphlpapi.NewProc("GetUnicastIpAddressTable")
|
||||
procInitializeIpForwardEntry = modiphlpapi.NewProc("InitializeIpForwardEntry")
|
||||
procInitializeIpInterfaceEntry = modiphlpapi.NewProc("InitializeIpInterfaceEntry")
|
||||
procInitializeUnicastIpAddressEntry = modiphlpapi.NewProc("InitializeUnicastIpAddressEntry")
|
||||
procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange")
|
||||
procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2")
|
||||
procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange")
|
||||
procSetInterfaceDnsSettings = modiphlpapi.NewProc("SetInterfaceDnsSettings")
|
||||
procSetIpForwardEntry2 = modiphlpapi.NewProc("SetIpForwardEntry2")
|
||||
procSetIpInterfaceEntry = modiphlpapi.NewProc("SetIpInterfaceEntry")
|
||||
procSetUnicastIpAddressEntry = modiphlpapi.NewProc("SetUnicastIpAddressEntry")
|
||||
)
|
||||
|
||||
func cancelMibChangeNotify2(notificationHandle windows.Handle) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procCancelMibChangeNotify2.Addr(), 1, uintptr(notificationHandle), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func convertInterfaceGUIDToLUID(interfaceGUID *windows.GUID, interfaceLUID *LUID) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procConvertInterfaceGuidToLuid.Addr(), 2, uintptr(unsafe.Pointer(interfaceGUID)), uintptr(unsafe.Pointer(interfaceLUID)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func convertInterfaceIndexToLUID(interfaceIndex uint32, interfaceLUID *LUID) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procConvertInterfaceIndexToLuid.Addr(), 2, uintptr(interfaceIndex), uintptr(unsafe.Pointer(interfaceLUID)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func convertInterfaceLUIDToGUID(interfaceLUID *LUID, interfaceGUID *windows.GUID) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procConvertInterfaceLuidToGuid.Addr(), 2, uintptr(unsafe.Pointer(interfaceLUID)), uintptr(unsafe.Pointer(interfaceGUID)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func createAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procCreateAnycastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func createIPForwardEntry2(route *MibIPforwardRow2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procCreateIpForwardEntry2.Addr(), 1, uintptr(unsafe.Pointer(route)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func createUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procCreateUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func deleteAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procDeleteAnycastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func deleteIPForwardEntry2(route *MibIPforwardRow2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procDeleteIpForwardEntry2.Addr(), 1, uintptr(unsafe.Pointer(route)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func deleteUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procDeleteUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func freeMibTable(memory unsafe.Pointer) {
|
||||
syscall.Syscall(procFreeMibTable.Addr(), 1, uintptr(memory), 0, 0)
|
||||
return
|
||||
}
|
||||
|
||||
func getAnycastIPAddressEntry(row *MibAnycastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetAnycastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getAnycastIPAddressTable(family AddressFamily, table **mibAnycastIPAddressTable) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetAnycastIpAddressTable.Addr(), 2, uintptr(family), uintptr(unsafe.Pointer(table)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIfEntry2(row *MibIfRow2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIfEntry2.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIfTable2Ex(level MibIfEntryLevel, table **mibIfTable2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIfTable2Ex.Addr(), 2, uintptr(level), uintptr(unsafe.Pointer(table)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIPForwardEntry2(route *MibIPforwardRow2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIpForwardEntry2.Addr(), 1, uintptr(unsafe.Pointer(route)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIPForwardTable2(family AddressFamily, table **mibIPforwardTable2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIpForwardTable2.Addr(), 2, uintptr(family), uintptr(unsafe.Pointer(table)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIPInterfaceEntry(row *MibIPInterfaceRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIpInterfaceEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getIPInterfaceTable(family AddressFamily, table **mibIPInterfaceTable) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetIpInterfaceTable.Addr(), 2, uintptr(family), uintptr(unsafe.Pointer(table)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func getUnicastIPAddressTable(family AddressFamily, table **mibUnicastIPAddressTable) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procGetUnicastIpAddressTable.Addr(), 2, uintptr(family), uintptr(unsafe.Pointer(table)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func initializeIPForwardEntry(route *MibIPforwardRow2) {
|
||||
syscall.Syscall(procInitializeIpForwardEntry.Addr(), 1, uintptr(unsafe.Pointer(route)), 0, 0)
|
||||
return
|
||||
}
|
||||
|
||||
func initializeIPInterfaceEntry(row *MibIPInterfaceRow) {
|
||||
syscall.Syscall(procInitializeIpInterfaceEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
return
|
||||
}
|
||||
|
||||
func initializeUnicastIPAddressEntry(row *MibUnicastIPAddressRow) {
|
||||
syscall.Syscall(procInitializeUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
return
|
||||
}
|
||||
|
||||
func notifyIPInterfaceChange(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) {
|
||||
var _p0 uint32
|
||||
if initialNotification {
|
||||
_p0 = 1
|
||||
}
|
||||
r0, _, _ := syscall.Syscall6(procNotifyIpInterfaceChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func notifyRouteChange2(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) {
|
||||
var _p0 uint32
|
||||
if initialNotification {
|
||||
_p0 = 1
|
||||
}
|
||||
r0, _, _ := syscall.Syscall6(procNotifyRouteChange2.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func notifyUnicastIPAddressChange(family AddressFamily, callback uintptr, callerContext uintptr, initialNotification bool, notificationHandle *windows.Handle) (ret error) {
|
||||
var _p0 uint32
|
||||
if initialNotification {
|
||||
_p0 = 1
|
||||
}
|
||||
r0, _, _ := syscall.Syscall6(procNotifyUnicastIpAddressChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setInterfaceDnsSettingsByDwords(guid1 uintptr, guid2 uintptr, guid3 uintptr, guid4 uintptr, settings *DnsInterfaceSettings) (ret error) {
|
||||
ret = procSetInterfaceDnsSettings.Find()
|
||||
if ret != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall6(procSetInterfaceDnsSettings.Addr(), 5, uintptr(guid1), uintptr(guid2), uintptr(guid3), uintptr(guid4), uintptr(unsafe.Pointer(settings)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setInterfaceDnsSettingsByQwords(guid1 uintptr, guid2 uintptr, settings *DnsInterfaceSettings) (ret error) {
|
||||
ret = procSetInterfaceDnsSettings.Find()
|
||||
if ret != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procSetInterfaceDnsSettings.Addr(), 3, uintptr(guid1), uintptr(guid2), uintptr(unsafe.Pointer(settings)))
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setInterfaceDnsSettingsByPtr(guid *windows.GUID, settings *DnsInterfaceSettings) (ret error) {
|
||||
ret = procSetInterfaceDnsSettings.Find()
|
||||
if ret != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procSetInterfaceDnsSettings.Addr(), 2, uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(settings)), 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setIPForwardEntry2(route *MibIPforwardRow2) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procSetIpForwardEntry2.Addr(), 1, uintptr(unsafe.Pointer(route)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setIPInterfaceEntry(row *MibIPInterfaceRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procSetIpInterfaceEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setUnicastIPAddressEntry(row *MibUnicastIPAddressRow) (ret error) {
|
||||
r0, _, _ := syscall.Syscall(procSetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user