From 9d48046e95231abe65362de10d014543d4bbcb71 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 25 Nov 2017 11:03:07 -0800 Subject: [PATCH] msg: Allow tacking a TLV onto a delay request message. This will be needed in order to support the NetSync Monitor protocol. Signed-off-by: Richard Cochran --- msg.c | 3 ++- msg.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/msg.c b/msg.c index 9038616..a36d4d0 100644 --- a/msg.c +++ b/msg.c @@ -116,7 +116,7 @@ static uint8_t *msg_suffix(struct ptp_message *m) case SYNC: return NULL; case DELAY_REQ: - return NULL; + return m->delay_req.suffix; case PDELAY_REQ: return NULL; case PDELAY_RESP: @@ -354,6 +354,7 @@ int msg_post_recv(struct ptp_message *m, int cnt) timestamp_post_recv(m, &m->sync.originTimestamp); break; case DELAY_REQ: + suffix = m->delay_req.suffix; break; case PDELAY_REQ: break; diff --git a/msg.h b/msg.h index dd8c069..985b78f 100644 --- a/msg.h +++ b/msg.h @@ -114,6 +114,7 @@ struct sync_msg { struct delay_req_msg { struct ptp_header hdr; struct Timestamp originTimestamp; + uint8_t suffix[0]; } PACKED; struct follow_up_msg {