mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 01:07:03 +08:00
Refactor: autonomize core package
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
package stack
|
||||
|
||||
import (
|
||||
"github.com/xjasonlyu/tun2socks/core"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ipv6"
|
||||
@@ -14,12 +16,12 @@ import (
|
||||
type Stack struct {
|
||||
*stack.Stack
|
||||
|
||||
handler Handler
|
||||
handler core.Handler
|
||||
nicID tcpip.NICID
|
||||
}
|
||||
|
||||
// New allocates a new *Stack with given options.
|
||||
func New(ep stack.LinkEndpoint, handler Handler, opts ...Option) (*Stack, error) {
|
||||
func New(ep stack.LinkEndpoint, handler core.Handler, opts ...Option) (*Stack, error) {
|
||||
s := &Stack{
|
||||
Stack: stack.New(stack.Options{
|
||||
NetworkProtocols: []stack.NetworkProtocolFactory{
|
||||
|
Reference in New Issue
Block a user