ddp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: BSD-3-Clause Imports: 4 Imported by: 6

Documentation

Overview

Encodes and decodes DDP (Datagram Delivery Protocol) packets.

Index

Constants

View Source
const (
	ProtoRTMPResp = 0x01
	ProtoNBP      = 0x02
	ProtoATP      = 0x03
	ProtoAEP      = 0x04
	ProtoRTMPReq  = 0x05
	ProtoZIP      = 0x06
	ProtoADSP     = 0x07
)

Variables

This section is empty.

Functions

func ExtMarshal

func ExtMarshal(pak ExtPacket) ([]byte, error)

Marshals a packet to bytes.

func ExtUnmarshal

func ExtUnmarshal(data []byte, pak *ExtPacket) error

Unmarshals a packet from bytes.

func Marshal

func Marshal(pak Packet) ([]byte, error)

Marshals a packet to bytes.

func Unmarshal

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

Unmarshals a packet from bytes.

Types

type Addr

type Addr struct {
	Network Network
	Node    Node
}

type ExtHeader

type ExtHeader struct {
	Size, Cksum          uint16
	DstNet, SrcNet       Network
	DstNode, SrcNode     Node
	DstSocket, SrcSocket Socket
	Proto                uint8
}

type ExtPacket

type ExtPacket struct {
	ExtHeader
	Data []byte
}

func ShortToExt

func ShortToExt(pak Packet, network Network, dstNode, srcNode Node) ExtPacket

Converts a short-form packet to an extended packet.

type Header struct {
	Size                 uint16
	DstSocket, SrcSocket Socket
	Proto                uint8
}

type Network

type Network uint16

type Node

type Node uint8

type Packet

type Packet struct {
	Header
	Data []byte
}

func ExtToShort

func ExtToShort(ext ExtPacket) Packet

Converts an extended packet to a short-form packet.

Discards the network and node information.

type Socket

type Socket uint8

Jump to

Keyboard shortcuts

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