Age | Commit message (Collapse) | Author |
|
|
|
To control whether stringish Diameter types are decoded to string or
left as binary. The motivation is the same as in the parent commit: to
avoid large strings being copied when incoming Diameter messages are
passed between processes; or *if* in the case of messages destined for
handle_request and handle_answer callbacks, since these are decoded in
the dedicated processes that the callbacks take place in. It would be
possible to do something about other messages without requiring an
option, but disabling the decode is the most effective.
The value is a boolean(), true being the default for backwards
compatibility. Setting false causes both diameter_caps records and
decoded messages to contain binary() in relevant places that previously
had string(): diameter_app(3) callbacks need to be prepared for the
change.
The Diameter types affected are OctetString and the derived types that
can contain arbitrarily large values: OctetString, UTF8String,
DiameterIdentity, DiameterURI, IPFilterRule, and QoSFilterRule. Time and
Address are unaffected.
The DiameterURI decode has been redone using re(3), which both
simplifies and does away with a vulnerability resulting from the
conversion of arbitrary strings to atom.
The solution continues the use and abuse of the process dictionary for
encode/decode purposes, last seen in commit 0f9cdba.
|
|
|
|
Commit f0a36c79 broke the handling of such configuration, resulting in a
function clause error in diameter_capx if the list was not of length 3,
and faulty extraction of application id's otherwise. Only record-valued
config was properly interpreted.
|
|
RFC 6733 recommends against the use of Inband-Security-Id, so only send
a value that differs from the default.
|
|
RFC 6733 has changed the arity of Vendor-Id in this Grouped AVP, from 1*
in RFC 3588 to 1 in RFC 6773. This impacts the generated dictionary
modules: Vendor-Id is expected to be list-valued in the 3588 dictionary,
integer-valued in the 6733 dictionary. This, in turn, breaks the
independence of capabilities configuration on a service or transport
from the dictionary that will be used to encode an outgoing CER or CEA.
This commit fixes this by massaging any Vendor-Specific-Application-Id
config as appropriate when constructing CER or CEA for a given
dictionary.
|
|
The generated '#get-'/1 has one clause for each exported record r, whose
definition is equivalent to the following.
'#get-'(#r{} = Rec) ->
[r | lists:zip(record_info(r, fields), tl(tuple_to_list(Rec)))];
The record name at the head of the list is the same format that diameter
accepts for outgoing message.
|
|
Instead, use whatever dictionary a transport has configured as
supporting application id 0. This is to support the updated RFC 6733
dictionaries (which bring with them updated records) and also to be able
to transparently support any changed semantics (eg. 5xxx in
answer-message).
|
|
|
|
{invalid, K, V} was never matched. Return full reason, not just an
atom.
|
|
Documentation (correctly) say {'Origin-State-Id', Unsigned32()},
code (incorrectly) expected {'Origin-State-Id', [Unsigned32()]}.
|
|
|
|
If a peer fsm process exits then the exit reason is received by
the service process in a 'DOWN' message. If the reason is the one
generated by diameter_peer_fsm:close/2, which is called to signal
a non-transport failure before the completion of capabilities exchange
(eg. receiving an unsuccessful CEA), then an event is sent to any
subscribers.
Also, tweak capabilities_cb return values for more informative
event data.
|
|
Value is a function that's applied to the transport reference
and capabilities record after capabilities exchange. If a callback
returns anything but 'ok' then the connection is closed. In the case
of an incoming CER, the callback can return a result code with which
to answer. Multiple callbacks can be specified and are applied until
either all return 'ok' or one doesn't.
Also, include Origin-State-Id in answers where it was previously
omitted.
|
|
Simpler, no duplication of similar makefiles and makes for
better dependencies. (Aka, recursive make considered harmful.)
|