aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-30 10:08:54 +0200
committerAnders Svensson <[email protected]>2017-06-13 13:50:07 +0200
commitc59325f2a24e6ca3217c660fa328a00cf440e58d (patch)
tree98e88bf608e5f3a68622bb61bf585899a6b6a83a /lib/diameter/src
parent84dbccad048374e3eb1ec7372fd177eba022d108 (diff)
downloadotp-c59325f2a24e6ca3217c660fa328a00cf440e58d.tar.gz
otp-c59325f2a24e6ca3217c660fa328a00cf440e58d.tar.bz2
otp-c59325f2a24e6ca3217c660fa328a00cf440e58d.zip
Restore diameter_codec:decode/2, update diameter_codec(3)
The documentation has been out of date since the string_decode option was added in commit 1590920c. The optionless decode/2 was removed in the commit that removed the use of the process dictionary in decode.
Diffstat (limited to 'lib/diameter/src')
-rw-r--r--lib/diameter/src/base/diameter_codec.erl24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index a4d816db4e..82fa796e69 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -20,10 +20,8 @@
-module(diameter_codec).
--export([encode/2,
- encode/3,
- decode/3,
- decode/4,
+-export([encode/2, encode/3,
+ decode/2, decode/3, decode/4,
collect_avps/1,
decode_header/1,
sequence_numbers/1,
@@ -68,6 +66,10 @@
%%% # encode/2
%%% ---------------------------------------------------------------------------
+%% The representative encode documented in diameter_codec(3). As of
+%% the options that affect encode (eg. ordered_encode), it's no longer
+%% *the* encode.
+
encode(Mod, Msg) ->
encode(Mod, #{ordered_encode => true}, Msg).
@@ -277,6 +279,20 @@ rec2msg(Mod, Rec) ->
Mod:rec2msg(element(1, Rec)).
%%% ---------------------------------------------------------------------------
+%%% # decode/2
+%%% ---------------------------------------------------------------------------
+
+%% The representative default decode documented in diameter_codec(3).
+%% As of the options that affect decode (eg. string_decode), it's no
+%% longer *the* decode.
+
+decode(Mod, Pkt) ->
+ Opts = #{string_decode => true,
+ strict_mbit => true,
+ rfc => 6733},
+ decode(Mod, Opts, Pkt).
+
+%%% ---------------------------------------------------------------------------
%%% # decode/3
%%% ---------------------------------------------------------------------------