face

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 30 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FaceFlagLocalFields = 1 << iota
	FaceFlagLpReliabilityEnabled
	FaceFlagCongestionMarking
)

Variables

View Source
var TCPUnicastPort uint16

TCPUnicastPort is the standard unicast TCP port for NDN.

View Source
var UDPMulticastPort uint16

UDPMulticastPort is the standard multicast UDP port for NDN.

View Source
var UDPUnicastPort uint16

UDPUnicastPort is the standard unicast UDP port for NDN.

View Source
var UnixSocketPath string

UnixSocketPath is the standard Unix socket file path for NDN.

Functions

func Configure

func Configure()

Configure configures the face system.

func InterfaceByIP

func InterfaceByIP(ip net.IP) (*net.Interface, error)

InterfaceByIP gets an interface by its IP address.

func InterfaceByMAC

func InterfaceByMAC(mac net.HardwareAddr) (*net.Interface, error)

InterfaceByMAC gets an interface by its MAC address.

func ReadPacketUnverified added in v1.4.2

func ReadPacketUnverified(reader enc.ParseReader) (*spec.Packet, error)

Reads a packet without validating the internal fields

func RegisterInternalTransport

func RegisterInternalTransport() (LinkService, *InternalTransport)

RegisterInternalTransport creates, registers, and starts an InternalTransport.

Types

type InternalTransport

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

InternalTransport is a transport for use by internal YaNFD modules (e.g., management).

func MakeInternalTransport

func MakeInternalTransport() *InternalTransport

MakeInternalTransport makes an InternalTransport.

func (*InternalTransport) Close

func (t *InternalTransport) Close()

func (*InternalTransport) ExpirationPeriod

func (t *InternalTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*InternalTransport) FaceID

func (t *InternalTransport) FaceID() uint64

func (*InternalTransport) GetSendQueueSize

func (t *InternalTransport) GetSendQueueSize() uint64

GetSendQueueSize returns the current size of the send queue.

func (*InternalTransport) IsRunning

func (t *InternalTransport) IsRunning() bool

func (*InternalTransport) LinkType

func (t *InternalTransport) LinkType() defn.LinkType

func (*InternalTransport) LocalURI

func (t *InternalTransport) LocalURI() *defn.URI

func (*InternalTransport) MTU

func (t *InternalTransport) MTU() int

func (*InternalTransport) NInBytes

func (t *InternalTransport) NInBytes() uint64

func (*InternalTransport) NOutBytes

func (t *InternalTransport) NOutBytes() uint64

func (*InternalTransport) Persistency

func (t *InternalTransport) Persistency() spec_mgmt.Persistency

func (*InternalTransport) Receive

func (t *InternalTransport) Receive() (enc.Wire, []byte, uint64)

Receive receives a packet from the perspective of the internal component.

func (*InternalTransport) RemoteURI

func (t *InternalTransport) RemoteURI() *defn.URI

func (*InternalTransport) Scope

func (t *InternalTransport) Scope() defn.Scope

func (*InternalTransport) Send

func (t *InternalTransport) Send(netWire enc.Wire, pitToken []byte, nextHopFaceID *uint64)

Send sends a packet from the perspective of the internal component.

func (*InternalTransport) SetMTU

func (t *InternalTransport) SetMTU(mtu int)

func (*InternalTransport) SetPersistency

