inets: httpd - Reject incorrect large request lines early
inets: httpc - update test suite framwork to adopt to change in httpd
inets: httpd - Behave well on not so long but wrong request lines
inets: Prepare for release

Do application restart as old soft upgrade was not correct
ssl: Move init
Replace traffic-related log reports with no-op function calls

The former were a little over-enthusiastic and could cause a node to be
logged to death if a peer Diameter node was sufficiently ill-willed.
The function calls are to diameter_lib:log/4, the arguments of which
identify the happening in question, and which does nothing but provide a
function to trace on. Many existing log calls have been shrunk.

The only remaining traffic-related report (hopefully) is that resulting
from {answer_errors, report} config, and this has been slimmed.
Don't count messages on arbitrary keys

That is, don't use a key constructed from an incoming Diameter header
unless the message is known to the dictionary in question.  Otherwise
there are 2^32 application ids, 2^24 command codes, and 2 R-bits for an
ill-willed peer to choose from, each resulting in new keys in the
counter table (diameter_stats).

The usual {ApplicationId, CommandCode, Rbit} in a key is replaced by the
atom 'unknown' if the message in question is unknown to the decoding
dictionary.

Counters for messages sent and received by a relay are (still) not
implemented.
Make example code quiet

The output could make it impossible to use the shell. Counters returned
diameter:service_info/2 can be used to check for expected happenings.
Make example server answer unsupported requests with 3001

As it should. The previous discard (surely) pre-dated being able to
return {answer_message, 3001} from a handle_request callback.
Simplify example server

In particular, remove the unnecessary list-or-record answer.
ssl: Add ssl options to listen options tracker
inets: Correct httpc_SUITE
ssh: Add max_session parameter to ssh:daemon
ssh: Use correct timeout value for the connection timeout
ssh: Prepare for release
Add testcases that send unknown AVPs with a bad AVP Length

In particular, a length that points past the end of the message. This
goes undetected there is some other problem with the AVP (eg. M-bit),
which is a problem we're about to fix.
Fix handling of AVP length errors (5014) in unknown AVPs

Commit 4ce2d3a6 added the insertion of a single bit into binary AVP data
to induce an encode error in the case of a header length that pointed
past the available bytes: a 5014 = DIAMETER_INVALID_AVP_LENGTH error.
Commit 838856b fixed this for stringish Diameter types, but both commits
neglected the case in which the offending AVP isn't known to the
dictionary in question. Unless the AVP was regarded as erroneous for
other reasons (eg. an M-bit resulting in 5001) it would be happily be
packed into an 'AVP' field. If it was regarded as an error, the record
could be passed back to diameter_codec:pack_avp/1, and if the record
contained header data then there was no clause to deal with the
unpleasantry.

Deal with it by having the dictionary module strip the extra bit and
flag the AVP as 5014, and by having diameter_codec handle any extra bit
coming from an dictionary compiled against an old diameter_gen. An old
dictionary won't detect 5014 however, so dictionaries should be
recompiled.

Change most of the guards in diameter_codec from is_bitstring/1 to
is_binary/1. What's being passed to the decode functions are binaries
received other the network. The only case in which a non-binary
bitstring is when we've placed an extra bit there ourselves. (Modulo
someone doing something they shouldn't.)
Add a testcase that expects a decoded value in Failed-AVP

This isn't currently the case, but soon will be.
Do best-effort decode of Failed-AVP

Commit 4ce2d3a6 (diameter-1.4.2, OTP-11007) disabled the decode of
values in Failed-AVP components since any error caused the decode of
Failed-AVP itself to fail. This is less than useful since (1) we should
be able to decode it given that we've sent it (modulo mangling on the
way to the peer and back), and (2) it's not unheard of to examine
Failed-AVP to see what the peer objected to.

This commits adds a best-effort decode: decode if possible, otherwise
not, using the same abuse of the process dictionary as commit bbdb027c.
Merge branch 'anders/diameter/hardening/OTP-11721' into maint

* anders/diameter/hardening/OTP-11721:
  Simplify example server
  Make example server answer unsupported requests with 3001
  Make example code quiet
  Don't count messages on arbitrary keys
  Replace traffic-related log reports with no-op function calls