Refactor: use core/adapter

This commit is contained in:
xjasonlyu
2022-02-06 20:26:09 +08:00
parent 93a5ff5d86
commit edec658cd0
7 changed files with 20 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
package stack
import (
"github.com/xjasonlyu/tun2socks/v2/core"
"github.com/xjasonlyu/tun2socks/v2/core/adapter"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
@@ -16,12 +16,12 @@ import (
type Stack struct {
*stack.Stack
handler core.Handler
handler adapter.Handler
nicID tcpip.NICID
}
// New allocates a new *Stack with given options.
func New(ep stack.LinkEndpoint, handler core.Handler, opts ...Option) (*Stack, error) {
func New(ep stack.LinkEndpoint, handler adapter.Handler, opts ...Option) (*Stack, error) {
s := &Stack{
Stack: stack.New(stack.Options{
NetworkProtocols: []stack.NetworkProtocolFactory{