aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh.hrl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-02-16 14:48:04 +0100
committerHans Nilsson <[email protected]>2017-03-02 12:03:51 +0100
commit89a829f32d855610b0bc0c3ea53e7c05454b7a24 (patch)
tree14d887fc3df9515b2624671963a30886921c835e /lib/ssh/src/ssh.hrl
parentcf732330c011fb28f58c7e4c043381eac352a9fb (diff)
downloadotp-89a829f32d855610b0bc0c3ea53e7c05454b7a24.tar.gz
otp-89a829f32d855610b0bc0c3ea53e7c05454b7a24.tar.bz2
otp-89a829f32d855610b0bc0c3ea53e7c05454b7a24.zip
ssh: Initial commit of option handling changes
Diffstat (limited to 'lib/ssh/src/ssh.hrl')
-rw-r--r--lib/ssh/src/ssh.hrl27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl
index 4cd91177f6..475534f572 100644
--- a/lib/ssh/src/ssh.hrl
+++ b/lib/ssh/src/ssh.hrl
@@ -33,6 +33,10 @@
-define(REKEY_DATA_TIMOUT, 60000).
-define(DEFAULT_PROFILE, default).
+-define(DEFAULT_TRANSPORT, {tcp, gen_tcp, tcp_closed} ).
+
+-define(MAX_RND_PADDING_LEN, 15).
+
-define(SUPPORTED_AUTH_METHODS, "publickey,keyboard-interactive,password").
-define(SUPPORTED_USER_KEYS, ['ssh-rsa','ssh-dss','ecdsa-sha2-nistp256','ecdsa-sha2-nistp384','ecdsa-sha2-nistp521']).
@@ -64,10 +68,31 @@
-define(string_utf8(X), << ?STRING(unicode:characters_to_binary(X)) >> ).
-define(binary(X), << ?STRING(X) >>).
+%% Cipher details
-define(SSH_CIPHER_NONE, 0).
-define(SSH_CIPHER_3DES, 3).
-define(SSH_CIPHER_AUTHFILE, ?SSH_CIPHER_3DES).
+%% Option access macros
+-define(do_get_opt(C,K,O), ssh_options:get_value(C,K,O, ?MODULE,?LINE)).
+-define(do_get_opt(C,K,O,D), ssh_options:get_value(C,K,O,D,?MODULE,?LINE)).
+
+-define(GET_OPT(Key,Opts), ?do_get_opt(user_options, Key,Opts ) ).
+-define(GET_INTERNAL_OPT(Key,Opts), ?do_get_opt(internal_options,Key,Opts ) ).
+-define(GET_INTERNAL_OPT(Key,Opts,Def), ?do_get_opt(internal_options,Key,Opts,Def) ).
+-define(GET_SOCKET_OPT(Key,Opts), ?do_get_opt(socket_options, Key,Opts ) ).
+-define(GET_SOCKET_OPT(Key,Opts,Def), ?do_get_opt(socket_options, Key,Opts,Def) ).
+
+-define(do_put_opt(C,KV,O), ssh_options:put_value(C,KV,O, ?MODULE,?LINE)).
+
+-define(PUT_OPT(KeyVal,Opts), ?do_put_opt(user_options, KeyVal,Opts) ).
+-define(PUT_INTERNAL_OPT(KeyVal,Opts), ?do_put_opt(internal_options,KeyVal,Opts) ).
+-define(PUT_SOCKET_OPT(KeyVal,Opts), ?do_put_opt(socket_options, KeyVal,Opts) ).
+
+%% Types
+-type ok_error(SuccessType) :: {ok, SuccessType} | {error, any()} .
+
+%% Records
-record(ssh,
{
role, %% client | server
@@ -127,7 +152,7 @@
recv_sequence = 0,
keyex_key,
keyex_info,
- random_length_padding = 15, % From RFC 4253 section 6.
+ random_length_padding = ?MAX_RND_PADDING_LEN, % From RFC 4253 section 6.
%% User auth
user,