move invert_rout_lbl to mtp3_codec and export it there
diff --git a/src/mtp3_codec.erl b/src/mtp3_codec.erl
index 9dc50c2..3c34a6e 100644
--- a/src/mtp3_codec.erl
+++ b/src/mtp3_codec.erl
@@ -21,7 +21,7 @@
-author('Harald Welte <laforge@gnumonks.org>').
-include("mtp3.hrl").
--export([parse_mtp3_msg/1, encode_mtp3_msg/1]).
+-export([parse_mtp3_msg/1, encode_mtp3_msg/1, invert_rout_lbl/1]).
-compile({parse_transform, exprecs}).
-export_records([mtp3_routing_label, mtp3_msg]).
@@ -74,3 +74,6 @@
payload_to_binary(_, Whatever) ->
Whatever.
+
+invert_rout_lbl(L = #mtp3_routing_label{origin_pc = Opc, dest_pc = Dpc}) ->
+ L#mtp3_routing_label{origin_pc = Dpc, dest_pc = Opc}.
diff --git a/src/mtp3_sltc.erl b/src/mtp3_sltc.erl
index d440be0..cdca675 100644
--- a/src/mtp3_sltc.erl
+++ b/src/mtp3_sltc.erl
@@ -170,7 +170,7 @@
payload = #mtp3mg_msg{h0 = ?MTP3MG_H0_TEST,
h1 = ?MTP3MG_H1_SLTM,
payload = TP}}) ->
- InvRoutLbl = invert_rout_lbl(RoutLbl),
+ InvRoutLbl = mtp3_codec:invert_rout_lbl(RoutLbl),
M#mtp3_msg{routing_label = InvRoutLbl,
payload = #mtp3mg_msg{h0 = ?MTP3MG_H0_TEST,
h1 = ?MTP3MG_H1_SLTA,
@@ -204,8 +204,3 @@
_ ->
false
end.
-
-
-
-invert_rout_lbl(L = #mtp3_routing_label{origin_pc = Opc, dest_pc = Dpc}) ->
- L#mtp3_routing_label{origin_pc = Dpc, dest_pc = Opc}.