blob: 3b7fd9925e81c23faa16b7140b68ad5c7753bc2a [file] [log] [blame]
Harald Weltee895c9b2011-01-22 20:55:56 +00001% OTP Supervisor for MGW NAT
2
3% (C) 2011 by Harald Welte <laforge@gnumonks.org>
4% (C) 2011 OnWaves
5%
6% All Rights Reserved
7%
8% This program is free software; you can redistribute it and/or modify
9% it under the terms of the GNU Affero General Public License as
10% published by the Free Software Foundation; either version 3 of the
11% License, or (at your option) any later version.
12%
13% This program is distributed in the hope that it will be useful,
14% but WITHOUT ANY WARRANTY; without even the implied warranty of
15% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16% GNU General Public License for more details.
17%
18% You should have received a copy of the GNU Affero General Public License
19% along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21-module(mgw_nat_sup).
22-behavior(supervisor).
23
24-export([start_link/0]).
25-export([init/1]).
26
27-define(MSC_LOCAL_IP, any).
28-define(MSC_LOCAL_PORT, 2904).
29-define(MSC_REMOTE_IP, {172,16,1,81}).
30-define(STP_REMOTE_IP, {172,16,249,20}).
31-define(STP_REMOTE_PORT, 2904).
32
33-define(SCTP_HDLR_ARGS, [?MSC_LOCAL_IP, ?MSC_LOCAL_PORT, ?MSC_REMOTE_IP,
34 ?STP_REMOTE_IP, ?STP_REMOTE_PORT]).
35
36start_link() ->
37 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
38
39init(_Arg) ->
Harald Welte9ea33d32011-01-23 18:43:02 +010040 MgwChild = {mgw_nat_usr, {mgw_nat_usr, start_link, [?SCTP_HDLR_ARGS]},
Harald Weltee895c9b2011-01-22 20:55:56 +000041 permanent, 2000, worker, [mgw_nat_usr, sctp_handler, mgw_nat]},
42 {ok,{{one_for_all,1,1}, [MgwChild]}}.