From 089f235dd2c2945a63383e79e02616c1a99b50a6 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 24 Jan 2013 16:51:42 +0100 Subject: ssh: Fix dialyzer and doc warnings --- lib/ssh/doc/src/introduction.xml | 3 +- lib/ssh/doc/src/ssh.xml | 2 +- lib/ssh/doc/src/ssh_channel.xml | 39 +++++++++---------- lib/ssh/doc/src/ssh_client_key_api.xml | 9 +++-- lib/ssh/doc/src/ssh_connection.xml | 26 ++++++------- lib/ssh/doc/src/ssh_server_key_api.xml | 5 ++- lib/ssh/doc/src/ssh_sftpd.xml | 4 +- lib/ssh/doc/src/using_ssh.xml | 11 +++--- lib/ssh/src/Makefile | 4 +- lib/ssh/src/ssh.app.src | 2 +- lib/ssh/src/ssh_channel.erl | 7 +--- lib/ssh/src/ssh_cli.erl | 4 +- lib/ssh/src/ssh_daemon_channel.erl | 68 ++++++++++++++++++++++++++++++++++ lib/ssh/src/ssh_sftp.erl | 10 ++++- lib/ssh/src/ssh_sftpd.erl | 7 ++-- lib/ssh/src/ssh_shell.erl | 8 ++-- lib/ssh/src/ssh_subsystem.erl | 47 ----------------------- 17 files changed, 143 insertions(+), 113 deletions(-) create mode 100644 lib/ssh/src/ssh_daemon_channel.erl delete mode 100644 lib/ssh/src/ssh_subsystem.erl (limited to 'lib/ssh') diff --git a/lib/ssh/doc/src/introduction.xml b/lib/ssh/doc/src/introduction.xml index aac8de0f76..ae75414999 100644 --- a/lib/ssh/doc/src/introduction.xml +++ b/lib/ssh/doc/src/introduction.xml @@ -5,6 +5,7 @@
2012 + 2013 Ericsson AB, All Rights Reserved @@ -47,7 +48,7 @@
Prerequisites -

It is assumed that the reader is familiar with the concepts of OTP +

It is assumed that the reader is familiar with the concepts of OTP and has a basic understanding of public keys.

diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml index 7f7d887d5e..f57ee13460 100644 --- a/lib/ssh/doc/src/ssh.xml +++ b/lib/ssh/doc/src/ssh.xml @@ -4,7 +4,7 @@
- 20042012 + 20042013 Ericsson AB. All Rights Reserved. diff --git a/lib/ssh/doc/src/ssh_channel.xml b/lib/ssh/doc/src/ssh_channel.xml index f0083ae8d1..66b3b8b656 100644 --- a/lib/ssh/doc/src/ssh_channel.xml +++ b/lib/ssh/doc/src/ssh_channel.xml @@ -5,7 +5,7 @@
2009 - 2012 + 2013 Ericsson AB, All Rights Reserved @@ -31,7 +31,7 @@

SSH services (clients and servers) are implemented as channels that are multiplexed over an SSH connection and communicates via the SSH - Connection Protocol . This module provides a callback API + Connection Protocol. This module provides a callback API that takes care of generic channel aspects such as flow control and close messages and lets the callback functions take care of the service (application) specific parts. This behavior also ensures @@ -41,12 +41,12 @@ the SSH applications supervisor tree.

- When implementing a SSH subsystem use the - -behaviour(ssh_subsystem). instead of -behaviour(ssh_channel). +

When implementing a SSH subsystem use the + -behaviour(ssh_daemon_channel). instead of -behaviour(ssh_channel). as the only relevant callback functions for subsystems are - init/1, handle_ssh_msg/2, handle_msg/2 and terminate/2, so the ssh_subsystem + init/1, handle_ssh_msg/2, handle_msg/2 and terminate/2, so the ssh_daemon_channel behaviour is limited version of the ssh_channel behaviour. - +

@@ -83,7 +83,7 @@

Makes a synchronous call to the channel process by sending a message and waiting until a reply arrives or a timeout - occurs. The channel will call Module:handle_call/3 to handle the message. If the channel process does not exist {error, closed} is returned. @@ -104,7 +104,7 @@

Sends an asynchronous message to the channel process and returns ok immediately, ignoring if the destination node or channel process does not exist. The channel will call - Module:handle_cast/2 + Module:handle_cast/2 to handle the message.

@@ -114,7 +114,7 @@ enter_loop(State) -> _ Makes an existing process an ssh_channel process. - State = term() - as returned by ssh_channel:init/1 + State = term() - as returned by ssh_channel:init/1

