summaryrefslogtreecommitdiffstats
path: root/src/m2ua_codec.erl
blob: 437b3e89a6d0f3a60467a2b9fd4c3c898939319a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% RFC 3331 MTP2 User Adaption Layer coding / decoding

% (C) 2011 by Harald Welte <laforge@gnumonks.org>
%
% All Rights Reserved
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as
% published by the Free Software Foundation; either version 3 of the
% License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.

-module(m2ua_codec).
-author('Harald Welte <laforge@gnumonks.org>').
-include("xua.hrl").
-include("m2ua.hrl").

-export([parse_m2ua_msg/1, encode_m2ua_msg/1]).

% parse a M2UA message binary into a record
parse_m2ua_msg(DataBin) when is_binary(DataBin) ->
	xua_codec:parse_msg(DataBin).

% encode a message from record to binary
encode_m2ua_msg(Msg) when is_record(Msg, xua_msg) ->
	xua_codec:encode_msg(Msg).