Add support for more strict config value validation

This patch adds functions to get int, uint, double value from string
with error checking and range specification.
These functions don't allow overflow and outside of the range values.

In addition, it adds parser_result cases "MALFORMED" and "OUT_OF_RANGE" to make
reason of parse error more clear.

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
config: Apply config value validation to logging_level option

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
util: Add common procedures to get argument values for ptp4l and phc2sys

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
ptp4l and phc2sys: Get argument values with strict error checking

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Don't return bogus clock id

phc_open() can open any device and return clkid even if the device is not phc
for example /dev/kvm and so on.
As a result, phc2sys keeps running with reading bogus clock as below:
 # phc2sys -s /dev/kvm -O 0 -q -m
 phc2sys[687019.699]: failed to read clock: Invalid argument
 phc2sys[687020.699]: failed to read clock: Invalid argument
 phc2sys[687021.699]: failed to read clock: Invalid argument
 phc2sys[687022.699]: failed to read clock: Invalid argument
 ...

This patch fixes that problem.

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>