Documentation ¶
Overview ¶
stun-lib is a STUN (RFC 3489) libray.
Index ¶
- type BindingRequest
- func (h *BindingRequest) AddAttribute(atrribute attr.Attribute)
- func (m *BindingRequest) Decode(src []byte) (n int, err error)
- func (m *BindingRequest) Encode() (buf []byte, err error)
- func (h *BindingRequest) GenerateTransactionID()
- func (h *BindingRequest) GetAttribute(attribTyte attr.AttributeType) attr.Attribute
- func (h *BindingRequest) SetAttributes(atrributes map[attr.AttributeType]attr.Attribute)
- type BindingResponse
- func (h *BindingResponse) AddAttribute(atrribute attr.Attribute)
- func (m *BindingResponse) Decode(src []byte) (n int, err error)
- func (m *BindingResponse) Encode() (buf []byte, err error)
- func (h *BindingResponse) GenerateTransactionID()
- func (h *BindingResponse) GetAttribute(attribTyte attr.AttributeType) attr.Attribute
- func (h *BindingResponse) SetAttributes(atrributes map[attr.AttributeType]attr.Attribute)
- type Message
- type MessageType
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 (*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 (*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.
Click to show internal directories.
Click to hide internal directories.