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 +++++----- 8 files changed, 52 insertions(+), 47 deletions(-) (limited to 'lib/ssh/doc/src') 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(). -- cgit v1.2.3