Commit da167ed5 authored by Alessandro Rubini's avatar Alessandro Rubini

announce data structure: rename wrFlags to ext_specific

Since WR only needs one byte of information in the announce structure,
we can make is generic by calling it differently.

This changes only the name (and the size: it is now unsigned long),
but has no effect on the marshalling/unmarshalling of such data.

I'm touching this because I'm working on announce messages (as related
to foreign masters).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 5e11be67
......@@ -150,10 +150,7 @@ typedef struct MsgAnnounce {
ClockIdentity grandmasterIdentity;
UInteger16 stepsRemoved;
Enumeration8 timeSource;
/* White Rabbit extension begin */
UInteger8 wrFlags;
/* White Rabbit extension end */
unsigned long ext_specific; /* used by extension */
} MsgAnnounce;
/* Sync Message (table 26, page 129) */
......
......@@ -95,12 +95,12 @@ static int wr_update_delay(struct pp_instance *ppi)
static void wr_s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
{
WR_DSPOR(ppi)->parentIsWRnode =
((ann->wrFlags & WR_NODE_MODE) != NON_WR);
((ann->ext_specific & WR_NODE_MODE) != NON_WR);
WR_DSPOR(ppi)->parentWrModeOn =
(ann->wrFlags & WR_IS_WR_MODE) ? TRUE : FALSE;
(ann->ext_specific & WR_IS_WR_MODE) ? TRUE : FALSE;
WR_DSPOR(ppi)->parentCalibrated =
((ann->wrFlags & WR_IS_CALIBRATED) ? 1 : 0);
WR_DSPOR(ppi)->parentWrConfig = ann->wrFlags & WR_NODE_MODE;
((ann->ext_specific & WR_IS_CALIBRATED) ? 1 : 0);
WR_DSPOR(ppi)->parentWrConfig = ann->ext_specific & WR_NODE_MODE;
DSCUR(ppi)->primarySlavePortNumber =
DSPOR(ppi)->portIdentity.portNumber;
}
......
......@@ -101,7 +101,7 @@ void msg_unpack_announce_wr_tlv(void *buf, MsgAnnounce *ann)
tlv_magicNumber == WR_TLV_MAGIC_NUMBER &&
tlv_versionNumber == WR_TLV_WR_VERSION_NUMBER &&
tlv_wrMessageID == ANN_SUFIX) {
ann->wrFlags = (UInteger16)get_be16(buf+76);
ann->ext_specific = (UInteger16)get_be16(buf+76);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment