diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-04-21 12:19:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-04-21 12:19:41 +0200 |
commit | 9abbbade02668a890b2fbc51df05a00e5dce0c5c (patch) | |
tree | acf58dbd6bd56f4464bc6ca747c9824124c93c43 /src/sccp_codec.erl | |
parent | fec3d94ca9696e0500fce873b15556a428e0ab23 (diff) |
SCCP: move is_connectionless/1 to sccp_codec
Diffstat (limited to 'src/sccp_codec.erl')
-rw-r--r-- | src/sccp_codec.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/sccp_codec.erl b/src/sccp_codec.erl index a3b0352..25ad05b 100644 --- a/src/sccp_codec.erl +++ b/src/sccp_codec.erl @@ -21,7 +21,8 @@ -author('Harald Welte <laforge@gnumonks.org>'). -include("sccp.hrl"). --export([parse_sccp_msg/1, encode_sccp_msg/1, encode_sccp_msgt/2]). +-export([parse_sccp_msg/1, encode_sccp_msg/1, encode_sccp_msgt/2, + is_connectionless/1]). -compile(export_all). @@ -433,3 +434,17 @@ encode_sccp_msgt(?SCCP_MSGT_IT, Params) -> % encode one sccp message data structure into the on-wire format encode_sccp_msg(#sccp_msg{msg_type = MsgType, parameters = Params}) -> encode_sccp_msgt(MsgType, Params). + +% is the supplied message type a connectionless message? +is_connectionless(#sccp_msg{msg_type = MsgType}) -> + is_connectionless(MsgType); +is_connectionless(MsgType) -> + case MsgType of + ?SCCP_MSGT_UDT -> true; + ?SCCP_MSGT_UDTS -> true; + ?SCCP_MSGT_XUDT -> true; + ?SCCP_MSGT_XUDTS -> true; + ?SCCP_MSGT_LUDT -> true; + ?SCCP_MSGT_LUDTS -> true; + _ -> false + end. |