defn

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNDNPacketSize = 8800

MaxNDNPacketSize is the maximum allowed NDN packet size

Variables

Default forwarding strategy name

View Source
var ErrNotCanonical = errors.New("URI could not be canonized")

URL not canonical error

Localhost prefix for NFD

Non-local prefix for NFD

View Source
var STRATEGY_PREFIX = LOCAL_PREFIX.Append(enc.NewStringComponent(enc.TypeGenericNameComponent, "strategy"))

Prefix for all stratgies

Functions

This section is empty.

Types

type LinkType

type LinkType int

LinkType indicates what type of link a face is.

const (
	// PointToPoint is a face with one remote endpoint.
	PointToPoint LinkType = 0
	// MultiAccess is a face that communicates with a multicast group.
	MultiAccess LinkType = 1
	// AdHoc communicates on a wireless ad-hoc network.
	AdHoc LinkType = 2
)

type Pkt

type Pkt struct {
	Name enc.Name
	L3   *spec.Packet
	Raw  []byte

	PitToken       []byte
	CongestionMark *uint64
	CachePolicy    *uint64

	IncomingFaceID uint64
	NextHopFaceID  *uint64
}

Pkt represents a pending packet to be sent or recently received on the link, plus any associated metadata.

type Scope

type Scope int

Scope indicates the scope of a face

const (
	// Unknown indicates that the scope is unknown.
	Unknown Scope = -1
	// NonLocal indicates the face is non-local (to another forwarder).
	NonLocal Scope = 0
	// Local indicates the face is local (to an application).
	Local Scope = 1
)

type State

type State int

State indicates the state of a face

const (
	// Up indicates the face is up
	Up State = iota
	// Down indicates the face is down
	Down State = iota
	// AdminDown indicates the face is administratively down
	AdminDown State = iota
)

func (State) String

func (s State) String() string

type URI

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

URI represents a URI for a face.

func DecodeURIString

func DecodeURIString(str string) *URI

func MakeDevFaceURI

func MakeDevFaceURI(ifname string) *URI

MakeDevFaceURI constucts a URI for a network interface.

func MakeFDFaceURI

func MakeFDFaceURI(fd int) *URI

MakeFDFaceURI constructs a file descriptor URI.

func MakeInternalFaceURI

func MakeInternalFaceURI() *URI

MakeInternalFaceURI constructs an internal face URI.

func MakeNullFaceURI

func MakeNullFaceURI() *URI

MakeNullFaceURI constructs a null face URI.

func MakeTCPFaceURI

func MakeTCPFaceURI(ipVersion int, host string, port uint16) *URI

MakeTCPFaceURI constructs a URI for a TCP face.

func MakeUDPFaceURI

func MakeUDPFaceURI(ipVersion int, host string, port uint16) *URI

MakeUDPFaceURI constructs a URI for a UDP face.

func MakeUnixFaceURI

func MakeUnixFaceURI(path string) *URI

MakeUnixFaceURI constructs a URI for a Unix face.

func MakeWebSocketClientFaceURI

func MakeWebSocketClientFaceURI(addr net.Addr) *URI

MakeWebSocketClientFaceURI constructs a URI for a WebSocket server.

func MakeWebSocketServerFaceURI

func MakeWebSocketServerFaceURI(u *url.URL) *URI

MakeWebSocketServerFaceURI constructs a URI for a WebSocket server.

func (*URI) Canonize

func (u *URI) Canonize() error

Canonize attempts to canonize the URI, if not already canonical.

func (*URI) IsCanonical

func (u *URI) IsCanonical() bool

IsCanonical returns whether the face URI is canonical.

func (*URI) Path

func (u *URI) Path() string

Path returns the path of the face URI.

func (*URI) PathHost

func (u *URI) PathHost() string

PathHost returns the host component of the path of the face URI.

func (*URI) PathZone

func (u *URI) PathZone() string

PathZone returns the zone component of the path of the face URI.

func (*URI) Port

func (u *URI) Port() uint16

Port returns the port of the face URI.

func (*URI) Scheme

func (u *URI) Scheme() string

Scheme returns the scheme of the face URI.

func (*URI) Scope

func (u *URI) Scope() Scope

Scope returns the scope of the URI.

func (*URI) String

func (u *URI) String() string

func (*URI) URIType

func (u *URI) URIType() URIType

URIType returns the type of the face URI.

type URIType

type URIType int

URIType represents the type of the URI.

Jump to

Keyboard shortcuts

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