2
%% <year>2008-2008</year>
3
%% <holder>Ericsson AB, All Rights Reserved</holder>
4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
17
%% The Initial Developer of the Original Code is Ericsson AB.
20
21
%%----------------------------------------------------------------------
21
22
%% Purpose: Ssh connection supervisor.
80
81
[handler_spec(Opts)].
82
83
manager_spec([server = Role, Socket, Opts]) ->
83
Address = proplists:get_value(address, Opts),
84
Port = proplists:get_value(port, Opts),
86
85
StartFunc = {ssh_connection_manager, start_link, [[Role, Socket, Opts]]},
89
88
Modules = [ssh_connection_manager],
91
90
{Name, StartFunc, Restart, Shutdown, Type, Modules};
93
92
manager_spec([client = Role | Opts]) ->
94
Address = proplists:get_value(address, Opts),
95
Port = proplists:get_value(port, Opts),
97
94
StartFunc = {ssh_connection_manager, start_link, [[Role, Opts]]},
98
95
%%TODO restarttype?
101
98
Modules = [ssh_connection_manager],
103
100
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
105
102
handler_spec([Role, Socket, Opts]) ->
106
Address = proplists:get_value(address, Opts),
107
Port = proplists:get_value(port, Opts),
108
103
Name = make_ref(),
109
104
StartFunc = {ssh_connection_handler,
110
105
start_link, [Role, self(), Socket, Opts]},
113
108
Modules = [ssh_connection_handler],