func (t *InternalTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

SetPersistency changes the persistency of the face.

func (*InternalTransport) String

func (t *InternalTransport) String() string

type LinkService

type LinkService interface {
	String() string
	Transport() transport
	SetFaceID(faceID uint64)

	FaceID() uint64
	LocalURI() *defn.URI
	RemoteURI() *defn.URI
	Persistency() spec_mgmt.Persistency
	SetPersistency(persistency spec_mgmt.Persistency)
	Scope() defn.Scope
	LinkType() defn.LinkType
	MTU() int
	SetMTU(mtu int)

	ExpirationPeriod() time.Duration
	State() defn.State

	// Run is the main entry point for running face thread
	// initial is optional new incoming frame
	Run(initial []byte)

	// Add a packet to the send queue for this link service
	SendPacket(out dispatch.OutPkt)

	// Close the face
	Close()

	// Counters
	NInInterests() uint64
	NInData() uint64
	NInBytes() uint64
	NOutInterests() uint64
	NOutData() uint64
	NOutBytes() uint64
	// contains filtered or unexported methods
}

LinkService is an interface for link service implementations

type Listener

type Listener interface {
	String() string
	Run()
	Close()
}

Listener listens for incoming unicast connections for a transport type.

type MulticastUDPTransport

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

MulticastUDPTransport is a multicast UDP transport.

func MakeMulticastUDPTransport

func MakeMulticastUDPTransport(localURI *defn.URI) (*MulticastUDPTransport, error)

MakeMulticastUDPTransport creates a new multicast UDP transport.

func (*MulticastUDPTransport) Close

func (t *MulticastUDPTransport) Close()

func (*MulticastUDPTransport) ExpirationPeriod

func (t *MulticastUDPTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*MulticastUDPTransport) FaceID

func (t *MulticastUDPTransport) FaceID() uint64

func (*MulticastUDPTransport) GetSendQueueSize

func (t *MulticastUDPTransport) GetSendQueueSize() uint64

func (*MulticastUDPTransport) IsRunning

func (t *MulticastUDPTransport) IsRunning() bool

func (*MulticastUDPTransport) LinkType

func (t *MulticastUDPTransport) LinkType() defn.LinkType

func (*MulticastUDPTransport) LocalURI

func (t *MulticastUDPTransport) LocalURI() *defn.URI

func (*MulticastUDPTransport) MTU

func (t *MulticastUDPTransport) MTU() int

func (*MulticastUDPTransport) NInBytes

func (t *MulticastUDPTransport) NInBytes() uint64

func (*MulticastUDPTransport) NOutBytes

func (t *MulticastUDPTransport) NOutBytes() uint64

func (*MulticastUDPTransport) Persistency

func (t *MulticastUDPTransport) Persistency() spec_mgmt.Persistency

func (*MulticastUDPTransport) RemoteURI

func (t *MulticastUDPTransport) RemoteURI() *defn.URI

func (*MulticastUDPTransport) Scope

func (t *MulticastUDPTransport) Scope() defn.Scope

func (*MulticastUDPTransport) SetMTU

func (t *MulticastUDPTransport) SetMTU(mtu int)

func (*MulticastUDPTransport) SetPersistency

func (t *MulticastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

func (*MulticastUDPTransport) String

func (t *MulticastUDPTransport) String() string

type NDNLPLinkService

type NDNLPLinkService struct {
	BufferReader enc.BufferReader
	// contains filtered or unexported fields
}

NDNLPLinkService is a link service implementing the NDNLPv2 link protocol

func MakeNDNLPLinkService

func MakeNDNLPLinkService(transport transport, options NDNLPLinkServiceOptions) *NDNLPLinkService

MakeNDNLPLinkService creates a new NDNLPv2 link service

func (*NDNLPLinkService) Close

func (l *NDNLPLinkService) Close()

Close the underlying transport

func (*NDNLPLinkService) ExpirationPeriod

func (l *NDNLPLinkService) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until the underlying transport expires. If transport not on-demand, returns 0.

func (*NDNLPLinkService) FaceID

func (l *NDNLPLinkService) FaceID() uint64

FaceID returns the ID of the face

func (*NDNLPLinkService) LinkType

func (l *NDNLPLinkService) LinkType() defn.LinkType

LinkType returns the type of the link.

func (*NDNLPLinkService) LocalURI

func (l *NDNLPLinkService) LocalURI() *defn.URI

LocalURI returns the local URI of the underlying transport

func (*NDNLPLinkService) MTU

func (l *NDNLPLinkService) MTU() int

MTU returns the MTU of the underlying transport.

func (*NDNLPLinkService) NInBytes

func (l *NDNLPLinkService) NInBytes() uint64

NInBytes returns the number of link-layer bytes received on this face.

func (*NDNLPLinkService) NInData

func (l *NDNLPLinkService) NInData() uint64

NInData returns the number of Data packets received on this face.

func (*NDNLPLinkService) NInInterests

func (l *NDNLPLinkService) NInInterests() uint64

NInInterests returns the number of Interests received on this face.

func (*NDNLPLinkService) NOutBytes

func (l *NDNLPLinkService) NOutBytes() uint64

NOutBytes returns the number of link-layer bytes sent on this face.

func (*NDNLPLinkService) NOutData

func (l *NDNLPLinkService) NOutData() uint64

NInData returns the number of Data packets sent on this face.

func (*NDNLPLinkService) NOutInterests

func (l *NDNLPLinkService) NOutInterests() uint64

NOutInterests returns the number of Interests sent on this face.

func (*NDNLPLinkService) Options

Options gets the settings of the NDNLPLinkService.

func (*NDNLPLinkService) Persistency

func (l *NDNLPLinkService) Persistency() spec_mgmt.Persistency

Persistency returns the MTU of the underlying transport.

func (*NDNLPLinkService) RemoteURI

func (l *NDNLPLinkService) RemoteURI() *defn.URI

RemoteURI returns the remote URI of the underlying transport

func (*NDNLPLinkService) Run

func (l *NDNLPLinkService) Run(initial []byte)

Run starts the face and associated goroutines

func (*NDNLPLinkService) Scope

func (l *NDNLPLinkService) Scope() defn.Scope

Scope returns the scope of the underlying transport.

func (*NDNLPLinkService) SendPacket

func (l *NDNLPLinkService) SendPacket(out dispatch.OutPkt)

SendPacket adds a packet to the send queue for this link service

func (*NDNLPLinkService) SetFaceID

func (l *NDNLPLinkService) SetFaceID(faceID uint64)

func (*NDNLPLinkService) SetMTU

func (l *NDNLPLinkService) SetMTU(mtu int)

SetMTU sets the MTU of the underlying transport.

func (*NDNLPLinkService) SetOptions

func (l *NDNLPLinkService) SetOptions(options NDNLPLinkServiceOptions)

SetOptions changes the settings of the NDNLPLinkService.

func (*NDNLPLinkService) SetPersistency

func (l *NDNLPLinkService) SetPersistency(persistency spec_mgmt.Persistency)

SetPersistency sets the MTU of the underlying transport.

func (*NDNLPLinkService) State

func (l *NDNLPLinkService) State() defn.State

State returns the state of the underlying transport.

func (*NDNLPLinkService) String

func (l *NDNLPLinkService) String() string

func (*NDNLPLinkService) Transport

func (l *NDNLPLinkService) Transport() transport

Transport returns the transport for the face.

type NDNLPLinkServiceOptions

type NDNLPLinkServiceOptions struct {
	IsFragmentationEnabled bool
	IsReassemblyEnabled    bool

	IsConsumerControlledForwardingEnabled bool

	IsIncomingFaceIndicationEnabled bool

	IsLocalCachePolicyEnabled bool

	IsCongestionMarkingEnabled bool

	BaseCongestionMarkingInterval   time.Duration
	DefaultCongestionThresholdBytes uint64
}

NDNLPLinkServiceOptions contains the settings for an NDNLPLinkService.

func MakeNDNLPLinkServiceOptions

func MakeNDNLPLinkServiceOptions() NDNLPLinkServiceOptions

func (*NDNLPLinkServiceOptions) Flags

func (op *NDNLPLinkServiceOptions) Flags() (ret uint64)

type NullLinkService

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

NullLinkService is a link service that drops all packets.

func MakeNullLinkService

func MakeNullLinkService(transport transport) *NullLinkService

MakeNullLinkService makes a NullLinkService.

func (*NullLinkService) Close

func (l *NullLinkService) Close()

Close the underlying transport

func (*NullLinkService) ExpirationPeriod

func (l *NullLinkService) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until the underlying transport expires. If transport not on-demand, returns 0.

func (*NullLinkService) FaceID

func (l *NullLinkService) FaceID() uint64

FaceID returns the ID of the face

func (*NullLinkService) LinkType

func (l *NullLinkService) LinkType() defn.LinkType

LinkType returns the type of the link.

func (*NullLinkService) LocalURI

func (l *NullLinkService) LocalURI() *defn.URI

LocalURI returns the local URI of the underlying transport

func (*NullLinkService) MTU

func (l *NullLinkService) MTU() int

MTU returns the MTU of the underlying transport.

func (*NullLinkService) NInBytes

func (l *NullLinkService) NInBytes() uint64

NInBytes returns the number of link-layer bytes received on this face.

func (*NullLinkService) NInData

func (l *NullLinkService) NInData() uint64

NInData returns the number of Data packets received on this face.

func (*NullLinkService) NInInterests

func (l *NullLinkService) NInInterests() uint64

NInInterests returns the number of Interests received on this face.

func (*NullLinkService) NOutBytes

func (l *NullLinkService) NOutBytes() uint64

NOutBytes returns the number of link-layer bytes sent on this face.

func (*NullLinkService) NOutData

func (l *NullLinkService) NOutData() uint64

NInData returns the number of Data packets sent on this face.

func (*NullLinkService) NOutInterests

func (l *NullLinkService) NOutInterests() uint64

NOutInterests returns the number of Interests sent on this face.

func (*NullLinkService) Persistency

func (l *NullLinkService) Persistency() spec_mgmt.Persistency

Persistency returns the MTU of the underlying transport.

func (*NullLinkService) RemoteURI

func (l *NullLinkService) RemoteURI() *defn.URI

RemoteURI returns the remote URI of the underlying transport

func (*NullLinkService) Run

func (l *NullLinkService) Run(initial []byte)

Run runs the NullLinkService.

func (*NullLinkService) Scope

func (l *NullLinkService) Scope() defn.Scope

Scope returns the scope of the underlying transport.

func (*NullLinkService) SendPacket

func (l *NullLinkService) SendPacket(out dispatch.OutPkt)

SendPacket adds a packet to the send queue for this link service

func (*NullLinkService) SetFaceID

func (l *NullLinkService) SetFaceID(faceID uint64)

func (*NullLinkService) SetMTU

func (l *NullLinkService) SetMTU(mtu int)

SetMTU sets the MTU of the underlying transport.

func (*NullLinkService) SetPersistency

func (l *NullLinkService) SetPersistency(persistency spec_mgmt.Persistency)

SetPersistency sets the MTU of the underlying transport.

func (*NullLinkService) State

func (l *NullLinkService) State() defn.State

State returns the state of the underlying transport.

func (*NullLinkService) String

func (l *NullLinkService) String() string

func (*NullLinkService) Transport

func (l *NullLinkService) Transport() transport

Transport returns the transport for the face.

type NullTransport

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

NullTransport is a transport that drops all packets.

func MakeNullTransport

func MakeNullTransport() *NullTransport

MakeNullTransport makes a NullTransport.

func (*NullTransport) Close

func (t *NullTransport) Close()

func (*NullTransport) ExpirationPeriod

func (t *NullTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*NullTransport) FaceID

func (t *NullTransport) FaceID() uint64

func (*NullTransport) GetSendQueueSize

func (t *NullTransport) GetSendQueueSize() uint64

GetSendQueueSize returns the current size of the send queue.

func (*NullTransport) IsRunning

func (t *NullTransport) IsRunning() bool

func (*NullTransport) LinkType

func (t *NullTransport) LinkType() defn.LinkType

func (*NullTransport) LocalURI

func (t *NullTransport) LocalURI() *defn.URI

func (*NullTransport) MTU

func (t *NullTransport) MTU() int

func (*NullTransport) NInBytes

func (t *NullTransport) NInBytes() uint64

func (*NullTransport) NOutBytes

func (t *NullTransport) NOutBytes() uint64

func (*NullTransport) Persistency

func (t *NullTransport) Persistency() spec_mgmt.Persistency

func (*NullTransport) RemoteURI

func (t *NullTransport) RemoteURI() *defn.URI

func (*NullTransport) Scope

func (t *NullTransport) Scope() defn.Scope

func (*NullTransport) SetMTU

func (t *NullTransport) SetMTU(mtu int)

func (*NullTransport) SetPersistency

func (t *NullTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

SetPersistency changes the persistency of the face.

func (*NullTransport) String

func (t *NullTransport) String() string

type TCPListener

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

TCPListener listens for incoming TCP unicast connections.

func MakeTCPListener

func MakeTCPListener(localURI *defn.URI) (*TCPListener, error)

MakeTCPListener constructs a TCPListener.

func (*TCPListener) Close

func (l *TCPListener) Close()

func (*TCPListener) Run

func (l *TCPListener) Run()

func (*TCPListener) String

func (l *TCPListener) String() string

type Table

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

Table hold all faces used by the forwarder.

var FaceTable Table

FaceTable is the global face table for this forwarder

func (*Table) Add

func (t *Table) Add(face LinkService)

Add adds a face to the face table.

func (*Table) ExpirationHandler

func (t *Table) ExpirationHandler()

ExpirationHandler stops the faces that have expired

func (*Table) Get

func (t *Table) Get(id uint64) LinkService

Get gets the face with the specified ID (if any) from the face table.

func (*Table) GetAll

func (t *Table) GetAll() []LinkService

GetAll returns points to all faces.

func (*Table) GetByURI

func (t *Table) GetByURI(remoteURI *defn.URI) LinkService

GetByURI gets the face with the specified remote URI (if any) from the face table.

func (*Table) Remove

func (t *Table) Remove(id uint64)

Remove removes a face from the face table.

func (*Table) String

func (t *Table) String() string

type UDPListener

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

UDPListener listens for incoming UDP unicast connections.

func MakeUDPListener

func MakeUDPListener(localURI *defn.URI) (*UDPListener, error)

MakeUDPListener constructs a UDPListener.

func (*UDPListener) Close

func (l *UDPListener) Close()

func (*UDPListener) Run

func (l *UDPListener) Run()

Run starts the UDP listener.

func (*UDPListener) String

func (l *UDPListener) String() string

type UnicastTCPTransport

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

UnicastTCPTransport is a unicast TCP transport.

func AcceptUnicastTCPTransport

func AcceptUnicastTCPTransport(
	remoteConn net.Conn,
	localURI *defn.URI,
	persistency spec_mgmt.Persistency,
) (*UnicastTCPTransport, error)

Accept an incoming unicast TCP transport.

func MakeUnicastTCPTransport

func MakeUnicastTCPTransport(
	remoteURI *defn.URI,
	localURI *defn.URI,
	persistency spec_mgmt.Persistency,
) (*UnicastTCPTransport, error)

Makes an outgoing unicast TCP transport.

func (*UnicastTCPTransport) Close

func (t *UnicastTCPTransport) Close()

Close the connection permanently - this will not attempt to reconnect.

func (*UnicastTCPTransport) CloseConn

func (t *UnicastTCPTransport) CloseConn()

Close the inner connection if running without closing the transport.

func (*UnicastTCPTransport) ExpirationPeriod

func (t *UnicastTCPTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*UnicastTCPTransport) FaceID

func (t *UnicastTCPTransport) FaceID() uint64

func (*UnicastTCPTransport) GetSendQueueSize

func (t *UnicastTCPTransport) GetSendQueueSize() uint64

func (*UnicastTCPTransport) IsRunning

func (t *UnicastTCPTransport) IsRunning() bool

func (*UnicastTCPTransport) LinkType

func (t *UnicastTCPTransport) LinkType() defn.LinkType

func (*UnicastTCPTransport) LocalURI

func (t *UnicastTCPTransport) LocalURI() *defn.URI

func (*UnicastTCPTransport) MTU

func (t *UnicastTCPTransport) MTU() int

func (*UnicastTCPTransport) NInBytes

func (t *UnicastTCPTransport) NInBytes() uint64

func (*UnicastTCPTransport) NOutBytes

func (t *UnicastTCPTransport) NOutBytes() uint64

func (*UnicastTCPTransport) Persistency

func (t *UnicastTCPTransport) Persistency() spec_mgmt.Persistency

func (*UnicastTCPTransport) RemoteURI

func (t *UnicastTCPTransport) RemoteURI() *defn.URI

func (*UnicastTCPTransport) Scope

func (t *UnicastTCPTransport) Scope() defn.Scope

func (*UnicastTCPTransport) SetMTU

func (t *UnicastTCPTransport) SetMTU(mtu int)

func (*UnicastTCPTransport) SetPersistency

func (t *UnicastTCPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

func (*UnicastTCPTransport) String

func (t *UnicastTCPTransport) String() string

type UnicastUDPTransport

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

UnicastUDPTransport is a unicast UDP transport.

func MakeUnicastUDPTransport

func MakeUnicastUDPTransport(
	remoteURI *defn.URI,
	localURI *defn.URI,
	persistency spec_mgmt.Persistency,
) (*UnicastUDPTransport, error)

MakeUnicastUDPTransport creates a new unicast UDP transport.

func (*UnicastUDPTransport) Close

func (t *UnicastUDPTransport) Close()

func (*UnicastUDPTransport) ExpirationPeriod

func (t *UnicastUDPTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*UnicastUDPTransport) FaceID

func (t *UnicastUDPTransport) FaceID() uint64

func (*UnicastUDPTransport) GetSendQueueSize

func (t *UnicastUDPTransport) GetSendQueueSize() uint64

func (*UnicastUDPTransport) IsRunning

func (t *UnicastUDPTransport) IsRunning() bool

func (*UnicastUDPTransport) LinkType

func (t *UnicastUDPTransport) LinkType() defn.LinkType

func (*UnicastUDPTransport) LocalURI

func (t *UnicastUDPTransport) LocalURI() *defn.URI

func (*UnicastUDPTransport) MTU

func (t *UnicastUDPTransport) MTU() int

func (*UnicastUDPTransport) NInBytes

func (t *UnicastUDPTransport) NInBytes() uint64

func (*UnicastUDPTransport) NOutBytes

func (t *UnicastUDPTransport) NOutBytes() uint64

func (*UnicastUDPTransport) Persistency

func (t *UnicastUDPTransport) Persistency() spec_mgmt.Persistency

func (*UnicastUDPTransport) RemoteURI

func (t *UnicastUDPTransport) RemoteURI() *defn.URI

func (*UnicastUDPTransport) Scope

func (t *UnicastUDPTransport) Scope() defn.Scope

func (*UnicastUDPTransport) SetMTU

func (t *UnicastUDPTransport) SetMTU(mtu int)

func (*UnicastUDPTransport) SetPersistency

func (t *UnicastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

func (*UnicastUDPTransport) String

func (t *UnicastUDPTransport) String() string

type UnixStreamListener

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

UnixStreamListener listens for incoming Unix stream connections.

func MakeUnixStreamListener

func MakeUnixStreamListener(localURI *defn.URI) (*UnixStreamListener, error)

MakeUnixStreamListener constructs a UnixStreamListener.

func (*UnixStreamListener) Close

func (l *UnixStreamListener) Close()

func (*UnixStreamListener) Run

func (l *UnixStreamListener) Run()

func (*UnixStreamListener) String

func (l *UnixStreamListener) String() string

type UnixStreamTransport

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

UnixStreamTransport is a Unix stream transport for communicating with local applications.

func MakeUnixStreamTransport

func MakeUnixStreamTransport(remoteURI *defn.URI, localURI *defn.URI, conn net.Conn) (*UnixStreamTransport, error)

MakeUnixStreamTransport creates a Unix stream transport.

func (*UnixStreamTransport) Close

func (t *UnixStreamTransport) Close()

func (*UnixStreamTransport) ExpirationPeriod

func (t *UnixStreamTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*UnixStreamTransport) FaceID

func (t *UnixStreamTransport) FaceID() uint64

func (*UnixStreamTransport) GetSendQueueSize

func (t *UnixStreamTransport) GetSendQueueSize() uint64

GetSendQueueSize returns the current size of the send queue.

func (*UnixStreamTransport) IsRunning

func (t *UnixStreamTransport) IsRunning() bool

func (*UnixStreamTransport) LinkType

func (t *UnixStreamTransport) LinkType() defn.LinkType

func (*UnixStreamTransport) LocalURI

func (t *UnixStreamTransport) LocalURI() *defn.URI

func (*UnixStreamTransport) MTU

func (t *UnixStreamTransport) MTU() int

func (*UnixStreamTransport) NInBytes

func (t *UnixStreamTransport) NInBytes() uint64

func (*UnixStreamTransport) NOutBytes

func (t *UnixStreamTransport) NOutBytes() uint64

func (*UnixStreamTransport) Persistency

func (t *UnixStreamTransport) Persistency() spec_mgmt.Persistency

func (*UnixStreamTransport) RemoteURI

func (t *UnixStreamTransport) RemoteURI() *defn.URI

func (*UnixStreamTransport) Scope

func (t *UnixStreamTransport) Scope() defn.Scope

func (*UnixStreamTransport) SetMTU

func (t *UnixStreamTransport) SetMTU(mtu int)

func (*UnixStreamTransport) SetPersistency

func (t *UnixStreamTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

SetPersistency changes the persistency of the face.

func (*UnixStreamTransport) String

func (t *UnixStreamTransport) String() string

type WebSocketListener

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

WebSocketListener listens for incoming WebSockets connections.

func NewWebSocketListener

func NewWebSocketListener(cfg WebSocketListenerConfig) (*WebSocketListener, error)

func (*WebSocketListener) Close

func (l *WebSocketListener) Close()

func (*WebSocketListener) Run

func (l *WebSocketListener) Run()

func (*WebSocketListener) String

func (l *WebSocketListener) String() string

type WebSocketListenerConfig

type WebSocketListenerConfig struct {
	Bind       string
	Port       uint16
	TLSEnabled bool
	TLSCert    string
	TLSKey     string
}

WebSocketListenerConfig contains WebSocketListener configuration.

func (WebSocketListenerConfig) String

func (cfg WebSocketListenerConfig) String() string

func (WebSocketListenerConfig) URL

func (cfg WebSocketListenerConfig) URL() *url.URL

type WebSocketTransport

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

WebSocketTransport communicates with web applications via WebSocket.

func NewWebSocketTransport

func NewWebSocketTransport(localURI *defn.URI, c *websocket.Conn) (t *WebSocketTransport)

func (*WebSocketTransport) Close

func (t *WebSocketTransport) Close()

func (*WebSocketTransport) ExpirationPeriod

func (t *WebSocketTransport) ExpirationPeriod() time.Duration

ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.

func (*WebSocketTransport) FaceID

func (t *WebSocketTransport) FaceID() uint64

func (*WebSocketTransport) GetSendQueueSize

func (t *WebSocketTransport) GetSendQueueSize() uint64

func (*WebSocketTransport) IsRunning

func (t *WebSocketTransport) IsRunning() bool

func (*WebSocketTransport) LinkType

func (t *WebSocketTransport) LinkType() defn.LinkType

func (*WebSocketTransport) LocalURI

func (t *WebSocketTransport) LocalURI() *defn.URI

func (*WebSocketTransport) MTU

func (t *WebSocketTransport) MTU() int

func (*WebSocketTransport) NInBytes

func (t *WebSocketTransport) NInBytes() uint64

func (*WebSocketTransport) NOutBytes

func (t *WebSocketTransport) NOutBytes() uint64

func (*WebSocketTransport) Persistency

func (t *WebSocketTransport) Persistency() spec_mgmt.Persistency

func (*WebSocketTransport) RemoteURI

func (t *WebSocketTransport) RemoteURI() *defn.URI

func (*WebSocketTransport) Scope

func (t *WebSocketTransport) Scope() defn.Scope

func (*WebSocketTransport) SetMTU

func (t *WebSocketTransport) SetMTU(mtu int)

func (*WebSocketTransport) SetPersistency

func (t *WebSocketTransport) SetPersistency(persistency spec_mgmt.Persistency) bool

func (*WebSocketTransport) String

func (t *WebSocketTransport) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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