sap

package
v0.0.0-...-4265b25 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeAnnouncement = MessageType(iota)
	MessageTypeDeletion
)
View Source
const (
	SDPPayloadType = "application/sdp"
)
View Source
const (
	Version1 = Version(1)
)

Variables

View Source
var ErrAuthenticationDataTooLong = errors.New("authentication data too long")
View Source
var ErrPacketInvalidIntegrity = errors.New("packet integrity error")
View Source
var ErrPacketTooShort = errors.New("packet too short")

Functions

This section is empty.

Types

type Listener

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

func NewListener

func NewListener(ip net.IP, ifi *net.Interface) (*Listener, error)

func (*Listener) Close

func (l *Listener) Close()

func (*Listener) ReadPacketRaw

func (l *Listener) ReadPacketRaw() ([]byte, error)

type MessageType

type MessageType int

type Packet

type Packet struct {
	Type               MessageType
	IDHash             uint16
	Origin             net.IP
	Encrypted          bool
	Compressed         bool
	PayloadType        string
	AuthenticationData []byte
	Payload            []byte
}

func DecodePacket

func DecodePacket(raw []byte) (*Packet, error)

func (*Packet) Encode

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

func (*Packet) UniqueID

func (p *Packet) UniqueID() string

type Sender

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

func NewSender

func NewSender(ip net.IP, p *Packet) (*Sender, error)

func (*Sender) AnnouncePeriodically

func (s *Sender) AnnouncePeriodically(ctx context.Context) error

func (*Sender) Close

func (s *Sender) Close()

type Version

type Version int

Jump to

Keyboard shortcuts

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