As part of the NetSync Monitor protocol, it will be necessary to send and
receive PTP event messages and evaluate their time stamps.  This patch adds
command line flags for choosing the time stamping flavor.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 pmc.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/pmc.c b/pmc.c
index 5ebed46..a15e800 100644
--- a/pmc.c
+++ b/pmc.c
@@ -669,6 +669,10 @@ static void usage(char *progname)
                " -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"
+               "\n"
+               " Time Stamping (for NetSync Monitor commands)\n\n"
+               " -H        HARDWARE (default)\n"
+               " -S        SOFTWARE\n"
                "\n",
                progname);
 }
@@ -697,7 +701,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:s:t:vz"))) {
+       while (EOF != (c = getopt(argc, argv, "246HSu""b:d:hi:s:t:vz"))) {
                switch (c) {
                case '2':
                        transport_type = TRANS_IEEE_802_3;
@@ -708,6 +712,14 @@ int main(int argc, char *argv[])
                case '6':
                        transport_type = TRANS_UDP_IPV6;
                        break;
+               case 'H':
+                       if (config_set_int(cfg, "time_stamping", TS_HARDWARE))
+                               goto out;
+                       break;
+               case 'S':
+                       if (config_set_int(cfg, "time_stamping", TS_SOFTWARE))
+                               goto out;
+                       break;
                case 'u':
                        transport_type = TRANS_UDS;
                        break;
@@ -852,6 +864,7 @@ int main(int argc, char *argv[])
 
        pmc_destroy(pmc);
        msg_cleanup();
+out:
        config_destroy(cfg);
        return ret;
 }
-- 
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to