netstack

package
v0.0.0-...-e7d7f47 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	net.Conn
}

func NewConn

func NewConn(nc net.Conn) Conn

type Device

type Device interface {
	io.Closer
	core.Device
}

type Handler

type Handler interface {
	Handle(Conn, net.Addr) error
	HandlePacket(Packet, net.Addr) error
}

type Packet

type Packet interface {
	Data() []byte
	WriteBack(b []byte, addr net.Addr) (n int, err error)
	Drop()
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
}

type Stack

type Stack struct {
	core.Stack
	Handler Handler
}

func NewStack

func NewStack(handler Handler) *Stack

func (*Stack) Handle

func (s *Stack) Handle(conn *core.TCPConn)

func (*Stack) HandlePacket

func (s *Stack) HandlePacket(pkt *core.UDPPacket)

func (*Stack) Start

func (s *Stack) Start(device Device) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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