aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base
AgeCommit message (Collapse)Author
2017-09-18Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Fix append of Route-Record AVPs
2017-09-15Fix append of Route-Record AVPsAnders Svensson
Commit b3d9e0c0 did away with the reordering of diameter_avp lists, so prepending the AVP to the list means prepending it in the message, which is not what the RFC requires. Appending to a list isn't ideal, but right now there's no better way.
2017-09-13Merge branch 'anders/diameter/grouped_decode/OTP-14607' into maintAnders Svensson
* anders/diameter/grouped_decode/OTP-14607: Fix diameter_packet.avps decode of Grouped AVP errors in Failed-AVP
2017-09-13Merge branch 'anders/diameter/DOIC/OTP-14588' into maintAnders Svensson
* anders/diameter/DOIC/OTP-14588: Fix avp_dictionaries decode with {decode_format, none}
2017-09-11Fix diameter_packet.avps decode of Grouped AVP errors in Failed-AVPAnders Svensson
The decode didn't respect the format as a list of diameter_avp records, so information about faulty component AVPs was lost.
2017-09-11Fix avp_dictionaries decode with {decode_format, none}Anders Svensson
Decode is only a no-op when the AVP is Grouped, and then only on the Grouped AVP itself, not its components.
2017-09-09Merge branch 'anders/diameter/config_consistency/OTP-14555' into maintAnders Svensson
* anders/diameter/config_consistency/OTP-14555: Fix type spec Fix strict_arities blunder
2017-09-09Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Simplify implementation in diameter_reg (take 2)
2017-09-08Fix type specAnders Svensson
Map key was not retained when the spec was added in commit 66bb5251.
2017-09-08Fix strict_arities blunderAnders Svensson
The watchdog process retained the configuration, causing DWR/DWA encode to fail on a string-valued Origin-Host/Realm if the encode arity was relaxed. Bungled in commit 5f3becad.
2017-09-07Simplify implementation in diameter_reg (take 2)Anders Svensson
Simplify the simplification. The order of sending is changed, but the order isn't significant.
2017-09-07Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Simplify implementation in diameter_reg Fix type spec Fix minor monitor blunder in diameter_reg
2017-09-06Simplify implementation in diameter_regAnders Svensson
Use maps instead of dict for traceability more than performance.
2017-09-06Fix type specAnders Svensson
That dialyzer hasn't noticed is wrong.
2017-09-05Merge branch 'anders/diameter/DOIC/OTP-14588' into maintAnders Svensson
* anders/diameter/DOIC/OTP-14588: Exercise avp_dictionaries in traffic suite Let generic AVPs be encoded/decoded in alternate dictionaries Rename field in codec map: dictionary -> app_dictionary Add RFC 7683 Diameter Overload Indicator Conveyance text and dictionary Fix decode undef Fix dictionary compilation error message
2017-09-05Fix minor monitor blunder in diameter_regAnders Svensson
Commit 58091992 discarded a new monitor reference, so didn't avoid multiple monitors as was the intention. The blunder was harmless since all but the first DOWN message resulted in notifications.
2017-09-04Let generic AVPs be encoded/decoded in alternate dictionariesAnders Svensson
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.
2017-09-04Rename field in codec map: dictionary -> app_dictionaryAnders Svensson
To better reflect what the field is: field 'module' is the dictionary module that's calling diameter_gen to decode a list of AVP, while field 'app_dictionary' is the dictionary module defining the message being decoded.
2017-09-04Fix decode undefAnders Svensson
Function avp/5 isn't exported from dictionary modules. Not necessarily intentional, but don't just export it since that requires recompilation of all dictionary modules, since the function is in diameter_gen.hrl. Not having to recompile was the main motivation for moving most of the included code to module diameter_gen in commit 205521d3. This reveals a weakness in the decode of answers setting the E-bit: any AVP that isn't defined by the common application won't be decoded; the diameter_avp records that these are packed into (in the 'AVP' field of a message record, or equivalent) will have value = undefined. This is nothing new (same in OTP 19), but the values should be decoded. Fix it (and the lack of test coverage) in a subsequent commit that will add avp_dictionaries config.
2017-09-03Merge branch 'anders/diameter/decode_format/OTP-14511' into maintAnders Svensson
* anders/diameter/decode_format/OTP-14511: Map less in traffic suite Fix decode_format doc oversights Rename decode_format false to none Tweak {decode_format, false} semantics Fix dialyzer spec
2017-09-03Merge branch 'anders/diameter/config_consistency/OTP-14555' into maintAnders Svensson
* anders/diameter/config_consistency/OTP-14555: Fix strict_arities blunder Fix minor error-handling blunder
2017-09-03Merge branch 'anders/diameter/Proxy-Info/OTP-9869' into maintAnders Svensson
* anders/diameter/Proxy-Info/OTP-9869: Fix handling of Proxy-Info in answers formulated by diameter
2017-09-03Merge branch 'anders/diameter/Experimental-Result/OTP-14511' into maintAnders Svensson
* anders/diameter/Experimental-Result/OTP-14511: Fix extraction of Experimental-Result for counter keys
2017-09-03Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Rename variable Fix decode of too many generic AVPs Enumerate AVPs in diameter_avp.index (again)
2017-09-01Rename decode_format false to noneAnders Svensson
Which reads better and makes it easier to distinguish this false from others.
2017-09-01Tweak {decode_format, false} semanticsAnders Svensson
Represent the decoded message by its atom-valued name in diameter_packet.msg, which makes trace much more readable. A diameter_avp.value is untouched (ie. undefined): the AVP name is already in the name field.
2017-09-01Fix dialyzer specAnders Svensson
Which dialyzer hasn't noticed.
2017-09-01Merge branch 'anders/diameter/config_consistency/OTP-14555' into ↵Anders Svensson
anders/diameter/decode_format/OTP-14511 * anders/diameter/config_consistency/OTP-14555: Fix strict_arities blunder Fix minor error-handling blunder Let strict_mbit and incoming_maxlen be configured per transport Let a service configure default transport options Rename type evaluable -> eval Document transport_opt() strict_capx Rename transport_opt() capx_strictness to strict_capx
2017-09-01Fix strict_arities blunderAnders Svensson
Remove value from the merged map, not from the maps being merged. Bundled in commit 5f3becad.
2017-08-31Fix minor error-handling blunderAnders Svensson
Leading to this admonition from dialyzer: diameter_config.erl:670: The variable No can never match since previous clauses completely covered the type 'ok' The throw was caught, but resulted in an error return without the intended information.
2017-08-31Fix handling of Proxy-Info in answers formulated by diameterAnders Svensson
RFC 6733 says this: 6.2. Diameter Answer Processing When a request is locally processed, the following procedures MUST be applied to create the associated answer, in addition to any additional procedures that MAY be discussed in the Diameter application defining the command: ... o Any Proxy-Info AVPs in the request MUST be added to the answer message, in the same order they were present in the request. This wasn't done when a handle_request callback returned a Result-Code in an 'answer-message' or protocol_error tuple, causing diameter itself to construct the answer message. This form of answer is just a convenience, since the callback can always return an answer that it constructs itself.
2017-08-31Fix extraction of Experimental-Result for counter keysAnders Svensson
The introduction of decode_format in commit 722fa415 (and then 55e65b26) meant the value was not necessarily the intended tuple.
2017-08-31Rename variableAnders Svensson
It's no longer the AVP name as of the parent commit, but the name of the field/member the value will be stored in. Typically the AVP name, but possibly 'AVP'.
2017-08-31Fix decode of too many generic AVPsAnders Svensson
That is, when the arity of an 'AVP' field has an upper bound. This shouldn't happen in practice, but if an AVP is known but its name not explicit in the message grammar then its count was confused with that of AVPs packed into the 'AVP' field.
2017-08-31Enumerate AVPs in diameter_avp.index (again)Anders Svensson
Commit 96cd627a changed the way the index field was used, but the enumeration is used in at least one known application (as a pointer from elements of diameter_packet.errors to elements of diameter_packet.avps) and the motivation for the change is questionable: the lookup that was avoided was unnecessary given that it was already performed in incrementing a counter. Revert to enumerating as before in the non-relay case, but not in the relay case since there's no corresponding usecase.
2017-08-29Merge branch 'anders/diameter/config_consistency/OTP-14555' into maintAnders Svensson
* anders/diameter/config_consistency/OTP-14555: Let strict_mbit and incoming_maxlen be configured per transport Let a service configure default transport options Rename type evaluable -> eval
2017-08-29Merge branch 'anders/diameter/upgrade/OTP-14552' into maintAnders Svensson
* anders/diameter/upgrade/OTP-14552: Fix compatibility of remote send
2017-08-29Merge branch 'anders/diameter/strict_capx/OTP-14546' into maintAnders Svensson
* anders/diameter/strict_capx/OTP-14546: Document transport_opt() strict_capx Rename transport_opt() capx_strictness to strict_capx
2017-08-29Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Fix influence of decode_format on service events Work around more common_test woe
2017-08-29Merge branch 'anders/diameter/caseless/OTP-14535' into maintAnders Svensson
* anders/diameter/caseless/OTP-14535: Replace calls to inet_parse(3) Fix regexp match of accept tuple in diameter_tcp/sctp
2017-08-28Fix influence of decode_format on service eventsAnders Svensson
Decoded CER/CEA messages are passed in events messages that can be subscribed to using diameter:subscribe/1. A configured decode_format was not reflected in these, messages always being passed as records. Clarify that strict_arities only applies to message callbacks.
2017-08-25Let strict_mbit and incoming_maxlen be configured per transportAnders Svensson
Since these can make sense per peer. The remaining service-only options either belong there or make little sense being configured per transport.
2017-08-25Let a service configure default transport optionsAnders Svensson
Only a default spawn_opt has been possible to configure, but there's no reason why most others should need to be configured per transport. Those options that still only make sense on a transport are transport_module/config (because of the semantics of multiple values), applications/capabilities (since these override service options), and private (since it's only to allow user-specific options in a backwards compatible way).
2017-08-24Rename type evaluable -> evalAnders Svensson
Export the old type as a synonym for backwards compatability. The name evaluable is a bit too awkward.
2017-08-24Rename transport_opt() capx_strictness to strict_capxAnders Svensson
To follow the naming of options like strict_mbit and more. Still accept capx_strictness since this is known to be used. Introduced in commit e4f28f3b.
2017-08-23Fix compatibility of remote sendAnders Svensson
By changing the definition of the request record, commit f489c0d5 broke sending an outgoing request over a peer connection terminated on a remote node running an older version of diameter. The modified fields aren't even used on the remote node, so simply reintroduce one of the fields so that the size of the tuple is unchanged.
2017-08-18Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Work around unexpected common_test behaviour Randomly skip groups in traffic suite Randomly disable traffic counters in traffic suite Add service_opt() traffic_counters Fix type spec Split AVPs at decode Avoid unnecessary copying of binaries in diameter_tcp Don't update diameter_tcp state unnecessarily Don't update diameter_tcp state unnecessarily Simplify extraction of incoming Diameter messages in diameter_tcp Restructure/simplify message reception in diameter_peer_fsm Sleep randomly at the start of (parallel) traffic testcases Fix ct return value in traffic suite Fix type spec Optimize sub-binaries Optimize sub-binaries Count AVPs in #diameter_avp.index Don't extract options unnecessarily at encode Redo message decode as a single pass
2017-08-18Merge branch 'anders/diameter/5009/OTP-14512' into maintAnders Svensson
* anders/diameter/5009/OTP-14512: Use relaxed arity checks in traffic suite Be forgiving of non-list values at encode Add service_opt() strict_arities Fix detection of 5009 errors Test Result-Code 5009 in traffic suite
2017-08-18Merge branch 'anders/diameter/codec/OTP-14511' into maintAnders Svensson
* anders/diameter/codec/OTP-14511: (26 commits) Limit SCTP testing in traffic suite Increase init_per_group timetrap in traffic suite Add diameter_util:eprof/1 for test Don't search forms unnecessarily in diameter_exprecs parse transform Increase init_per_suite timetrap in traffic suite Don't count AVPs unnecessarily at encode Test decode_format record_from_map in traffic suite Tweak limiting of testcases in traffic suite Don't take length of AVP lists unnecessarily at encode Tweak map-valued decode Rearrange group names in traffic suite Randomly wrap answers in diameter_packet in transport suite Don't exercise client/server encoding independently in traffic suite Add decode_format record_from_map Rename record_decode -> decode_format Create fewer client connections in traffic suite Test record_decode in traffic suite Map answers to maps in traffic suite Test map encoding in traffic suite Let messages and grouped AVPs be decoded to lists ...
2017-08-15Replace calls to inet_parse(3)Anders Svensson
With the documented calls to inet(3).