this patch updates the global set functions to allow the user to set the
proper value instead of only being allowed to enable (or disable) a particular
feature. The new patch allows the function to specify exactly what they want
the value to be.
This patch also clarifies what -q and -v do by removing mention of quiet mode
and verbose mode. It is easy for a user to confuse and assume that -q disables
-v when this is not true.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
modify the command line options to make better sense of what each one does.
Ignore previous restriction on disallowing different options on the same
letter with different case.
the purpose of this patch is to simplify the meaning of some very confusing
options (-z for legacy, -r for hardware timestamps, -m for slave)
While there are legacy issues involved with changing options around, it is
important for the user to be able to quickly understand and make fewer
mistakes regarding the various command line options
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
The upper layer code will be confused by the extra fourteen byte length
of the Ethernet header.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This commit only adds support for forwarding the management messages.
The actual local effects of the management commands still need to be
implemented.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Some commercial 802.1AS switches do not feel obliged to set the two step
flag. When we try to synchronize to their apparent one step sync messages,
nothing good happens. This commit adds a global option to work around the
issue.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Some of the time stamping hardware out there only recognizes layer 2
packets, and these do not work without changing the receive filter in
the SIOCSHWTSTAMP request.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add transportSpecific parameter to config file parser
Set transportSpecific field in message headers as using the configuration (default to 0)
[ RC - reduced this patch to just the addition of the field ]
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
An oversize incoming packet might overwrite the reference counter in a
message. Prevent this by providing a buffer large enough for the largest
possible packet.
This will also be needed to support TLV suffixes.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
If an announce timeout occurs on a port, and no other port is slaved, then
the clock must become a grand master by default.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
When computing a port's best foreign master, we make use of a message
reference that possibly might have been dropped by calling msg_put in
the fc_prune subroutine. This commit fixes the issue by copying the
needed data from the message before pruning.
[ Actually, since msg_put only places the message into a list without
altering its contents, there was no ill effect. But using a message
after having released it is just plain wrong. ]
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Under Linux, when the link goes down our multicast socket becomes stale.
We always poll(2) for events, but the link down does not trigger any event
to let us know that something is wrong. Once the port enters master mode
and starts announcing itself, the socket throws an error. This in turn
causes a fault, and we reopen the socket when clearing the fault.
However, in the case of slave only mode, if the port is listening then
it will never send, discover the link error, or repair the socket. This
patch fixes the issue by simply reopening the socket after an announce
timeout.
[ Another way would be to use a netlink socket, but that would add too
much complexity as it poorly matches our port/interface model. ]
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
The message code is horribly broken in three ways.
1. Clearing the message also sets the reference count to zero.
2. The recycling code in msg_put does not test the reference count.
3. The allocation code does not remove the message from the pool,
although this code was never reached because of point 2.
This patch fixes the issues and also adds some debugging code to trace
the message pool statistics.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
When diagnosing a log file, it can be useful to know the relative time
between the log entries. In contrast, the PID is mostly useless, since
the program does not ever fork.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>