nbp

package
v0.0.0-...-545087f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 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 Function

type Function uint8

Function represents the NBP packet Function field.

const (
	FunctionBrRq      Function = 1
	FunctionLkUp      Function = 2
	FunctionLkUpReply Function = 3 // can have more than 1 tuple
	FunctionFwdReq    Function = 4
)

Various functions.

func (Function) String

func (f Function) String() string

type Packet

type Packet struct {
	Function Function // top 4 bits of first byte
	// TupleCount uint4 // bottom 4 bits of first byte
	NBPID  uint8
	Tuples []Tuple
}

Packet represents an NBP packet.

func Unmarshal

func Unmarshal(data []byte) (*Packet, error)

func (*Packet) Marshal

func (p *Packet) Marshal() ([]byte, error)

type Tuple

type Tuple struct {
	Network    ddp.Network
	Node       ddp.Node
	Socket     uint8
	Enumerator uint8
	Object     string // length-prefixed
	Type       string // length-prefixed
	Zone       string // length-prefixed; "" interpreted as "*"
}

Tuple represents an NBP tuple.

func (Tuple) String

func (t Tuple) String() string

Jump to

Keyboard shortcuts

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