Makes an existing process an ssh_channel @@ -124,7 +124,7 @@ one of the start functions in proc_lib, see proc_lib(3). The user is responsible for any initialization of the process - and needs to call ssh_channel:init/1 + and needs to call ssh_channel:init/1

@@ -155,7 +155,7 @@ marker="ssh#connect-3">ssh:connect/3 - Id of the ssh channel. + Id of the SSH channel. @@ -222,8 +222,8 @@ CALLBACK TIMEOUTS

The timeout values that may be returned by the callback functions - has the same semantics as in a gen_server - If the timeout occurs handle_msg/2 + has the same semantics as in a gen_server + If the timeout occurs handle_msg/2 will be called as handle_msg(timeout, State).

@@ -334,7 +334,6 @@

For more detailed information on timeouts see the section CALLBACK TIMEOUTS.

- @@ -342,10 +341,11 @@ Module:handle_msg(Msg, State) -> {ok, State} | {stop, ChannelId, State} - Handle other messages than ssh connection protocol, + Handle other messages than SSH connection protocol, call or cast messages sent to the channel. Msg = timeout | term() + ChannelId = ssh_channel_id() State = term() @@ -361,7 +361,7 @@ ssh_connection_ref()}]]> This is the first messages that will be received by the channel, it is sent just before the ssh_channel:init/1 function + marker="#init-1">ssh_channel:init/1 function returns successfully. This is especially useful if the server wants to send a message to the client without first receiving a message from it. If the message is not @@ -374,19 +374,20 @@ Module:handle_ssh_msg(Msg, State) -> {ok, State} | {stop, - ssh_channel_id(), State} + ChannelId, State} Handles ssh connection protocol messages. Msg = ssh_connection:event() + ChannelId = ssh_channel_id() State = term() -

Handles ssh connection protocol messages that may need +

Handles SSH connection protocol messages that may need service specific attention.

The following message is completely taken care of by the - ssh channel behavior

+ SSH channel behavior

diff --git a/lib/ssh/doc/src/ssh_client_key_api.xml b/lib/ssh/doc/src/ssh_client_key_api.xml index abc1070e78..929b71414f 100644 --- a/lib/ssh/doc/src/ssh_client_key_api.xml +++ b/lib/ssh/doc/src/ssh_client_key_api.xml @@ -5,6 +5,7 @@
2012 + 2013 Ericsson AB, All Rights Reserved @@ -62,7 +63,7 @@ Normally an RSA or DSA public key but handling of other public keys can be added ConnectOptions = proplists:proplist() - Options provided to ssh:connect/[3,4] + Options provided to ssh:connect/[3,4] Reason = term() @@ -85,7 +86,7 @@ can be handled. ConnectOptions = proplists:proplist() - Options provided to ssh:connect/[3,4] + Options provided to ssh:connect/[3,4] Result = boolean() @@ -104,7 +105,7 @@ can be handled. ConnectOptions = proplists:proplist() - Options provided to ssh:connect/[3,4] + Options provided to ssh:connect/[3,4] PrivateKey = private_key() The private key of the user matching the Algorithm @@ -114,7 +115,7 @@

Fetches the users "public key" matching the Algorithm. - The private key contains the public key +

The private key contains the public key

diff --git a/lib/ssh/doc/src/ssh_connection.xml b/lib/ssh/doc/src/ssh_connection.xml index c66622307f..efd4865a6f 100644 --- a/lib/ssh/doc/src/ssh_connection.xml +++ b/lib/ssh/doc/src/ssh_connection.xml @@ -5,7 +5,7 @@
2008 - 2012 + 2013 Ericsson AB, All Rights Reserved @@ -42,7 +42,7 @@ marker="ssh_channel">ssh_channel behavior is used to implement the channel process these will be handled by handle_ssh_msg/2 .

+ marker="ssh_channel#Module:handle_ssh_msg-2">handle_ssh_msg/2 .

@@ -69,12 +69,12 @@ Data has arrived on the channel. This event is sent as - result of calling ssh_connection:send/[3,4,5] + result of calling ssh_connection:send/[3,4,5] Indicates that the other side will not send any more data. This event is sent as result of calling ssh_connection:send_eof/2 + marker="ssh_connection#send_eof-2"> ssh_connection:send_eof/2 @@ -104,12 +104,12 @@ following message can be sent to return the exit status of the command. A zero 'exit_status' usually means that the command terminated successfully. This event is sent as result of calling - + ssh_connection:exit_status/3 This event is sent as result of calling - ssh_connection:close/2 Both the handling of this + ssh_connection:close/2 Both the handling of this event and sending of it will be taken care of by the ssh_channel behavior. @@ -122,17 +122,17 @@

