Skip to content

Commit

Permalink
pmc: add a command line option to select the server's UDS address.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Oct 8, 2013
1 parent 9fe2ffd commit 4f6f1e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pmc.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH PMC 8 "July 2013" "linuxptp"
.TH PMC 8 "October 2013" "linuxptp"
.SH NAME
pmc \- PTP management client

Expand All @@ -19,6 +19,8 @@ pmc \- PTP management client
] [
.BI \-i " interface"
] [
.BI \-s " uds-address"
] [
.BI \-t " transport-specific-field"
] [
.B \-v
Expand Down Expand Up @@ -69,6 +71,10 @@ Specify the domain number in sent messages. The default is 0.
Specify the network interface. The default is /var/run/pmc for the Unix Domain
Socket transport and eth0 for the other transports.
.TP
.BI \-s " uds-address"
Specifies the address of the server's UNIX domain socket.
The default is /var/run/ptp4l.
.TP
.BI \-t " transport-specific-field"
Specify the transport specific field in sent messages as a hexadecimal number.
The default is 0x0.
Expand Down
12 changes: 11 additions & 1 deletion pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "pmc_common.h"
#include "print.h"
#include "tlv.h"
#include "uds.h"
#include "util.h"
#include "version.h"

Expand Down Expand Up @@ -676,6 +677,7 @@ static void usage(char *progname)
" -h prints this message and exits\n"
" -i [dev] interface device to use, default 'eth0'\n"
" for network and '/var/run/pmc' for UDS.\n"
" -s [path] server address for UDS, default '/var/run/ptp4l'.\n"
" -t [hex] transport specific field, default 0x0\n"
" -v prints the software version and exits\n"
" -z send zero length TLV values with the GET actions\n"
Expand All @@ -697,7 +699,7 @@ int main(int argc, char *argv[])
/* Process the command line arguments. */
progname = strrchr(argv[0], '/');
progname = progname ? 1+progname : argv[0];
while (EOF != (c = getopt(argc, argv, "246u""b:d:hi:t:vz"))) {
while (EOF != (c = getopt(argc, argv, "246u""b:d:hi:s:t:vz"))) {
switch (c) {
case '2':
transport_type = TRANS_IEEE_802_3;
Expand All @@ -720,6 +722,14 @@ int main(int argc, char *argv[])
case 'i':
iface_name = optarg;
break;
case 's':
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 't':
if (1 == sscanf(optarg, "%x", &c))
transport_specific = c << 4;
Expand Down

0 comments on commit 4f6f1e1

Please sign in to comment.