diff --git a/device/device.go b/component/device/device.go similarity index 100% rename from device/device.go rename to component/device/device.go diff --git a/device/rwbased/endpoint.go b/component/device/rwbased/endpoint.go similarity index 100% rename from device/rwbased/endpoint.go rename to component/device/rwbased/endpoint.go diff --git a/device/tun/offset_unix.go b/component/device/tun/offset_unix.go similarity index 100% rename from device/tun/offset_unix.go rename to component/device/tun/offset_unix.go diff --git a/device/tun/offset_windows.go b/component/device/tun/offset_windows.go similarity index 100% rename from device/tun/offset_windows.go rename to component/device/tun/offset_windows.go diff --git a/device/tun/opts.go b/component/device/tun/opts.go similarity index 100% rename from device/tun/opts.go rename to component/device/tun/opts.go diff --git a/device/tun/tun.go b/component/device/tun/tun.go similarity index 79% rename from device/tun/tun.go rename to component/device/tun/tun.go index 53dfa8d..8022c64 100755 --- a/device/tun/tun.go +++ b/component/device/tun/tun.go @@ -2,7 +2,7 @@ package tun import ( - "github.com/xjasonlyu/tun2socks/device" + "github.com/xjasonlyu/tun2socks/component/device" ) const Driver = "tun" diff --git a/device/tun/tun_linux.go b/component/device/tun/tun_linux.go similarity index 97% rename from device/tun/tun_linux.go rename to component/device/tun/tun_linux.go index 55d0802..55e712b 100755 --- a/device/tun/tun_linux.go +++ b/component/device/tun/tun_linux.go @@ -5,7 +5,7 @@ import ( "fmt" "unsafe" - "github.com/xjasonlyu/tun2socks/device" + "github.com/xjasonlyu/tun2socks/component/device" "golang.org/x/sys/unix" "gvisor.dev/gvisor/pkg/tcpip/link/fdbased" diff --git a/device/tun/tun_wg.go b/component/device/tun/tun_wg.go similarity index 92% rename from device/tun/tun_wg.go rename to component/device/tun/tun_wg.go index d7bfb4b..a04f40c 100755 --- a/device/tun/tun_wg.go +++ b/component/device/tun/tun_wg.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/xjasonlyu/tun2socks/common/pool" - "github.com/xjasonlyu/tun2socks/device" - "github.com/xjasonlyu/tun2socks/device/rwbased" + "github.com/xjasonlyu/tun2socks/component/device" + "github.com/xjasonlyu/tun2socks/component/device/rwbased" "golang.zx2c4.com/wireguard/tun" ) diff --git a/stack/handler.go b/component/stack/handler.go similarity index 100% rename from stack/handler.go rename to component/stack/handler.go diff --git a/stack/icmp.go b/component/stack/icmp.go similarity index 100% rename from stack/icmp.go rename to component/stack/icmp.go diff --git a/stack/nic.go b/component/stack/nic.go similarity index 100% rename from stack/nic.go rename to component/stack/nic.go diff --git a/stack/opts.go b/component/stack/opts.go similarity index 100% rename from stack/opts.go rename to component/stack/opts.go diff --git a/stack/stack.go b/component/stack/stack.go similarity index 100% rename from stack/stack.go rename to component/stack/stack.go diff --git a/stack/tcp.go b/component/stack/tcp.go similarity index 100% rename from stack/tcp.go rename to component/stack/tcp.go diff --git a/stack/udp.go b/component/stack/udp.go similarity index 100% rename from stack/udp.go rename to component/stack/udp.go diff --git a/engine/engine.go b/engine/engine.go index 1faf114..c499c3c 100755 --- a/engine/engine.go +++ b/engine/engine.go @@ -3,11 +3,11 @@ package engine import ( "errors" + "github.com/xjasonlyu/tun2socks/component/device" "github.com/xjasonlyu/tun2socks/component/dialer" - "github.com/xjasonlyu/tun2socks/device" + "github.com/xjasonlyu/tun2socks/component/stack" "github.com/xjasonlyu/tun2socks/log" "github.com/xjasonlyu/tun2socks/proxy" - "github.com/xjasonlyu/tun2socks/stack" "github.com/xjasonlyu/tun2socks/stats" ) diff --git a/engine/parse.go b/engine/parse.go index 20ee46f..3b10845 100644 --- a/engine/parse.go +++ b/engine/parse.go @@ -6,8 +6,8 @@ import ( "net/url" "strings" - "github.com/xjasonlyu/tun2socks/device" - "github.com/xjasonlyu/tun2socks/device/tun" + "github.com/xjasonlyu/tun2socks/component/device" + "github.com/xjasonlyu/tun2socks/component/device/tun" "github.com/xjasonlyu/tun2socks/proxy" "github.com/xjasonlyu/tun2socks/proxy/proto" ) diff --git a/engine/tunnel.go b/engine/tunnel.go index 3fb771d..df258f3 100644 --- a/engine/tunnel.go +++ b/engine/tunnel.go @@ -2,7 +2,7 @@ package engine import ( "github.com/xjasonlyu/tun2socks/common/adapter" - "github.com/xjasonlyu/tun2socks/stack" + "github.com/xjasonlyu/tun2socks/component/stack" "github.com/xjasonlyu/tun2socks/tunnel" )