This patch adds two new EMM counters in the regular stats messages.
Now the counters are:
Received - How much EMMs were received from the input.
Skipped - How much EMMs were skipped because of filtering.
Sent - How much EMMs were added to the sending queue.
Processed - How much EMMs were sent to the CAMD server for processing.
Add support for IPv6 and for multiple CAMD addresses.
This patch adds support for connecting to CAMD over IPv6. Nice addition
is that now tsdecrypt tries each of the addresses returned when CAMD
hostname is resolved and connects to the one that works. Resolving
of the server address is done before each connect, which allows for
uninterupted migration of CAMD servers by just changing their DNS
record.
IPv6 functionality can be disabled by using -4/--ipv4 options or
if you fancy only IPv6 servers -6/--ipv6 can be used.
Allow camd server address to be resolved, not only set by IP address.
The limitation is that resolving the hostname is performed only
once at tsdecrypt startup. If DNS changes while tsdecrypt is running,
tsdecrypt won't notice that.
Flush request queue to prevent collecting too much data.
Since it is possible for EMMs and ECMs to be removed from
the queues when hard limits are reached, it is a good idea
to clear the request queue too. Without this when queues
reach their hard limits, request queue will grow slowly eating
a bit of memory. It is not much but it is wasted memory.
Do not output anything when there is no valid decryption key.
When the decryption fails due to missing decryption key it is better
to not output anything. Before this patch in case of missing decryption
key the PSI tables were still being written to the output and this
could confuse some monitoring systems to think that the stream is
working.