Skip to main content

netstack

函数名函数描述/介绍
netstack.CreatePrivilegedDevice_createPrivilegedDevice creates a privileged TUN device with default MTU (1500)
netstack.CreatePrivilegedDeviceWithMTU_createPrivilegedDeviceWithMTU creates a privileged TUN device with specified MTU
netstack.GetSystemRouteManagerGetSystemRouteManager 获取系统路由管理器的单例实例
netstack.NewVMFromDevice_newVMFromDevice creates a network stack virtual machine from a TUN device The VM will hijack TCP connections and make them available via GetTCPConnCh...

函数定义#

CreatePrivilegedDevice#

详细描述#

_createPrivilegedDevice creates a privileged TUN device with default MTU (1500)

定义#

CreatePrivilegedDevice() (lowtun.Device, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1lowtun.Device
r2error

CreatePrivilegedDeviceWithMTU#

详细描述#

_createPrivilegedDeviceWithMTU creates a privileged TUN device with specified MTU

定义#

CreatePrivilegedDeviceWithMTU(mtu int) (lowtun.Device, error)

参数#

参数名参数类型参数解释
mtuint

返回值#

返回值(顺序)返回值类型返回值解释
r1lowtun.Device
r2error

GetSystemRouteManager#

详细描述#

GetSystemRouteManager 获取系统路由管理器的单例实例

定义#

GetSystemRouteManager() *SystemRouteManager

返回值#

返回值(顺序)返回值类型返回值解释
r1*SystemRouteManager

NewVMFromDevice#

详细描述#

_newVMFromDevice creates a network stack virtual machine from a TUN device The VM will hijack TCP connections and make them available via GetTCPConnChan()

定义#

NewVMFromDevice(device lowtun.Device) (*NetstackVM, error)

参数#

参数名参数类型参数解释
devicelowtun.Device

返回值#

返回值(顺序)返回值类型返回值解释
r1*NetstackVM
r2error