messages

package
v0.0.0-...-e01d51a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

README

##stun messages Build Status GoDoc

stun-lib is a STUN (RFC 3489) library.

Documentation

Overview

stun-lib is a STUN (RFC 3489) libray.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingRequest

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

BindingRequest message

func NewBindingRequest

func NewBindingRequest() *BindingRequest

NewBindingRequest create a BindingRequest message

func (*BindingRequest) AddAttribute

func (h *BindingRequest) AddAttribute(atrribute attr.Attribute)

func (*BindingRequest) Decode

func (m *BindingRequest) Decode(src []byte) (n int, err error)

Decode decode BindingRequest message

func (*BindingRequest) Encode

func (m *BindingRequest) Encode() (buf []byte, err error)

Encode encode BindingRequest message

func (*BindingRequest) GenerateTransactionID

func (h *BindingRequest) GenerateTransactionID()

func (*BindingRequest) GetAttribute

func (h *BindingRequest) GetAttribute(attribTyte attr.AttributeType) attr.Attribute

func (*BindingRequest) SetAttributes

func (h *BindingRequest) SetAttributes(atrributes map[attr.AttributeType]attr.Attribute)

type BindingResponse

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

BindingResponse message

func NewBindingResponse

func NewBindingResponse() *BindingResponse

NewBindingResponse create a BindingResponse message

func (*BindingResponse) AddAttribute

func (h *BindingResponse) AddAttribute(atrribute attr.Attribute)

func (*BindingResponse) Decode

func (m *BindingResponse) Decode(src []byte) (n int, err error)

Decode decode BindingResponse message

func (*BindingResponse) Encode

func (m *BindingResponse) Encode() (buf []byte, err error)

Encode encode BindingResponse message

func (*BindingResponse) GenerateTransactionID

func (h *BindingResponse) GenerateTransactionID()

func (*BindingResponse) GetAttribute

func (h *BindingResponse) GetAttribute(attribTyte attr.AttributeType) attr.Attribute

func (*BindingResponse) SetAttributes

func (h *BindingResponse) SetAttributes(atrributes map[attr.AttributeType]attr.Attribute)

type Message

type Message interface {
	Encode() ([]byte, error)
	Decode([]byte) (int, error)
	SetAttributes(atrributes map[attr.AttributeType]attr.Attribute)
	AddAttribute(atrribute attr.Attribute)
	GetAttribute(attribTyte attr.AttributeType) attr.Attribute
}

Message interface

type MessageType

type MessageType uint16

MessageType is the stun message types.

const (
	//BINDINGREQUEST request binding
	BINDINGREQUEST MessageType = 0x0001
	//BINDINGRESPONSE  binding response
	BINDINGRESPONSE MessageType = 0x0101
	//BINDINGERRORRESPONSE binding error
	BINDINGERRORRESPONSE MessageType = 0x0111
)

func (MessageType) New

func (m MessageType) New() (Message, error)

New creates a new Message based on the Message type.

Jump to

Keyboard shortcuts

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