tap

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 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(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

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(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

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) Wait

func (e *LinkEndpoint) Wait()

func (*LinkEndpoint) WritePacket

func (*LinkEndpoint) WritePackets

func (*LinkEndpoint) WriteRawPacket

func (e *LinkEndpoint) WriteRawPacket(vv buffer.VectorisedView) tcpip.Error

type NetworkSwitch

type NetworkSwitch interface {
	DeliverNetworkPacket(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
}

type Switch

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

func NewSwitch

func NewSwitch(debug bool, mtu int, protocol types.Protocol) *Switch

func (*Switch) Accept

func (e *Switch) Accept(ctx context.Context, conn net.Conn) 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(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

type VirtualDevice

type VirtualDevice interface {
	DeliverNetworkPacket(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
	LinkAddress() tcpip.LinkAddress
	IP() string
}

Jump to

Keyboard shortcuts

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