diff options
author | Anders Svensson <[email protected]> | 2017-09-02 16:17:47 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-09-04 15:45:04 +0200 |
commit | 2a25b1f4a45430a2df973f3c632b5aae703d9b81 (patch) | |
tree | ee4599d2cd53bee95e026b521a6029f66de6feed /lib/diameter/src/base/diameter_service.erl | |
parent | 382c88e5fdb92c6f97acad2f1c260cc69759b8e5 (diff) | |
download | otp-2a25b1f4a45430a2df973f3c632b5aae703d9b81.tar.gz otp-2a25b1f4a45430a2df973f3c632b5aae703d9b81.tar.bz2 otp-2a25b1f4a45430a2df973f3c632b5aae703d9b81.zip |
Let generic AVPs be encoded/decoded in alternate dictionaries
To support specifications like RFC 7683 DOIC, that only define AVPs, not
applications. AVPs that aren't known to the application dictionary in
question could previously not be decoded. Configuring alternate
dictionaries with the new transport/service option avp_dictionaries
changes this, so that AVPs like DOIC's Grouped OC-OLR can presented in
their fully decoded glory. Encode is also extended, allowing things like
the following to be encoded in an outgoing message:
'AVP' => [{'OC-OLR', #{'OC-Sequence-Number' => 1,
'OC-Report-Type' => 0,
'OC-Reduction-Percentage' => [25]}}]
A diameter_gen_doic_rfc7683 dictionary is installed, but
avp_dictionaries isn't specific to DOIC.
This commit also solves the problem demonstrated a few commits back,
that application AVPs aren't decoded in answers setting the E-bit. Test
coverage will come in a subsequent commit.
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 1e104f9e65..7cd4d23402 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -115,6 +115,7 @@ strict_arities => diameter:strict_arities(), strict_mbit := boolean(), decode_format := diameter:decode_format(), + avp_dictionaries => nonempty_list(module()), traffic_counters := boolean(), string_decode := boolean(), capabilities_cb => diameter:evaluable(), @@ -718,7 +719,8 @@ init_peers() -> %% TPid} service_opts(Opts) -> - remove([{strict_arities, true}], + remove([{strict_arities, true}, + {avp_dictionaries, []}], maps:merge(maps:from_list([{monitor, false} | def_opts()]), maps:from_list(Opts))). @@ -735,6 +737,7 @@ def_opts() -> %% defaults on the service map {strict_arities, true}, {strict_mbit, true}, {decode_format, record}, + {avp_dictionaries, []}, {traffic_counters, true}, {string_decode, true}, {spawn_opt, []}]. |