diff options
Diffstat (limited to 'lib/ssh/src')
| -rw-r--r-- | lib/ssh/src/ssh.appup.src | 6 | ||||
| -rw-r--r-- | lib/ssh/src/ssh_channel.erl | 28 | ||||
| -rw-r--r-- | lib/ssh/src/ssh_sftpd_file_api.erl | 62 | 
3 files changed, 58 insertions, 38 deletions
| diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 150b7d86dd..21a0582c06 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -18,7 +18,9 @@  %%  {"%VSN%",	 - [ + [		 +  {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []}, +             {load_module, ssh_channel, soft_purge, soft_purge, []}]},    {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},    {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},               {load_module, ssh_sftp, soft_purge, soft_purge, []}]}, @@ -27,6 +29,8 @@               {load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]}   ],   [ +  {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []}, +             {load_module, ssh_channel, soft_purge, soft_purge, []}]},	    {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},    {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},               {load_module, ssh_sftp, soft_purge, soft_purge, []}]}, diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index dcb2d69290..7b600ed8b2 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -1,7 +1,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. 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,10 +23,23 @@  -include("ssh_connect.hrl"). +%%% Optional callbacks handle_call/3, handle_cast/2, handle_msg/2, +%%% code_change/3 +%% Should be further specified later +-callback init(Options::list()) -> +    {ok, State::term()} | {ok, State::term(), Timeout::timeout()} |  +    {stop, Reason ::term()}.  + +-callback terminate(term(), term()) -> term(). + +-callback handle_ssh_msg({ssh_cm, ConnectionRef::term(), SshMsg::term()},  + 			 State::term()) -> {ok, State::term()} |  + 					   {stop, ChannelId::integer(),  + 					    State::term()}.  -behaviour(gen_server).  %%% API --export([behaviour_info/1, start/4, start/5, start_link/4, start_link/5, call/2, call/3, +-export([start/4, start/5, start_link/4, start_link/5, call/2, call/3,  	 cast/2, reply/2, enter_loop/1]).  %% gen_server callbacks @@ -50,17 +63,6 @@  %% API  %%==================================================================== -%%% Optionel callbacks handle_call/3, handle_cast/2, handle_msg/2, -%%% code_change/3 -behaviour_info(callbacks) -> -    [ -     {init, 1},  -     {terminate, 2},  -     {handle_ssh_msg, 2}, -     {handle_msg, 2} -     ]. - -  call(ChannelPid, Msg) ->      call(ChannelPid, Msg, infinity). diff --git a/lib/ssh/src/ssh_sftpd_file_api.erl b/lib/ssh/src/ssh_sftpd_file_api.erl index 176aa98194..38371f809d 100644 --- a/lib/ssh/src/ssh_sftpd_file_api.erl +++ b/lib/ssh/src/ssh_sftpd_file_api.erl @@ -1,7 +1,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. 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 @@ -21,27 +21,41 @@  -module(ssh_sftpd_file_api). --export([behaviour_info/1]). +%% To be further specified later +-callback close(IoDevice::term(), State::term()) ->  +    ok | {error, Reason::term()}. +-callback delete(Path::term(), State::term()) -> +     ok | {error, Reason::term()}. +-callback del_dir(Path::term(), State::term()) -> +    ok | {error, Reason::term()}. +-callback get_cwd(State::term()) -> +    {ok, Dir::term()} | {error, Reason::term()}. +-callback is_dir(AbsPath::term(), State::term()) -> +    boolean(). +-callback list_dir(AbsPath::term(), State::term()) -> +    {ok, Filenames::term()} | {error, Reason::term()}. +-callback make_dir(Dir::term(), State::term()) -> +    ok | {error, Reason::term()}. +-callback make_symlink(Path2::term(), Path::term(), State::term()) -> +    ok | {error, Reason::term()}. +-callback open(Path::term(), Flags::term(), State::term()) -> +    {ok, IoDevice::term()} | {error, Reason::term()}. +-callback position(IoDevice::term(), Offs::term(), State::term()) -> +    {ok, NewPosition::term()} | {error, Reason::term()}. +-callback read(IoDevice::term(), Len::term(), State::term()) -> +    {ok, Data::term()} | eof | {error, Reason::term()}. +-callback read_link(Path::term(), State::term()) -> +    {ok, FileName::term()} | {error, Reason::term()}. +-callback read_link_info(Path::term(), State::term()) -> +    {ok, FileInfo::term()} | {error, Reason::term()}. +-callback read_file_info(Path::term(), State::term()) -> +    {ok, FileInfo::term()} | {error, Reason::term()}. +-callback rename(Path::term(), Path2::term(), State::term()) -> +    ok | {error, Reason::term()}. +-callback write(IoDevice::term(), Data::term(), State::term()) -> +    ok | {error, Reason::term()}. +-callback write_file_info(Path::term(),Info::term(), State::term()) -> +    ok | {error, Reason::term()}. + + -behaviour_info(callbacks) -> -    [ -     {close, 2},  -     {delete, 2},  -     {del_dir, 2},  -     {get_cwd, 1},  -     {is_dir, 2},  -     {list_dir, 2},  -     {make_dir, 2},  -     {make_symlink, 3},  -     {open, 3},  -     {position, 3},  -     {read, 3}, -     {read_file_info, 2},  -     {read_link, 2},  -     {read_link_info, 2},  -     {rename, 3}, -     {write, 3},  -     {write_file_info, 3} -    ]; -behaviour_info(_) -> -    undefined. | 
