Class: StunClient::RFC3489Message::StunMessage

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/stun-client/rfc3489/message.rb

Overview

Represents a complete STUN message according to RFC3489 using BinData. Only the responses are extracted, but none are evaluated.

If necessary, the name of the message or an attribute can be queried using a function.

Constant Summary collapse

MESSAGE_TYPES =

Hash with the hexadecimal type numbers and their names as symbols.

{
  0x0001 => :bindung_request,
  0x0101 => :binding_response,
  0x0111 => :bindung_error_response,
  0x0002 => :shared_secret_request,
  0x0102 => :shared_secret_response,
  0x0112 => :shared_secret_error_response
}.freeze
ATTRIBUTE_TYPES =

Hash with the hexadecimal attribute numbers and their names as symbols.

{
  # RFC3489
  0x0001 => :mapped_address,
  0x0002 => :response_address,
  0x0003 => :change_request,
  0x0004 => :source_address,
  0x0005 => :changed_address,
  0x0006 => :username,
  0x0007 => :password,
  0x0008 => :message_integrity,
  0x0009 => :error_code,
  0x000a => :unknown_attributes,
  0x000b => :reflected_from
}.freeze