netstack

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetStack

type NetStack struct {
	// contains filtered or unexported fields
}

NetStack is virtual network stack to attach services to.

func New

func New(instance instance, tunDevice *tun.Device) (*NetStack, error)

New returns an initialized API connected to the given tun device. Input packets must be submitted manually using SubmitPacket().

func (*NetStack) ListenTCP

func (ns *NetStack) ListenTCP(port uint16) (net.Listener, error)

ListenTCP returns a new listener on the given port of the API address.

func (*NetStack) ListenUDP

func (ns *NetStack) ListenUDP(port uint16) (net.PacketConn, error)

ListenUDP returns a new listener on the given port of the API address.

func (*NetStack) Start

func (ns *NetStack) Start(m *mgr.Manager) error

Start starts the API stack.

func (*NetStack) Stop

func (ns *NetStack) Stop(m *mgr.Manager) error

Stop stops the API stack.

func (*NetStack) SubmitPacket

func (ns *NetStack) SubmitPacket(packet []byte)

SubmitPacket is the send bridge to the API network stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL