Add system stack
This commit is contained in:
parent
0efafc9963
commit
2f15b0cd3f
26 changed files with 1713 additions and 79 deletions
19
gvisor.go
19
gvisor.go
|
|
@ -41,25 +41,20 @@ type GVisorTun interface {
|
|||
}
|
||||
|
||||
func NewGVisor(
|
||||
ctx context.Context,
|
||||
tun Tun,
|
||||
tunMtu uint32,
|
||||
endpointIndependentNat bool,
|
||||
udpTimeout int64,
|
||||
handler Handler,
|
||||
options StackOptions,
|
||||
) (Stack, error) {
|
||||
gTun, isGTun := tun.(GVisorTun)
|
||||
gTun, isGTun := options.Tun.(GVisorTun)
|
||||
if !isGTun {
|
||||
return nil, ErrGVisorUnsupported
|
||||
}
|
||||
|
||||
return &GVisor{
|
||||
ctx: ctx,
|
||||
ctx: options.Context,
|
||||
tun: gTun,
|
||||
tunMtu: tunMtu,
|
||||
endpointIndependentNat: endpointIndependentNat,
|
||||
udpTimeout: udpTimeout,
|
||||
handler: handler,
|
||||
tunMtu: options.MTU,
|
||||
endpointIndependentNat: options.EndpointIndependentNat,
|
||||
udpTimeout: options.UDPTimeout,
|
||||
handler: options.Handler,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue