1%% 2%% %CopyrightBegin% 3%% 4%% Copyright Ericsson AB 2008-2018. All Rights Reserved. 5%% 6%% Licensed under the Apache License, Version 2.0 (the "License"); 7%% you may not use this file except in compliance with the License. 8%% You may obtain a copy of the License at 9%% 10%% http://www.apache.org/licenses/LICENSE-2.0 11%% 12%% Unless required by applicable law or agreed to in writing, software 13%% distributed under the License is distributed on an "AS IS" BASIS, 14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15%% See the License for the specific language governing permissions and 16%% limitations under the License. 17%% 18%% %CopyrightEnd% 19%% 20 21%% 22%%---------------------------------------------------------------------- 23%% Purpose: The supervisor for tcpip-forwarding acceptor 24%%---------------------------------------------------------------------- 25 26-module(ssh_tcpip_forward_acceptor_sup). 27-behaviour(supervisor). 28 29-include("ssh.hrl"). 30 31-export([start_link/0, start_child/7]). 32 33%% Supervisor callback 34-export([init/1]). 35 36%%%========================================================================= 37%%% API 38%%%========================================================================= 39start_link() -> 40 supervisor:start_link(?MODULE, []). 41 42start_child(Sup, LSock, ListenAddr, ConnectToAddr, ChanType, ChanCB, ConnPid) -> 43 Args = [LSock, ListenAddr, ConnectToAddr, ChanType, ChanCB, ConnPid], 44 supervisor:start_child(Sup, 45 #{id => {ListenAddr,ConnectToAddr}, 46 start => {ssh_tcpip_forward_acceptor, start_link, Args} 47 }). 48 49 50%%%========================================================================= 51%%% Supervisor callback 52%%%========================================================================= 53init([]) -> 54 SupFlags = #{strategy => one_for_one, 55 intensity => 10, 56 period => 3600 57 }, 58 ChildSpecs = [], 59 {ok, {SupFlags,ChildSpecs}}. 60 61%%%========================================================================= 62%%% Internal functions 63%%%========================================================================= 64