rename sccp_link to ss7_link, as it also serves ISUP and other services

This commit is contained in:
Harald Welte 2011-10-10 13:13:35 +02:00
parent 3368ac3b7c
commit ebaeb8d7f2
6 changed files with 22 additions and 22 deletions

View File

@ -4,9 +4,9 @@
{modules, [ osmo_sccp,
osmo_sccp_app,
osmo_sccp_sup,
sccp_links,
sccp_link_ipa_client,
sccp_link_m3ua,
ss7_links,
ss7_link_ipa_client,
ss7_link_m3ua,
sccp_routing,
sccp_scrc,
sccp_scoc,

View File

@ -33,8 +33,8 @@ init(Args) ->
permanent, 2000, worker, [sccp_scrc, sccp_codec, sccp_routing]},
UserChild = {sccp_user, {sccp_user, start_link, []},
permanent, 2000, worker, [sccp_user]},
LinksChild = {sccp_links, {sccp_links, start_link, []},
permanent, 2000, worker, [sccp_links]},
LinksChild = {ss7_links, {ss7_links, start_link, []},
permanent, 2000, worker, [ss7_links]},
%ScrcChild = {sccp_sclc, {sccp_sclc, start_link, [Args]},
% permanent, 2000, worker, [sccp_sclc, sccp_codec]},
{ok,{{one_for_one,60,600}, [ScrcChild, UserChild, LinksChild]}}.
@ -42,9 +42,9 @@ init(Args) ->
% Add a m3ua link to this supervisor
add_mtp_link(L=#sigtran_link{type = m3ua, name = Name,
local = Local, remote = Remote}) ->
ChildName = list_to_atom("sccp_link_m3ua_" ++ Name),
ChildSpec = {ChildName, {sccp_link_m3ua, start_link, [L]},
permanent, infinity, worker, [sccp_link_m3ua]},
ChildName = list_to_atom("ss7_link_m3ua_" ++ Name),
ChildSpec = {ChildName, {ss7_link_m3ua, start_link, [L]},
permanent, infinity, worker, [ss7_link_m3ua]},
supervisor:start_child(?MODULE, ChildSpec);
add_mtp_link([]) ->
ok;

View File

@ -206,4 +206,4 @@ send_mtp_transfer_down(LoopDat, EncMsg) ->
routing_label = Rlbl, payload = EncMsg},
MtpPrim = #primitive{subsystem = 'MTP', gen_name = 'TRANSFER',
spec_name = request, parameters = Mtp3},
sccp_links:mtp3_tx(Mtp3).
ss7_links:mtp3_tx(Mtp3).

View File

@ -17,7 +17,7 @@
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
-module(sccp_link_ipa_client).
-module(ss7_link_ipa_client).
-author('Harald Welte <laforge@gnumonks.org>').
-behavior(gen_server).
@ -49,7 +49,7 @@ init(L = #sigtran_link{type = ipa_client, name = Name, linkset_name = LinksetNam
{user_fun, fun ipa_tx_to_user/2}, {user_args, self()}],
{ok, IpaPid} = ipa_core:start_link(Opts),
% FIXME: register this link with SCCP_SCRC
ok = sccp_link:register_link(LinksetName, Sls, Name),
ok = ss7_link:register_link(LinksetName, Sls, Name),
{ok, #loop_dat{ipa_pid = IpaPid, link = L}}.
% % instantiate SCCP routing instance
@ -58,7 +58,7 @@ init(L = #sigtran_link{type = ipa_client, name = Name, linkset_name = LinksetNam
set_link_state(#sigtran_link{linkset_name = LinksetName, sls = Sls}, State) ->
ok = sccp_links:set_link_state(LinksetName, Sls, State).
ok = ss7_links:set_link_state(LinksetName, Sls, State).
scrc_tx_to_mtp(Prim, Args) ->
M3uaPid = Args,

View File

@ -17,7 +17,7 @@
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
-module(sccp_link_m3ua).
-module(ss7_link_m3ua).
-author('Harald Welte <laforge@gnumonks.org>').
-behavior(gen_server).
@ -49,7 +49,7 @@ init(L = #sigtran_link{type = m3ua, name = Name, linkset_name = LinksetName,
{user_fun, fun m3ua_tx_to_user/2}, {user_args, self()}],
{ok, M3uaPid} = m3ua_core:start_link(Opts),
% FIXME: register this link with SCCP_SCRC
ok = sccp_links:register_link(LinksetName, Sls, Name),
ok = ss7_links:register_link(LinksetName, Sls, Name),
{ok, #loop_dat{m3ua_pid = M3uaPid, link = L}}.
% % instantiate SCCP routing instance
@ -58,7 +58,7 @@ init(L = #sigtran_link{type = m3ua, name = Name, linkset_name = LinksetName,
set_link_state(#sigtran_link{linkset_name = LinksetName, sls = Sls}, State) ->
ok = sccp_links:set_link_state(LinksetName, Sls, State).
ok = ss7_links:set_link_state(LinksetName, Sls, State).
scrc_tx_to_mtp(Prim, Args) ->
M3uaPid = Args,

View File

@ -17,7 +17,7 @@
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
-module(sccp_links).
-module(ss7_links).
-behaviour(gen_server).
-include_lib("osmo_ss7/include/mtp3.hrl").
@ -74,14 +74,14 @@ start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], [{debug, [trace]}]).
init(_Arg) ->
LinksetTbl = ets:new(sccp_linksets, [ordered_set, named_table,
LinksetTbl = ets:new(ss7_linksets, [ordered_set, named_table,
{keypos, #slinkset.name}]),
ServiceTbl = ets:new(mtp3_services, [ordered_set, named_table,
{keypos, #service.service_nr}]),
% create a named table so we can query without reference directly
% within client/caller process
LinkTbl = ets:new(sccp_link_table, [ordered_set, named_table,
LinkTbl = ets:new(ss7_link_table, [ordered_set, named_table,
{keypos, #slink.key}]),
{ok, #su_state{linkset_tbl = LinksetTbl, link_tbl = LinkTbl,
service_tbl = ServiceTbl}}.
@ -118,7 +118,7 @@ unbind_service(ServiceNum) ->
% the client process, no need to go through a synchronous IPC
get_pid_for_link(LinksetName, Sls) ->
case ets:lookup(sccp_link_table, {LinksetName, Sls}) of
case ets:lookup(ss7_link_table, {LinksetName, Sls}) of
[#slink{user_pid = Pid}] ->
% FIXME: check the link state
{ok, Pid};
@ -128,7 +128,7 @@ get_pid_for_link(LinksetName, Sls) ->
% Resolve linkset name directly connected to given point code
get_linkset_for_dpc(Dpc) ->
Ret = ets:match_object(sccp_linksets,
Ret = ets:match_object(ss7_linksets,
#slinkset{remote_pc = Dpc, _ = '_'}),
case Ret of
[] ->
@ -173,7 +173,7 @@ mtp3_tx(Mtp3 = #mtp3_msg{routing_label = RoutLbl}) ->
end.
dump_all_links() ->
List = ets:tab2list(sccp_linksets),
List = ets:tab2list(ss7_linksets),
dump_linksets(List).
dump_linksets([]) ->
@ -190,7 +190,7 @@ dump_single_linkset(Sls) when is_record(Sls, slinkset) ->
dump_linkset_links(Name).
dump_linkset_links(Name) ->
List = ets:match_object(sccp_link_table,
List = ets:match_object(ss7_link_table,
#slink{key={Name,'_'}, _='_'}),
dump_links(List).