Compiler suite fix

An error when expecting success wasn't regarded as failure when
compiling dictionaries.
Don't format diameter_make:codec/2 errors

Instead, add diameter_make:format_error/1 to allow the caller to format
if desired, which is what applications like compiler and yecc do. Use
this to check that the expected error is the one actually generated in
the compiler suite.
Ensure that Grouped AVP's are fully defined in dictionaries

The case in which an AVP was defined as having type Grouped in
@avp_types without a corresponding specification in @grouped was
missing.
Change interface for communicating outbound stream id to diameter_sctp

The module uses the transport_data field of record diameter_packet to
communicate the stream on which the an incoming message is received and
on which an outgoing message should be sent, the previous interface
being that both are communicated as a tuple of the form {stream, Id}.
However, since diameter retains the value of an incoming request's
transport_data unless the corresponding answer message specifies
otherwise, the behaviour in this case is to send an answer on the
outbound stream with the same identifier as the that of the inbound
stream on which the request was received. If the inbound stream id is
greater than or equal to the number of outbound streams then this is
guaranteed to fail, causing the transport process in question to
terminate. There is no relationship between inbound and outbound stream
identifiers so diameter_sctp's imposition of one is simply wrong.

Outbound stream ids are now communicated with a different tuple:
{outstream, Id}, interpreted modulo the number of outbound streams.
Thus, retention of an inbound request's transport_data has no effect on
the selection of an outbound stream.

The change in interface is not strictly backwards compatible because of
the new atom for the outbound stream. However, as there is currently no
documented way of obtaining the available number of outbound streams for
a peer connection, there is no way for a client to have known the range
of ids from which it could reliably have chosen with the previous
interface, so any setting of the outbound stream has probably been
unintentional. Not explicitly specifying an outbound stream now results
in a round-robin selection.
Merge branch 'anders/diameter/undefined_group/OTP-11561'

* anders/diameter/undefined_group/OTP-11561:
  Ensure that Grouped AVP's are fully defined in dictionaries
  Don't format diameter_make:codec/2 errors
  Compiler suite fix
Merge branch 'anders/diameter/sctp_streams/OTP-11593'

* anders/diameter/sctp_streams/OTP-11593:
  Change interface for communicating outbound stream id to diameter_sctp
Avoid type gen_sctp:open_option() until it actually exists

The type's existence is the subject of OTP-11139, which has been
gathering dust since R16B.

http://erlang.org/pipermail/erlang-bugs/2013-September/003765.html
Update appup for 17.0

Plan to make use of the emulator restart implied by a major release to
clean out some upgrade-related code.
Remove upgrade-related code

No longer needed to update code in runtime since the emulator is
restarted at a major release.
vsn -> 1.6
Merge branch 'anders/diameter/17.0_release/OTP-11605'

* anders/diameter/17.0_release/OTP-11605:
  vsn -> 1.6
  Remove upgrade-related code
  Update appup for 17.0
  Avoid type gen_sctp:open_option() until it actually exists
Correct doc on the setting of Origin-State-Id

It was incorrectly stated that the AVP would be set in an outgoing
DPR/DPA.
Merge branch 'anders/diameter/doc/OTP-11583'

* anders/diameter/doc/OTP-11583:
  Correct doc on the setting of Origin-State-Id
Use inet:{peer,sock}names/1 in diameter_sctp

OTP-10229 (commit c4592b69) added these function to give access to all
addresses on a multihomed endpoint, their singular siblings not
returning anything useful in this case.

This fixes {accept, Match} config, which matches peer addresses against
configured addresses or regexps to decide whether or not a newly
established association should be retained. The functionality was added
in OTP-10893 (commit 9bbf27eb) but predated OTP-10229 by a few months.

It also fixes the addresses shown for SCTP associations in
diameter:service_info/2 output.
Be lenient with the M-bit in Grouped AVPs

RFC 6733 says this, in 4.4:

  Receivers of a Grouped AVP that does not have the 'M' (mandatory) bit
  set and one or more of the encapsulated AVPs within the group has the
  'M' (mandatory) bit set MAY simply be ignored if the Grouped AVP itself
  is unrecognized. The rule applies even if the encapsulated AVP with its
  'M' (mandatory) bit set is further encapsulated within other sub-groups,
  i.e., other Grouped AVPs embedded within the Grouped AVP.

The first sentence is mangled but take it to mean this:

  An unrecognized AVP of type Grouped that does not set the 'M' bit MAY
  be ignored even if one of its encapsulated AVPs sets the 'M' bit.

This is a bit of a non-statement since if the AVP is unrecognized then
its type is unknown. We therefore don't know that its data bytes contain
encapsulated AVPs, so can't but ignore any of those that set the M-bit.
Doing anything else when the type *is* known would be inconsistent.

OTP-11087 (commit 066544fa) caused the M-bit on any unrecognized AVP to
be regarded as an error, unrecognized being taken to mean "not
explicitly defined as a member of its container". (That is, an AVP that
can't be packed into a dedicated record field, which is slightly
stronger than "not defined".) This fixed the original intention for
top-level AVPs but broke the required leniency for Grouped AVPs whose
type is known. This commit restores the leniency.

Note that dictionary files need to be recompiled for the commit to have
effect.

Thanks to Rory McKeown for reporting the problem.
Merge branch 'anders/diameter/grouped_decode/OTP-11675'

* anders/diameter/grouped_decode/OTP-11675:
  Be lenient with the M-bit in Grouped AVPs
Remove "coding: utf-8" from test files

UTF-8 is now the default encoding and should no longer be
specified. These have probably been merged from maint earlier and the
coding statement was missed.

   lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl
   lib/diameter/test/diameter_codec_test.erl
   lib/ssh/test/ssh_unicode_SUITE.erl
Introduce runtime_dependencies in .app files

Most dependencies introduced are exactly the dependencies to other
applications found by xref. That is, there might be real dependencies
missing. There might also be pure debug dependencies listed that
probably should be removed. Each application has to be manually
inspected in order to ensure that all real dependencies are listed.

All dependencies introduced are to application versions used in
OTP 17.0. This since the previously used version scheme wasn't
designed for this, and in order to minimize the work of introducing
the dependencies.
Fix pick_peer case clause failure

In the case of {call_mutates_state, true} configuration on the service
in question, any peer selection that failed to select a peer resulted in
a case clause failure in diameter_service:pick_peer/5, when the call to
the service process returned false. This was noticed in the case of a
peer failover in which an alternate peer wasn't available.

The explicit matching is intentional, to match exactly what's expected.
Fix unicode path failure in diameter_make:codec/2

A dictionary path containing a unicode codepoint > 255 caused the
function to fail when iolist_to_binary/1 was applied to the path.