From 9abbbade02668a890b2fbc51df05a00e5dce0c5c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 21 Apr 2011 12:19:41 +0200 Subject: SCCP: move is_connectionless/1 to sccp_codec --- src/sccp_codec.erl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/sccp_codec.erl') 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 '). -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. -- cgit v1.2.3