aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base
AgeCommit message (Collapse)Author
2013-03-04Add transport_opt() watchdog_configAnders Svensson
To make the number of watchdogs sent before the transitions REOPEN -> OKAY and OKAY -> SUSPECT configurable. Using anything other then the default config is non-standard and should only be used for test.
2013-02-18Update appup for diameter-1.4.1 in R16BAnders Svensson
Also add comments to identify the corresponding OTP releases. Purposely don't use regexp version numbers to be explicit about previously released versions. (Could use them in one direction but then app suite needs to be adapted.)
2013-02-17Answer 5xxx errors with application_opt() request_errors = answerAnders Svensson
RFC 3588 allowed only 3xxx result codes in an answer-message (that is, an answer that sets the E-bit) while RFC 6733 also allows 5xxx result codes. Setting request_errors = answer tells diameter to answer 5xxx errors itself. Returning {answer_message, integer()} from a handle_request callback allows both 3xxx and 5xxx result codes to be set. {protocol_error, integer()} is retained for 3xxx result codes.
2013-02-16Comments and minor Result-Code fixAnders Svensson
In particular, don't put an error tuple in the errors field of a #diameter_packet{} when Result-Code and the E-bit are in conflict, put {integer(), #diameter_avp{}}.
2013-02-16Be less brutal in setting Result-Code/Failed-AVPAnders Svensson
When receiving a request for which errors have been detected during decode, diameter previously used the errors list in the decoded diameter_packet record to unconditionally set Result-Code and Failed-AVP in the outgoing answer. It wasn't particularly delicate in doing so however and would happily set a 5xxx Result-Code even if a handle_request callback returned an answer-message, leading to an encode error. This behaviour became even less endearing as of commit ac452e28, which made it possible to handle_request to take place even for protocol errors. (ie. When a callback typically should return an answer-message.) This commit fixes the behaviour by only setting a value that's appropriate for the answer in question, either a 3xxx or a 5xxx, depending on if the answer's an answer-message or not. It also allows handle_request to prevent diameter from setting anything by setting errors = false in a returned diameter_packet. Ideally it should have been errors = [] but the empty list is the default value for the errors field and changing the default (ideally there shouldn't have been one) would require recompilation of all modules including diameter.hrl: choose the less attractive 'false' to avoid such backwards incompatibility. The request reception is also refactored somewhat to shorten some call chains.
2013-02-16Add application_opt() request_errorsAnders Svensson
Configuring the value 'callback' all errors detected in incoming requests to result in a handle_request callback. The default value 'answer_3xxx' is the previous behaviour in which diameter answers protocol errors without a callback.
2013-02-11Add transport_opt() length_errorsAnders Svensson
The value determines whether or not an unexpected message length in the header of an incoming messages causes the peer process to exit, the message to be discarded or handled as usual. The latter may only be appropriate for message-oriented transport (eg. SCTP) since stream-oriented transport (eg. TCP) may not be able to recover the message boundary once a length error has occurred.
2013-02-08Remove trailing whitespaceAnders Svensson
2013-02-08Tweak service interface towards diameter_peerAnders Svensson
2013-02-08Split message handling in diameter_service into diameter_trafficAnders Svensson
Traffic handling is connected to the service implementation through the pick_peer callback and failover but diameter_service was getting unwieldy as home to both the service process and traffic handling.
2013-02-08Simplify request recordAnders Svensson
In particular, remove fields containing values that are known (as of the preceding commit) to the request process.
2013-02-08Move failover out of service processAnders Svensson
In order to be able to remove fields from the request process that don't need to be there and do less in the service process. The pick_peer callback now takes place in the request process in the case of immutable state, just as in the case of the initial send.
2013-02-08Add exprecs '#get-'/1 for transforming records into listsAnders Svensson
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.
2013-02-08Don't hardcode common dictionaryAnders Svensson
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).
2013-02-08Fix faulty watchdog transition INITIAL -> DOWNAnders Svensson
There is no such transition in RFC 3539, the state remains in INITIAL.
2013-02-08Fix faulty watchdog transition DOWN -> INITIALAnders Svensson
This was the result of the watchdog process exiting as a consequence of peer death in some casesi, causing a restarted transport to enter INITIAL when it should enter REOPEN. The watchdog now remains alive as long as peer shutdown isn't requested and a 'close' message to the service process (instead of watchdog death) generates 'closed' events from the service.
2013-02-08Comment fixesAnders Svensson
2013-02-08Rename records peer/conn -> watchdog/peer in diameter_serviceAnders Svensson
That is, make the naming match that of the corresponding modules. This has long been fairly confusing.
2013-02-08Simplify watchdog transitions in service processAnders Svensson
In particular, use watchdog messages as input and do away with the older connection_up/down (and other) messages. Also, only maintain the watchdog state, not the older up/down op state.
2013-02-08Simplify transport shutdownAnders Svensson
Service process informs the watchdog process which informs the peer process. (Instead of going directly to the latter in one case.)
2013-02-08Remove upgrade code not needed after application restartAnders Svensson
Which will be the case with R16B in this case.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-23Update appupAnders Svensson
2013-01-23Remove upgrade code not needed at a major releaseAnders Svensson
2013-01-23Comment fixAnders Svensson
2013-01-22Add registered server names to app fileAnders Svensson
This was simply missed.
2013-01-18Ensure correct setting of 3xxx result codeAnders Svensson
A bad AVP Length (resulting in excess bytes from decode) but no other errors caused the request to fail when attempting to set Result-Code. A protocol error in combination with a 5xxx error caused the latter to be set in an answer-message.
2013-01-17Merge branch 'maint-r15'Anders Svensson
2013-01-17Merge branch 'anders/diameter/application_id/OTP-10655'Anders Svensson
* anders/diameter/application_id/OTP-10655: Check application id in answers in traffic suite Fix setting of Application-ID
2013-01-17Merge branch 'anders/diameter/timeout_event/OTP-10628'Anders Svensson
* anders/diameter/timeout_event/OTP-10628: Add event suite Send CER/CEA timeout events as documented
2013-01-17Merge branch 'anders/diameter/start_event/OTP-10618'Anders Svensson
* anders/diameter/start_event/OTP-10618: Fix timing of service start event
2013-01-17Merge branch 'anders/diameter/packet_return/OTP-10614'Anders Svensson
* anders/diameter/packet_return/OTP-10614: Add missing error handling clause for handle_request packet return
2013-01-17Merge branch 'anders/diameter/make_packet/OTP-10609'Anders Svensson
* anders/diameter/make_packet/OTP-10609: Fix diameter_service:make_prepare_header/2
2013-01-15Fix setting of Application-IDAnders Svensson
An answer message with the E flag erroneously set the value to 0.
2013-01-15Send CER/CEA timeout events as documentedAnders Svensson
2013-01-15Fix diameter_service:make_prepare_header/2Anders Svensson
Fault caused the header of a [#diameter_header{} | Avps] request to be ignored if both end_to_end_id and hop_by_hop_id were undefined. Broken in commit bc87eb33.
2013-01-15Update appupAnders Svensson
2013-01-14Reverse swapped argumentsAnders Svensson
The fault caused a handle_request callback to fail whenever an eval tuple was returned. Introduced in commit f24adb28.
2012-12-10Fix setting of T flag at failoverAnders Svensson
This seems to have been broken at some point before diameter was included in OTP, prior to R14B03.
2012-12-06Fix timing of service start eventAnders Svensson
Whether or not it came first was a matter of timing. Originally bungled in commit 476db530.
2012-12-04Add missing error handling clause for handle_request packet returnAnders Svensson
This should have been included in commit 91a223d3.
2012-11-23Update copyright yearsBjörn-Egil Dahlberg
2012-11-19Update appup for R15B03Anders Svensson
2012-11-19Dialyzer fixAnders Svensson
The removed clause was added in commit c14ef2db as part of an aborted implementation.
2012-11-19Update appup for OTP-10461/10550Anders Svensson
2012-11-18Merge branch 'anders/diameter/CEA_timeout/OTP-10554' into maintAnders Svensson
* anders/diameter/CEA_timeout/OTP-10554: Implement transport_opt() capx_timeout Document transport_opt() capx_timeout Minor doc fixes
2012-11-18Merge branch 'anders/diameter/identifier_checks/OTP-10565' into maintAnders Svensson
* anders/diameter/identifier_checks/OTP-10565: Add comment about lack of identifier checks on DWA Add check of End-to-End and Hop-by-Hop identfiers in received DPA Add check of End-to-End and Hop-by-Hop identfiers in received CEA
2012-11-18Merge branch 'anders/diameter/transport_data/OTP-10566' into maintAnders Svensson
* anders/diameter/transport_data/OTP-10566: Add a testcase Allow a handle_request callback to return a #diameter_packet{}
2012-11-18Merge branch 'anders/diameter/transport_shutdown/OTP-10493' into maintAnders Svensson
* anders/diameter/transport_shutdown/OTP-10493: Add simple DPR suite Correct diameter:remove_transport/2 doc Fix broken doc link Ensure watchdog dies with transport if DPR was sent Remove dead clause Implement transport_opt() disconnect_cb Document transport_opt() disconnect_cb
2012-11-16Add start/stop service_event()Anders Svensson