summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-12-08 12:10:34 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-08 12:10:34 +0100
commit4608ba17792f70b9028cab84e576cd287be69786 (patch)
tree4bf769721bd64099ca79b9f425d3fee88b7fda10
parent19350ad9d443e226b603753dc48b3339136b56f0 (diff)
ss7_{links,routes}: deal with tuple/record point codes
-rw-r--r--src/ss7_links.erl6
-rw-r--r--src/ss7_routes.erl6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ss7_links.erl b/src/ss7_links.erl
index aa91330..da6f790 100644
--- a/src/ss7_links.erl
+++ b/src/ss7_links.erl
@@ -138,7 +138,8 @@ get_pid_for_link(LinksetName, Sls) when is_list(LinksetName), is_integer(Sls) ->
end.
% Resolve linkset name directly connected to given point code
-get_linkset_for_dpc(Dpc) when is_integer (Dpc) ->
+get_linkset_for_dpc(DpcIn) ->
+ Dpc = osmo_util:pointcode2int(DpcIn),
Ret = ets:match_object(ss7_linksets,
#slinkset{remote_pc = Dpc, _ = '_'}),
case Ret of
@@ -149,7 +150,8 @@ get_linkset_for_dpc(Dpc) when is_integer (Dpc) ->
end.
% resolve link-handler Pid for given (directly connected) point code/sls
-get_pid_for_dpc_sls(Dpc, Sls) when is_integer(Dpc) and is_integer(Sls) ->
+get_pid_for_dpc_sls(DpcIn, Sls) when is_integer(Sls) ->
+ Dpc = osmo_util:pointcode2int(DpcIn),
case get_linkset_for_dpc(Dpc) of
{error, Err} ->
{error, Err};
diff --git a/src/ss7_routes.erl b/src/ss7_routes.erl
index 6aac951..ba66742 100644
--- a/src/ss7_routes.erl
+++ b/src/ss7_routes.erl
@@ -69,10 +69,12 @@ init(_Arg) ->
% all write operations go through gen_server:call(), as only the ?MODULE
% process has permission to modify the table content
-create_route(RemotePc, RemoteMask, LinksetName) ->
+create_route(RemotePcIn, RemoteMask, LinksetName) ->
+ RemotePc = osmo_util:pointcode2int(RemotePcIn),
gen_server:call(?MODULE, {create_route, {RemotePc, RemoteMask, LinksetName}}).
-delete_route(RemotePc, RemoteMask, LinksetName) ->
+delete_route(RemotePcIn, RemoteMask, LinksetName) ->
+ RemotePc = osmo_util:pointcode2int(RemotePcIn),
gen_server:call(?MODULE, {delete_route, {RemotePc, RemoteMask, LinksetName}}).
% the lookup functions can directly use the ets named_table from within