aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_peer.erl
AgeCommit message (Collapse)Author
2015-08-13Merge branch 'maint-17' into maintAnders Svensson
The diffs are all about adapting to the OTP 18 time interface. The code was previously backwards compatible, falling back on the erlang:now/0 if erlang:monotonic_time/0 is unavailable, but this was seen to be a bad thing in commit 9c0f2f2c. Use of erlang:now/0 is now removed.
2015-08-13Merge branch 'anders/diameter/17/time/OTP-12926' into maint-17Erlang/OTP
* anders/diameter/17/time/OTP-12926: Simplify time manipulation Remove use of monotonic time in pre-18 code Remove unnecessary redefinition of erlang:max/2
2015-08-13Merge branch 'anders/diameter/transport/OTP-12929' into maint-17Erlang/OTP
* anders/diameter/transport/OTP-12929: Fix start order of alternate transports Log discarded answers
2015-08-05Simplify time manipulationAnders Svensson
By doing away with more wrapping that the parent commit started to remove.
2015-08-05Fix start order of alternate transportsAnders Svensson
A transport configured with diameter:add_transport/2 can be passed multiple transport_module/transport_config tuples in order to specify alternate configuration, modules being attempted in order until one succeeds. This is primarily for the connecting case, to allow a transport to be configured to first attempt connection over SCTP, and then TCP in case SCTP fails, with configuration like that documented: {transport_module, diameter_sctp}, {transport_config, [...], 5000}, {transport_module, diameter_tcp}, {transport_config, [...]} If the options are the same in both cases, another possibility would be configuration like this, which attaches the same transport_config to both modules: {transport_module, diameter_sctp}, {transport_module, diameter_tcp}, {transport_config, [...], 5000}, However, in this case the start order was reversed relative to the documented order: first tcp, then sctp. This commit restores the intended order.
2015-08-04Match allowable peer addresses case insensitivelyAnders Svensson
Both diameter_tcp and diameter_sctp can be configured with one or more IP addresses from which connections should be accepted (an 'accept' tuple), specified either as a tuple-valued address or as a regular expression. In the latter case, peer addresses are mapped to string using inet:ntoa/1 and the result matched against the regexp. Since (ipv6) addresses are case insensitive, this should also be the case with the match, but was not.
2015-08-04Replace calls to module inet_parse to equivalents in inetAnders Svensson
Commits b563c796 (R16B) and 0fad6449 (R16B02) added parse_address/1 and ntoa/1 to module inet, providing documented alternatives to address/1 and ntoa/1 in the undocumented (save comments in inet(3)) inet_parse.
2015-06-22Merge branch 'bruce/change-license'Bruce Yinhe
OTP-12845 * bruce/change-license: fix errors caused by changed line numbers Change license text to APLv2
2015-06-21Fix start order of alternate transportsAnders Svensson
A transport configured with diameter:add_transport/2 can be passed multiple transport_module/transport_config tuples in order to specify alternate configuration, modules being attempted in order until one succeeds. This is primarily for the connecting case, to allow a transport to be configured to first attempt connection over SCTP, and then TCP in case SCTP fails, with configuration like that documented: {transport_module, diameter_sctp}, {transport_config, [...], 5000}, {transport_module, diameter_tcp}, {transport_config, [...]} If the options are the same in both cases, another possibility would be configuration like this, which attaches the same transport_config to both modules: {transport_module, diameter_sctp}, {transport_module, diameter_tcp}, {transport_config, [...], 5000}, However, in this case the start order was reversed relative to the documented order: first tcp, then sctp. This commit restores the intended order. OTP-12851
2015-06-18Change license text to APLv2Bruce Yinhe
2015-03-23Strip potentially large terms when sending outgoing Diameter messagesAnders Svensson
Both incoming and outgoing Diameter messages pass through two or three processes, depending on whether they're incoming or outgoing: the transport process and corresponding peer_fsm process and (for incoming) watchdog processes. Since terms other than binary are copied when passing process boundaries, large terms lead to copying that can be problematic, if frequent enough. Since only the bin and transport_data fields of a diameter_packet record are needed by the transport process, discard others when sending outgoing messages. Strictly speaking, the statement that only the aforementioned fields are needed by the transport process depends on the transport process. It's true of those implemented by diameter (in diameter_tcp and diameter_sctp), but an implementation that makes use of other fields is assuming more than the documentation in diameter_transport(3) promises.
2015-02-20Use new time api in implementationAnders Svensson
In particular, deal with the deprecation of erlang:now/0 in OTP 18. Be backwards compatible with older releases: the new api is only used when available. The test suites have not been modified.
2013-06-10Let diameter_{tcp,sctp} be configured with permissible remote addressesAnders Svensson
Option 'accept' allows remote addresses to be configured as tuples or regular expressions. The remote addresses for any incoming (aka accepted) connection/association are matched against the configured values, any non-matching address causing the connection/association to be aborted.
2013-04-11Add transport interface 'connected' message with local address listAnders Svensson
A transport module can return a local address list from its start/3 function in order to specify addresses to be used as Host-IP-Address during capabilities exchange. Now allow addresses to be communicated in a 'connected' message in the case of a connecting transport, so that diameter_tcp (in particular) can make local address configuration optional, communicating the gen_tcp default after connection establishment instead.
2013-03-17More flexible distribution configAnders Svensson
Allow both share_peers and use_shared_peers to be a list of nodes, or a function that returns a list of nodes.
2013-02-08Remove trailing whitespaceAnders Svensson
2013-02-08Tweak service interface towards diameter_peerAnders Svensson
2013-01-23Remove upgrade code not needed at a major releaseAnders Svensson
2012-11-05Implement sequence masksAnders Svensson
Code should be loaded in this order: diameter_session (sequence/1) diameter_peer_fsm (calls to sequence/1) diameter_service (sequence config, mask in receive_message/3) diameter_watchdog (mask in peer start and receive_message/3) diameter_config (accept sequence config) Order of diameter and diameter_peer doesn't matter.
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-29Dialyzer spec fixesAnders Svensson
2012-08-26Minor spec and backwards compatibility fixAnders Svensson
2012-08-23Allow multiple transport_module and transport_configAnders Svensson
Transports are started one after the other if a connection is not established with the timeout that can now be specified with transport_config. For example, try an SCTP connect first, a TCP connect if it doesn't succeed.
2011-10-17One makefile for src build instead of recursionAnders Svensson
Simpler, no duplication of similar makefiles and makes for better dependencies. (Aka, recursive make considered harmful.)