Channels implementing a shell and command execution on the server side should handle the following messages that may be sent by client channel processes.

-

Events that includes a WantReply expects the event handling - process to call ssh_connection:reply_request/4 +

Events that includes a WantReply expects the event handling + process to call ssh_connection:reply_request/4 with the boolean value of WantReply as the second - argument.

+ argument.

Environment variables may be passed to the shell/command to be started later. This event is sent as result of calling ssh_connection:setenv/5 + marker="ssh_connection#setenv-5"> ssh_connection:setenv/5
This message will request that the user's default shell be started at the other end. This event is sent as result of calling ssh_connection:shell/2 + marker="ssh_connection#shell-2"> ssh_connection:shell/2 This message will request that the server starts execution of the given command. This event is sent as result of calling ssh_connection:exec/4 + marker="ssh_connection#exec-4">ssh_connection:exec/4 @@ -194,7 +194,7 @@

Channels implemented with the ssh_channel behavior will normaly not need to call this function as flow control will be handled by the behavior. The behavior will adjust the window every time - the callback + the callback handle_ssh_msg/2 has returned after processing channel data

diff --git a/lib/ssh/doc/src/ssh_server_key_api.xml b/lib/ssh/doc/src/ssh_server_key_api.xml index 78ff105387..c4562e1211 100644 --- a/lib/ssh/doc/src/ssh_server_key_api.xml +++ b/lib/ssh/doc/src/ssh_server_key_api.xml @@ -5,6 +5,7 @@
2012 + 2013 Ericsson AB, All Rights Reserved @@ -58,7 +59,7 @@ Host key algorithm. Should support 'ssh-rsa'| 'ssh-dss' but additional algorithms can be handled. DaemonOptions = proplists:proplist() - Options provided to ssh:daemon/[2,3] + Options provided to ssh:daemon/[2,3] Key = private_key() The private key of the host matching the Algorithm Reason = term() @@ -77,7 +78,7 @@ User = string() The user owning the public key DaemonOptions = proplists:proplist() - Options provided to ssh:daemon/[2,3] + Options provided to ssh:daemon/[2,3] Result = boolean() diff --git a/lib/ssh/doc/src/ssh_sftpd.xml b/lib/ssh/doc/src/ssh_sftpd.xml index 3666bc7692..748e24d44b 100644 --- a/lib/ssh/doc/src/ssh_sftpd.xml +++ b/lib/ssh/doc/src/ssh_sftpd.xml @@ -4,7 +4,7 @@
- 20052012 + 20052013 Ericsson AB. All Rights Reserved. @@ -61,7 +61,7 @@

Determines which module to call for accessing the file server. The default value is ssh_sftpd_file that uses the - file and filelib API:s to access the standard OTP file + file and filelib API:s to access the standard OTP file server. This option may be used to plug in other file servers.

diff --git a/lib/ssh/doc/src/using_ssh.xml b/lib/ssh/doc/src/using_ssh.xml index 87b811d591..c3bb7a22aa 100644 --- a/lib/ssh/doc/src/using_ssh.xml +++ b/lib/ssh/doc/src/using_ssh.xml @@ -29,7 +29,7 @@
General information

The examples in the following sections use the utility function - ssh:start/0 that starts + ssh:start/0 that starts all needed applications (crypto, public_key and ssh). All examples are run in an Erlang shell, or in a bash shell using openssh to illustrate how the erlang ssh application can be used. The @@ -70,7 +70,7 @@

The option system_dir must be a directory containing a host key file and it defaults to /etc/ssh. For details see section Configuration Files in ssh(6). + marker="ssh_app#">ssh(6).

Normally the /etc/ssh directory is only readable by root.

@@ -137,12 +137,13 @@ One Time Execution

In the following example the Erlang shell is the client process - that receives the channel replies. If you run this example + that receives the channel replies.

+ +

If you run this example in your environment you may get fewer or more messages back as this depends on the OS and shell on the machine running the ssh daemon. See also ssh_connection:exec/4 - -

+

