blob: 437b3e89a6d0f3a60467a2b9fd4c3c898939319a [file] [log] [blame]
Harald Welte1f6a0352011-01-15 20:07:45 +01001% RFC 3331 MTP2 User Adaption Layer coding / decoding
2
3% (C) 2011 by Harald Welte <laforge@gnumonks.org>
4%
5% All Rights Reserved
6%
7% This program is free software; you can redistribute it and/or modify
8% it under the terms of the GNU Affero General Public License as
9% published by the Free Software Foundation; either version 3 of the
10% License, or (at your option) any later version.
11%
12% This program is distributed in the hope that it will be useful,
13% but WITHOUT ANY WARRANTY; without even the implied warranty of
14% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15% GNU General Public License for more details.
16%
17% You should have received a copy of the GNU Affero General Public License
18% along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20-module(m2ua_codec).
21-author('Harald Welte <laforge@gnumonks.org>').
Harald Welte231ae0b2012-04-01 20:13:23 +020022-include("xua.hrl").
Harald Welte1f6a0352011-01-15 20:07:45 +010023-include("m2ua.hrl").
24
25-export([parse_m2ua_msg/1, encode_m2ua_msg/1]).
26
Harald Welte1f6a0352011-01-15 20:07:45 +010027% parse a M2UA message binary into a record
28parse_m2ua_msg(DataBin) when is_binary(DataBin) ->
Harald Welte231ae0b2012-04-01 20:13:23 +020029 xua_codec:parse_msg(DataBin).
Harald Welte1f6a0352011-01-15 20:07:45 +010030
31% encode a message from record to binary
Harald Welte231ae0b2012-04-01 20:13:23 +020032encode_m2ua_msg(Msg) when is_record(Msg, xua_msg) ->
33 xua_codec:encode_msg(Msg).