phc2sys: Add option to set path to ptp4l UDS.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2014-07-08 16:14:18 +02:00 committed by Richard Cochran
parent bdb6a35883
commit 28865f91df
2 changed files with 15 additions and 1 deletions

View File

@ -194,6 +194,10 @@ clock frequency (unless the
.B \-S
option is used).
.TP
.BI \-z " uds-address"
Specifies the address of the server's UNIX domain socket.
The default is /var/run/ptp4l.
.TP
.BI \-l " print-level"
Set the maximum syslog level of messages which should be printed or sent to
the system logger. The default is 6 (LOG_INFO).

View File

@ -53,6 +53,7 @@
#include "stats.h"
#include "sysoff.h"
#include "tlv.h"
#include "uds.h"
#include "util.h"
#include "version.h"
@ -1158,6 +1159,7 @@ static void usage(char *progname)
" -u [num] number of clock updates in summary stats (0)\n"
" -n [num] domain number (0)\n"
" -x apply leap seconds by servo instead of kernel\n"
" -z [path] server address for UDS (/var/run/ptp4l)\n"
" -l [num] set the logging level to 'num' (6)\n"
" -m print messages to stdout\n"
" -q do not print messages to the syslog\n"
@ -1192,7 +1194,7 @@ int main(int argc, char *argv[])
progname = strrchr(argv[0], '/');
progname = progname ? 1+progname : argv[0];
while (EOF != (c = getopt(argc, argv,
"arc:d:s:E:P:I:S:F:R:N:O:L:i:u:wn:xl:mqvh"))) {
"arc:d:s:E:P:I:S:F:R:N:O:L:i:u:wn:xz:l:mqvh"))) {
switch (c) {
case 'a':
autocfg = 1;
@ -1285,6 +1287,14 @@ int main(int argc, char *argv[])
case 'x':
node.kernel_leap = 0;
break;
case 'z':
if (strlen(optarg) > MAX_IFNAME_SIZE) {
fprintf(stderr, "path %s too long, max is %d\n",
optarg, MAX_IFNAME_SIZE);
return -1;
}
strncpy(uds_path, optarg, MAX_IFNAME_SIZE);
break;
case 'l':
if (get_arg_val_i(c, optarg, &print_level,
PRINT_LEVEL_MIN, PRINT_LEVEL_MAX))