tap

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPPool

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

func NewIPPool

func NewIPPool(base *net.IPNet) *IPPool

func (*IPPool) GetOrAssign

func (p *IPPool) GetOrAssign(mac string) (net.IP, error)

func (*IPPool) Leases

func (p *IPPool) Leases() map[string]string

func (*IPPool) Mask

func (p *IPPool) Mask() int

func (*IPPool) Release

func (p *IPPool) Release(given string)

func (*IPPool) Reserve

func (p *IPPool) Reserve(ip net.IP, mac string)

type LinkEndpoint

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

func NewLinkEndpoint

func NewLinkEndpoint(debug bool, mtu int, macAddress string, ip string, virtualIPs []string) (*LinkEndpoint, error)

func (*LinkEndpoint) ARPHardwareType

func (e *LinkEndpoint) ARPHardwareType() header.ARPHardwareType

func (*LinkEndpoint) AddHeader

func (e *LinkEndpoint) AddHeader(_ stack.PacketBufferPtr)

func (*LinkEndpoint) Attach

func (e *LinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)

func (*LinkEndpoint) Capabilities

func (e *LinkEndpoint) Capabilities() stack.LinkEndpointCapabilities

func (*LinkEndpoint) Connect

func (e *LinkEndpoint) Connect(networkSwitch NetworkSwitch)

func (*LinkEndpoint) DeliverNetworkPacket

func (e *LinkEndpoint) DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt stack.PacketBufferPtr)

func (*LinkEndpoint) IP

func (e *LinkEndpoint) IP() string

func (*LinkEndpoint) IsAttached

func (e *LinkEndpoint) IsAttached() bool

func (*LinkEndpoint) LinkAddress

func (e *LinkEndpoint) LinkAddress() tcpip.LinkAddress

func (*LinkEndpoint) MTU

func (e *LinkEndpoint) MTU() uint32

func (*LinkEndpoint) MaxHeaderLength

func (e *LinkEndpoint) MaxHeaderLength() uint16

func (*LinkEndpoint) ParseHeader added in v0.7.0

func (e *LinkEndpoint) ParseHeader(stack.PacketBufferPtr) bool

func (*LinkEndpoint) Wait

func (e *LinkEndpoint) Wait()

func (*LinkEndpoint) WritePackets

func (e *LinkEndpoint) WritePackets(pkts stack.PacketBufferList) (int, tcpip.Error)

func (*LinkEndpoint) WriteRawPacket

func (e *LinkEndpoint) WriteRawPacket(_ stack.PacketBufferPtr) tcpip.Error

type NetworkSwitch

type NetworkSwitch interface {
	DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt stack.PacketBufferPtr)
}

type Switch

type Switch struct {
	Sent     uint64
	Received uint64
	// contains filtered or unexported fields
}

func NewSwitch

func NewSwitch(debug bool, mtu int) *Switch

func (*Switch) Accept

func (e *Switch) Accept(ctx context.Context, rawConn net.Conn, protocol types.Protocol) error

func (*Switch) CAM

func (e *Switch) CAM() map[string]int

func (*Switch) Connect

func (e *Switch) Connect(ep VirtualDevice)

func (*Switch) DeliverNetworkPacket

func (e *Switch) DeliverNetworkPacket(_ tcpip.NetworkProtocolNumber, pkt stack.PacketBufferPtr)

type VirtualDevice

type VirtualDevice interface {
	DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt stack.PacketBufferPtr)
	LinkAddress() tcpip.LinkAddress
	IP() string
}

Jump to

Keyboard shortcuts

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