move invert_rout_lbl to mtp3_codec and export it there
This commit is contained in:
parent
cbddf84dde
commit
1180b7cf00
|
@ -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(?MTP3_SERV_MGMT, #mtp3mg_msg{h0=H0, h1=H1, payload=Payload}) -
|
|||
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}.
|
||||
|
|
|
@ -170,7 +170,7 @@ slta_from_sltm(M = #mtp3_msg{service_ind = ?MTP3_SERV_MTN,
|
|||
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 @@ slt_matches(#mtp3_msg{routing_label = RoutLbl,
|
|||
_ ->
|
||||
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}.
|
||||
|
|
Loading…
Reference in New Issue