Class: Net::TTI::Authentication

Inherits:
FunctionCall show all
Defined in:
lib/net/tti/messages/function_calls/authentication.rb

Direct Known Subclasses

PreAuthentication

Constant Summary collapse

LOGON_MODE_PRE_AUTH =
0x01
LOGON_MODE_AUTH =
0x0101

Constants inherited from FunctionCall

FunctionCall::FUNCTION_CODE_AUTH, FunctionCall::FUNCTION_CODE_PRE_AUTH

Constants inherited from Message

Message::TTC_CODE_DATA_TYPE_NEGOTIATION, Message::TTC_CODE_ERROR, Message::TTC_CODE_FUNCTION_CALL, Message::TTC_CODE_OK, Message::TTC_CODE_PROTOCOL_NEGOTIATION

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FunctionCall

next_sequence_number, #to_binary_s

Methods inherited from Message

from_data_string, handles_response_for_ttc_code

Class Method Details

.create_auth_requestObject



48
49
50
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 48

def self.create_auth_request()
  return Authentication.new
end

.create_pre_auth_requestObject



44
45
46
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 44

def self.create_pre_auth_request()
  return PreAuthentication.new
end

Instance Method Details

#_logon_mode_lengthObject



34
35
36
37
38
39
40
41
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 34

def _logon_mode_length
  case _logon_mode
  when Authentication::LOGON_MODE_PRE_AUTH
    return 1
  when Authentication::LOGON_MODE_AUTH
    return 2
  end
end

#add_parameter(key, value, flags = 0) ⇒ Object



52
53
54
55
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 52

def add_parameter( key, value, flags=0 )
  kvp = DataTypes::KeyValuePair.new( :kvp_key => key, :kvp_value => value, :flags => flags )
  self.parameters << kvp
end

#enc_client_session_key=(enc_client_session_key) ⇒ Object



57
58
59
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 57

def enc_client_session_key=(enc_client_session_key)
  add_parameter( "AUTH_SESSKEY", enc_client_session_key.tns_hexify.upcase, 1 )
end

#enc_password=(enc_password) ⇒ Object



61
62
63
# File 'lib/net/tti/messages/function_calls/authentication.rb', line 61

def enc_password=(enc_password)
  add_parameter( "AUTH_PASSWORD", enc_password.tns_hexify.upcase )
end