1> ssh:start(). diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile index 27e43a88ed..93d0b54f57 100644 --- a/lib/ssh/src/Makefile +++ b/lib/ssh/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2004-2012. All Rights Reserved. +# Copyright Ericsson AB 2004-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -41,7 +41,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/ssh-$(VSN) BEHAVIOUR_MODULES= \ ssh_sftpd_file_api \ ssh_channel \ - ssh_subsystem \ + ssh_daemon_channel \ ssh_client_key_api \ ssh_server_key_api diff --git a/lib/ssh/src/ssh.app.src b/lib/ssh/src/ssh.app.src index a0ba7cf7d9..49707f3378 100644 --- a/lib/ssh/src/ssh.app.src +++ b/lib/ssh/src/ssh.app.src @@ -17,6 +17,7 @@ ssh_connection_handler, ssh_connection_manager, ssh_connection_sup, + ssh_daemon_channel, ssh_shell, sshc_sup, sshd_sup, @@ -29,7 +30,6 @@ ssh_sftpd, ssh_sftpd_file, ssh_sftpd_file_api, - ssh_subsystem, ssh_subsystem_sup, ssh_sup, ssh_system_sup, diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index 4e8f8538c2..062ed764ca 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -48,10 +48,7 @@ {ok, NewState :: term()} | {error, Reason :: term()}. -callback handle_msg(Msg ::term(), State :: term()) -> - {noreply, NewState :: term()} | - {noreply, NewState :: term(), timeout() | hibernate} | - {stop, Reason :: term(), NewState :: term()}. - + {ok, State::term()} | {stop, ChannelId::integer(), State::term()}. -callback handle_ssh_msg({ssh_cm, ConnectionRef::term(), SshMsg::term()}, State::term()) -> {ok, State::term()} | diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl index c8c610f8ef..7232cc482c 100644 --- a/lib/ssh/src/ssh_cli.erl +++ b/lib/ssh/src/ssh_cli.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2011. All Rights Reserved. +%% Copyright Ericsson AB 2005-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,7 +24,7 @@ -module(ssh_cli). --behaviour(ssh_channel). +-behaviour(ssh_daemon_channel). -include("ssh.hrl"). -include("ssh_connect.hrl"). diff --git a/lib/ssh/src/ssh_daemon_channel.erl b/lib/ssh/src/ssh_daemon_channel.erl new file mode 100644 index 0000000000..ab3efbcaff --- /dev/null +++ b/lib/ssh/src/ssh_daemon_channel.erl @@ -0,0 +1,68 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2013. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% +%% Description: a gen_server implementing a simple +%% terminal (using the group module) for a CLI +%% over SSH + +-module(ssh_daemon_channel). + +%% API to special server side channel that can be pluged into the erlang ssh daemeon +-callback init(Args :: term()) -> + {ok, State :: term()} | {ok, State :: term(), timeout() | hibernate} | + {stop, Reason :: term()} | ignore. + +-callback terminate(Reason :: (normal | shutdown | {shutdown, term()} | + term()), + State :: term()) -> + term(). + +-callback handle_msg(Msg ::term(), State :: term()) -> + {ok, State::term()} | {stop, ChannelId::integer(), State::term()}. +-callback handle_ssh_msg({ssh_cm, ConnectionRef::term(), SshMsg::term()}, + State::term()) -> {ok, State::term()} | + {stop, ChannelId::integer(), + State::term()}. + +%%% API +-export([start/4, start/5, start_link/4, start_link/5, enter_loop/1]). + +%% gen_server callbacks +-export([init/1, terminate/2]). + +start(ConnectionManager, ChannelId, CallBack, CbInitArgs) -> + ssh_channel:start(ConnectionManager, ChannelId, CallBack, CbInitArgs, undefined). + +start(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec) -> + ssh_channel:start(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec). + +start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs) -> + ssh_channel:start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, undefined). + +start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec) -> + ssh_channel:start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec). + +enter_loop(State) -> + ssh_channel:enter_loop(State). + +init(Args) -> + ssh_channel:init(Args). +terminate(Reason, State) -> + ssh_channel:terminate(Reason, State). diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl index f000558100..f3afbe01bf 100644 --- a/lib/ssh/src/ssh_sftp.erl +++ b/lib/ssh/src/ssh_sftp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2011. All Rights Reserved. +%% Copyright Ericsson AB 2005-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -47,7 +47,7 @@ recv_window/2, list_dir/3, read_file/3, write_file/4]). %% ssh_channel callbacks --export([init/1, handle_call/3, handle_msg/2, handle_ssh_msg/2, terminate/2]). +-export([init/1, handle_call/3, handle_cast/2, code_change/3, handle_msg/2, handle_ssh_msg/2, terminate/2]). %% TODO: Should be placed elsewhere ssh_sftpd should not call functions in ssh_sftp! -export([info_to_attr/1, attr_to_info/1]). @@ -436,6 +436,12 @@ handle_call({{timeout, Timeout}, Msg}, From, #state{req_id = Id} = State) -> timer:send_after(Timeout, {timeout, Id, From}), do_handle_call(Msg, From, State). +handle_cast(_,State) -> + {noreply, State}. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + do_handle_call({open, Async,FileName,Mode}, From, #state{xf = XF} = State) -> {Access,Flags,Attrs} = open_mode(XF#ssh_xfer.vsn, Mode), ReqID = State#state.req_id, diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl index c7e8373840..3d469d3c6e 100644 --- a/lib/ssh/src/ssh_sftpd.erl +++ b/lib/ssh/src/ssh_sftpd.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2012. All Rights Reserved. +%% Copyright Ericsson AB 2005-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,8 +23,7 @@ -module(ssh_sftpd). -%%-behaviour(gen_server). --behaviour(ssh_subsystem). +-behaviour(ssh_daemon_channel). -include_lib("kernel/include/file.hrl"). @@ -159,7 +158,7 @@ handle_ssh_msg({ssh_cm, _, {exit_status, ChannelId, Status}}, State) -> {stop, ChannelId, State}. %%-------------------------------------------------------------------- -%% Function: handle_ssh_msg(Args) -> {ok, State} | {stop, ChannelId, State} +%% Function: handle_msg(Args) -> {ok, State} | {stop, ChannelId, State} %% %% Description: Handles other messages %%-------------------------------------------------------------------- diff --git a/lib/ssh/src/ssh_shell.erl b/lib/ssh/src/ssh_shell.erl index 6590486a4c..8031450617 100644 --- a/lib/ssh/src/ssh_shell.erl +++ b/lib/ssh/src/ssh_shell.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,9 @@ -include("ssh_connect.hrl"). --behaviour(ssh_channel). +%%% As this is an user interactive client it behaves like a daemon +%%% channel inspite of it being a client. +-behaviour(ssh_daemon_channel). %% ssh_channel callbacks -export([init/1, handle_msg/2, handle_ssh_msg/2, terminate/2]). @@ -123,7 +125,7 @@ handle_ssh_msg({ssh_cm, _, {exit_status, ChannelId, Status}}, State) -> {stop, ChannelId, State}. %%-------------------------------------------------------------------- -%% Function: handle_ssh_msg(Args) -> {ok, State} | {stop, ChannelId, State} +%% Function: handle_msg(Args) -> {ok, State} | {stop, ChannelId, State} %% %% Description: Handles other channel messages %%-------------------------------------------------------------------- diff --git a/lib/ssh/src/ssh_subsystem.erl b/lib/ssh/src/ssh_subsystem.erl deleted file mode 100644 index 5a9fa32668..0000000000 --- a/lib/ssh/src/ssh_subsystem.erl +++ /dev/null @@ -1,47 +0,0 @@ --module(ssh_subsystem). - -%% API to special server side channel that can be pluged into the erlang ssh daemeon --callback init(Args :: term()) -> - {ok, State :: term()} | {ok, State :: term(), timeout() | hibernate} | - {stop, Reason :: term()} | ignore. - --callback terminate(Reason :: (normal | shutdown | {shutdown, term()} | - term()), - State :: term()) -> - term(). - --callback handle_msg(Msg ::term(), State :: term()) -> - {noreply, NewState :: term()} | - {noreply, NewState :: term(), timeout() | hibernate} | - {stop, Reason :: term(), NewState :: term()}. - --callback handle_ssh_msg({ssh_cm, ConnectionRef::term(), SshMsg::term()}, - State::term()) -> {ok, State::term()} | - {stop, ChannelId::integer(), - State::term()}. - -%%% API --export([start/4, start/5, start_link/4, start_link/5, enter_loop/1]). - -%% gen_server callbacks --export([init/1, terminate/2]). - -start(ConnectionManager, ChannelId, CallBack, CbInitArgs) -> - ssh_channel:start(ConnectionManager, ChannelId, CallBack, CbInitArgs, undefined). - -start(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec) -> - ssh_channel:start(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec). - -start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs) -> - ssh_channel:start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, undefined). - -start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec) -> - ssh_channel:start_link(ConnectionManager, ChannelId, CallBack, CbInitArgs, Exec). - -enter_loop(State) -> - ssh_channel:enter_loop(State). - -init(Args) -> - ssh_channel:init(Args). -terminate(Reason, State) -> - ssh_channel:terminate(Reason, State). -- cgit v1.2.3