Re: [Linuxptp-devel] [PATCH v3 4/6] Add a push notification for the CMLDS TLV.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Erez <ere...@gm...> - 2023-12-06 14:43:11
|
On Tue, 5 Dec 2023 at 08:59, Miroslav Lichvar <mli...@re...> wrote: > On Mon, Dec 04, 2023 at 11:25:00PM +0100, Andrew Zaborowski wrote: > > On Sun, 3 Dec 2023 at 00:39, Richard Cochran <ric...@gm...> > wrote: > > > @@ -306,13 +307,15 @@ static void do_set_action(struct pmc *pmc, int > action, int index, char *str) > > > "duration %hu " > > > "NOTIFY_PORT_STATE %3s " > > > "NOTIFY_TIME_SYNC %3s " > > > - "NOTIFY_PARENT_DATA_SET %3s ", > > > + "NOTIFY_PARENT_DATA_SET %3s " > > > + "NOTIFY_CMLDS %3s ", > > > &sen.duration, > > > onoff_port_state, > > > onoff_time_status, > > > - onoff_parent_data_set); > > > - if (cnt != 4) { > > > - fprintf(stderr, "%s SET needs 4 values\n", > > > + onoff_parent_data_set, > > > + onoff_cmlds); > > > + if (cnt != 5) { > > > + fprintf(stderr, "%s SET needs 5 values\n", > > > > Doing cnt != 4 && cnt != 5 should just work as sscanf() should stop > > parsing when it doesn't find NOTIFY_CMLDS and leave onoff_cmlds as > > "off". Obviously this won't scale as more events are added but it'd > > keep syntax backwards-compatible for scripts. > > Good idea. The PARENT_DATA_SET notification is new too (added after > 4.1) and I guess there is no reason to require even the original two > notifications, so change that to "cnt < 1" with "%s SET needs at least > 1 value", requiring only the duration, which would effectively reset > all existing notifications? > + > > -- > Miroslav Lichvar > > > > _______________________________________________ > Linuxptp-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxptp-devel > |