gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
avbts_message.hpp
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Copyright (c) 2009-2012, Intel Corporation
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are met:
8 
9  1. Redistributions of source code must retain the above copyright notice,
10  this list of conditions and the following disclaimer.
11 
12  2. Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  3. Neither the name of the Intel Corporation nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  POSSIBILITY OF SUCH DAMAGE.
31 
32 ******************************************************************************/
33 
34 #ifndef AVBTS_MESSAGE_HPP
35 #define AVBTS_MESSAGE_HPP
36 
37 #include <stdint.h>
38 #include <avbts_osnet.hpp>
39 #include <ieee1588.hpp>
40 
41 #include <list>
42 #include <algorithm>
43 
46 #define PTP_CODE_STRING_LENGTH 4
47 #define PTP_SUBDOMAIN_NAME_LENGTH 16
48 #define PTP_FLAGS_LENGTH 2
50 #define GPTP_VERSION 2
51 #define PTP_NETWORK_VERSION 1
53 #define PTP_ETHER 1
54 #define PTP_DEFAULT 255
56 #define PTP_COMMON_HDR_OFFSET 0
57 #define PTP_COMMON_HDR_LENGTH 34
58 #define PTP_COMMON_HDR_TRANSSPEC_MSGTYPE(x) x
59 #define PTP_COMMON_HDR_PTP_VERSION(x) x+1
60 #define PTP_COMMON_HDR_MSG_LENGTH(x) x+2
61 #define PTP_COMMON_HDR_DOMAIN_NUMBER(x) x+4
62 #define PTP_COMMON_HDR_FLAGS(x) x+6
63 #define PTP_COMMON_HDR_CORRECTION(x) x+8
64 #define PTP_COMMON_HDR_SOURCE_CLOCK_ID(x) x+20
65 #define PTP_COMMON_HDR_SOURCE_PORT_ID(x) x+28
66 #define PTP_COMMON_HDR_SEQUENCE_ID(x) x+30
67 #define PTP_COMMON_HDR_CONTROL(x) x+32
68 #define PTP_COMMON_HDR_LOG_MSG_INTRVL(x) x+33
70 #define PTP_ANNOUNCE_OFFSET 34
71 #define PTP_ANNOUNCE_LENGTH 30
72 #define PTP_ANNOUNCE_CURRENT_UTC_OFFSET(x) x+10
73 #define PTP_ANNOUNCE_GRANDMASTER_PRIORITY1(x) x+13
74 #define PTP_ANNOUNCE_GRANDMASTER_CLOCK_QUALITY(x) x+14
75 #define PTP_ANNOUNCE_GRANDMASTER_PRIORITY2(x) x+18
76 #define PTP_ANNOUNCE_GRANDMASTER_IDENTITY(x) x+19
77 #define PTP_ANNOUNCE_STEPS_REMOVED(x) x+27
78 #define PTP_ANNOUNCE_TIME_SOURCE(x) x+29
80 #define PTP_SYNC_OFFSET 34
81 #define PTP_SYNC_LENGTH 10
82 #define PTP_SYNC_SEC_MS(x) x
83 #define PTP_SYNC_SEC_LS(x) x+2
84 #define PTP_SYNC_NSEC(x) x+6
86 #define PTP_FOLLOWUP_OFFSET 34
87 #define PTP_FOLLOWUP_LENGTH 10
88 #define PTP_FOLLOWUP_SEC_MS(x) x
89 #define PTP_FOLLOWUP_SEC_LS(x) x+2
90 #define PTP_FOLLOWUP_NSEC(x) x+6
92 #define PTP_PDELAY_REQ_OFFSET 34
93 #define PTP_PDELAY_REQ_LENGTH 20
94 #define PTP_PDELAY_REQ_SEC_MS(x) x
95 #define PTP_PDELAY_REQ_SEC_LS(x) x+2
96 #define PTP_PDELAY_REQ_NSEC(x) x+6
98 #define PTP_PDELAY_RESP_OFFSET 34
99 #define PTP_PDELAY_RESP_LENGTH 20
100 #define PTP_PDELAY_RESP_SEC_MS(x) x
101 #define PTP_PDELAY_RESP_SEC_LS(x) x+2
102 #define PTP_PDELAY_RESP_NSEC(x) x+6
103 #define PTP_PDELAY_RESP_REQ_CLOCK_ID(x) x+10
104 #define PTP_PDELAY_RESP_REQ_PORT_ID(x) x+18
106 #define PTP_PDELAY_FOLLOWUP_OFFSET 34
107 #define PTP_PDELAY_FOLLOWUP_LENGTH 20
108 #define PTP_PDELAY_FOLLOWUP_SEC_MS(x) x
109 #define PTP_PDELAY_FOLLOWUP_SEC_LS(x) x+2
110 #define PTP_PDELAY_FOLLOWUP_NSEC(x) x+6
111 #define PTP_PDELAY_FOLLOWUP_REQ_CLOCK_ID(x) x+10
112 #define PTP_PDELAY_FOLLOWUP_REQ_PORT_ID(x) x+18
114 #define PTP_LI_61_BYTE 1
115 #define PTP_LI_61_BIT 0
116 #define PTP_LI_59_BYTE 1
117 #define PTP_LI_59_BIT 1
118 #define PTP_ASSIST_BYTE 0
119 #define PTP_ASSIST_BIT 1
120 #define PTP_PTPTIMESCALE_BYTE 1
121 #define PTP_PTPTIMESCALE_BIT 3
123 #define TX_TIMEOUT_BASE 1000
124 #define TX_TIMEOUT_ITER 6
129 enum MessageType {
130  SYNC_MESSAGE = 0,
131  DELAY_REQ_MESSAGE = 1,
132  PATH_DELAY_REQ_MESSAGE = 2,
133  PATH_DELAY_RESP_MESSAGE = 3,
134  FOLLOWUP_MESSAGE = 8,
135  DELAY_RESP_MESSAGE = 9,
136  PATH_DELAY_FOLLOWUP_MESSAGE = 0xA,
137  ANNOUNCE_MESSAGE = 0xB,
138  SIGNALLING_MESSAGE = 0xC,
139  MANAGEMENT_MESSAGE = 0xD,
140 };
141 
146  SYNC,
147  DELAY_REQ,
148  FOLLOWUP,
149  DELAY_RESP,
150  MANAGEMENT,
151  MESSAGE_OTHER
152 };
153 
158  MCAST_NONE,
159  MCAST_PDELAY,
160  MCAST_OTHER
161 };
162 
168 protected:
169  unsigned char versionPTP;
170  uint16_t versionNetwork;
175  uint16_t sequenceId;
177  unsigned char flags[2];
179  uint16_t messageLength;
181  long long correctionField;
182  unsigned char domainNumber;
186  bool _gc;
191  PTPMessageCommon(void) { };
192  public:
201  virtual ~PTPMessageCommon(void);
202 
207  unsigned char *getFlags(void) {
208  return flags;
209  }
210 
215  uint16_t getSequenceId(void) {
216  return sequenceId;
217  }
223  void setSequenceId(uint16_t seq) {
224  sequenceId = seq;
225  }
226 
232  return messageType;
233  }
234 
241  long long getCorrectionField(void) {
242  return correctionField;
243  }
251  void setCorrectionField(long long correctionAmount) {
252  correctionField = correctionAmount;
253  }
254 
260  void getPortIdentity(PortIdentity * identity);
266  void setPortIdentity(PortIdentity * identity);
267 
273  return _timestamp;
274  }
279  uint32_t getTimestampCounterValue(void) {
280  return _timestamp_counter_value;;
281  }
287  void setTimestamp(Timestamp & timestamp) {
288  _timestamp = timestamp;
289  }
290 
295  bool garbage() {
296  return _gc;
297  }
298 
305  bool isSenderEqual(PortIdentity portIdentity);
306 
312  virtual void processMessage(IEEE1588Port * port);
313 
319  void buildCommonHeader(uint8_t * buf);
320 
322  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
323 };
324 
325 /*Exact fit. No padding*/
326 #pragma pack(push,1)
327 
328 #define PATH_TRACE_TLV_TYPE 0x8
340 class PathTraceTLV {
341  private:
342  uint16_t tlvType;
343  typedef std::list<ClockIdentity> IdentityList;
344  IdentityList identityList;
345  public:
350  PathTraceTLV() {
351  tlvType = PLAT_htons(PATH_TRACE_TLV_TYPE);
352  }
358  void parseClockIdentity(uint8_t *buffer) {
359  int length = PLAT_ntohs(*((uint16_t *)buffer))/PTP_CLOCK_IDENTITY_LENGTH;
360  buffer += sizeof(uint16_t);
361  for(; length > 0; --length) {
363  add.set(buffer);
364  identityList.push_back(add);
365  buffer += PTP_CLOCK_IDENTITY_LENGTH;
366  }
367  }
368 
374  void appendClockIdentity(ClockIdentity * id) {
375  identityList.push_back(*id);
376  }
377 
383  void toByteString(uint8_t * byte_str) {
384  IdentityList::iterator iter;
385  *((uint16_t *)byte_str) = tlvType; // tlvType already in network byte order
386  byte_str += sizeof(tlvType);
387  *((uint16_t *)byte_str) =
388  PLAT_htons(identityList.size()*PTP_CLOCK_IDENTITY_LENGTH);
389  byte_str += sizeof(uint16_t);
390  for
391  (iter = identityList.begin();
392  iter != identityList.end(); ++iter) {
393  iter->getIdentityString(byte_str);
394  byte_str += PTP_CLOCK_IDENTITY_LENGTH;
395  }
396  }
397 
403  bool has(ClockIdentity *id) {
404  return std::find
405  (identityList.begin(), identityList.end(), *id) !=
406  identityList.end();
407  }
408 
416  int length() {
417  return 2*sizeof(uint16_t) + PTP_CLOCK_IDENTITY_LENGTH*identityList.size();
418  }
419 };
421 /* back to whatever the previous packing mode was */
422 #pragma pack(pop)
423 
431  private:
432  uint8_t grandmasterIdentity[PTP_CLOCK_IDENTITY_LENGTH];
433  ClockQuality *grandmasterClockQuality;
435  PathTraceTLV tlv;
436 
437  uint16_t currentUtcOffset;
438  unsigned char grandmasterPriority1;
439  unsigned char grandmasterPriority2;
440  ClockQuality *clockQuality;
441  uint16_t stepsRemoved;
442  unsigned char timeSource;
443 
444  PTPMessageAnnounce(void);
445  public:
450 
455 
462  bool isBetterThan(PTPMessageAnnounce * msg);
463 
468  unsigned char getGrandmasterPriority1(void) {
469  return grandmasterPriority1;
470  }
471 
476  unsigned char getGrandmasterPriority2(void) {
477  return grandmasterPriority2;
478  }
479 
485  return grandmasterClockQuality;
486  }
487 
492  uint16_t getStepsRemoved(void) {
493  return stepsRemoved;
494  }
495 
501  void getGrandmasterIdentity(char *identity) {
502  memcpy(identity, grandmasterIdentity, PTP_CLOCK_IDENTITY_LENGTH);
503  }
504 
510  ClockIdentity ret;
511  ret.set( grandmasterIdentity );
512  return ret;
513  }
514 
520  void processMessage(IEEE1588Port * port);
521 
528  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
529 
530  friend PTPMessageCommon *buildPTPMessage(char *buf, int size,
531  LinkLayerAddress * remote,
532  IEEE1588Port * port);
533 };
534 
538 class PTPMessageSync : public PTPMessageCommon {
539  private:
540  Timestamp originTimestamp;
541 
543  public:
549 
553  ~PTPMessageSync();
554 
560  void processMessage(IEEE1588Port * port);
561 
567  return originTimestamp;
568  }
569 
576  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
577 
579  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
580 };
581 
582 /* Exact fit. No padding*/
583 #pragma pack(push,1)
584 
589 class scaledNs {
590  private:
591  int32_t ms;
592  uint64_t ls;
593  public:
597  scaledNs() {
598  ms = 0;
599  ls = 0;
600  }
607  void toByteString(uint8_t * byte_str) {
608  memcpy(byte_str, this, sizeof(*this));
609  }
610 };
615 class FollowUpTLV {
616  private:
617  uint16_t tlvType;
618  uint16_t lengthField;
619  uint8_t organizationId[3];
620  uint8_t organizationSubType_ms;
621  uint16_t organizationSubType_ls;
622  int32_t cumulativeScaledRateOffset;
623  uint16_t gmTimeBaseIndicator;
624  scaledNs scaledLastGmPhaseChange;
625  int32_t scaledLastGmFreqChange;
626  public:
630  FollowUpTLV() {
631  tlvType = PLAT_htons(0x3);
632  lengthField = PLAT_htons(28);
633  organizationId[0] = '\x00';
634  organizationId[1] = '\x80';
635  organizationId[2] = '\xC2';
636  organizationSubType_ms = 0;
637  organizationSubType_ls = PLAT_htons(1);
638  cumulativeScaledRateOffset = PLAT_htonl(0);
639  gmTimeBaseIndicator = PLAT_htons(0);
640  scaledLastGmFreqChange = PLAT_htonl(0);
641  }
642 
647  void toByteString(uint8_t * byte_str) {
648  memcpy(byte_str, this, sizeof(*this));
649  }
650 
655  int32_t getRateOffset() {
656  return cumulativeScaledRateOffset;
657  }
658 };
660 /* back to whatever the previous packing mode was */
661 #pragma pack(pop)
662 
667 private:
668  Timestamp preciseOriginTimestamp;
669 
671 
672  PTPMessageFollowUp(void) { }
673 public:
678 
685  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
686 
692  void processMessage(IEEE1588Port * port);
698  return preciseOriginTimestamp;
699  }
700 
706  void setPreciseOriginTimestamp(Timestamp & timestamp) {
707  preciseOriginTimestamp = timestamp;
708  }
709 
711  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
712 };
713 
718  private:
719  Timestamp originTimestamp;
720 
722  return;
723  }
724  public:
729  }
730 
735 
742  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
743 
749  void processMessage(IEEE1588Port * port);
750 
756  return originTimestamp;
757  }
758 
760  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
761 };
762 
767 private:
768  PortIdentity * requestingPortIdentity;
769  Timestamp requestReceiptTimestamp;
770 
771  PTPMessagePathDelayResp(void) {
772  }
773 public:
782 
789  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
790 
796  void processMessage(IEEE1588Port * port);
797 
803  void setRequestReceiptTimestamp(Timestamp timestamp) {
804  requestReceiptTimestamp = timestamp;
805  }
806 
812  void setRequestingPortIdentity(PortIdentity * identity);
818  void getRequestingPortIdentity(PortIdentity * identity);
819 
825  return requestReceiptTimestamp;
826  }
827 
829  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
830 };
831 
836  private:
837  Timestamp responseOriginTimestamp;
838  PortIdentity *requestingPortIdentity;
841 public:
846 
851 
858  void sendPort(IEEE1588Port * port, PortIdentity * destIdentity);
859 
865  void processMessage(IEEE1588Port * port);
866 
872  void setResponseOriginTimestamp(Timestamp timestamp) {
873  responseOriginTimestamp = timestamp;
874  }
880  void setRequestingPortIdentity(PortIdentity * identity);
881 
887  return responseOriginTimestamp;
888  }
894  return requestingPortIdentity;
895  }
896 
898  (char *buf, int size, LinkLayerAddress * remote, IEEE1588Port * port);
899 };
900 
901 #endif
unsigned char domainNumber
Definition: avbts_message.hpp:182
Definition: avbts_message.hpp:619
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessageSync message on the IEEE1588Port payload.
void processMessage(IEEE1588Port *port)
Processes PTP messages.
Definition: avbts_message.hpp:542
void getRequestingPortIdentity(PortIdentity *identity)
Gets requesting port identity.
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
Definition: avbts_message.hpp:434
void setRequestingPortIdentity(PortIdentity *identity)
Sets the requesting port identity.
PortIdentity * getRequestingPortIdentity(void)
Gets the requesting port identity.
Definition: avbts_message.hpp:897
unsigned char * getFlags(void)
Gets a pointer to the flags field within the PTP message.
Definition: avbts_message.hpp:207
MessageType
Definition: avbts_message.hpp:129
virtual ~PTPMessageCommon(void)
MessageType messageType
Definition: avbts_message.hpp:171
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
scaledNs()
Definition: avbts_message.hpp:601
Definition: avbts_message.hpp:839
FollowUpTLV()
Definition: avbts_message.hpp:634
uint16_t messageLength
Definition: avbts_message.hpp:179
unsigned _timestamp_counter_value
Definition: avbts_message.hpp:185
long long correctionField
Definition: avbts_message.hpp:181
void buildCommonHeader(uint8_t *buf)
Builds PTP common header.
uint16_t PLAT_ntohs(uint16_t s)
Converts the unsigned short integer netshort from network byte order to host byte order...
long long getCorrectionField(void)
Gets the correctionField value in a Little-Endian format.
Definition: avbts_message.hpp:241
LegacyMessageType
Definition: avbts_message.hpp:145
unsigned char versionPTP
Definition: avbts_message.hpp:169
Definition: avbts_port.hpp:76
unsigned char getGrandmasterPriority1(void)
Gets grandmaster's priority1 value.
Definition: avbts_message.hpp:472
Timestamp _timestamp
Definition: avbts_message.hpp:184
LegacyMessageType control
Definition: avbts_message.hpp:176
Definition: ieee1588.hpp:111
unsigned char flags[2]
Definition: avbts_message.hpp:177
void processMessage(IEEE1588Port *port)
Processes PTP message.
uint16_t versionNetwork
Definition: avbts_message.hpp:170
bool _gc
Definition: avbts_message.hpp:186
uint16_t getStepsRemoved(void)
Gets the steps removed value. See IEEE 802.1AS clause 10.3.3.
Definition: avbts_message.hpp:496
#define PTP_CLOCK_IDENTITY_LENGTH
Definition: ieee1588.hpp:54
Timestamp getPreciseOriginTimestamp(void)
Gets the precise origin timestamp value.
Definition: avbts_message.hpp:701
ClockQuality * getGrandmasterClockQuality(void)
Gets grandmaster clock quality.
Definition: avbts_message.hpp:488
Timestamp getTimestamp(void)
Gets the current Timestamp value from the PTP message.
Definition: avbts_message.hpp:272
MulticastType
Definition: avbts_message.hpp:157
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessagePathDelayResp message on the IEEE1588Port payload.
Definition: avbts_message.hpp:770
Definition: avbts_message.hpp:344
void getGrandmasterIdentity(char *identity)
Gets grandmaster identity value.
Definition: avbts_message.hpp:505
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
void setSequenceId(uint16_t seq)
Sets the sequence ID value to the PTP message.
Definition: avbts_message.hpp:223
MessageType getMessageType(void)
Gets the MessageType field within the PTP message.
Definition: avbts_message.hpp:231
void toByteString(uint8_t *byte_str)
Gets FollowUpTLV information in a byte string format.
Definition: avbts_message.hpp:651
void processMessage(IEEE1588Port *port)
Processes PTP messages.
Definition: avbts_message.hpp:167
void processMessage(IEEE1588Port *port)
Processes PTP messages.
Definition: avbts_clock.hpp:58
Definition: avbts_osnet.hpp:52
Timestamp getRequestReceiptTimestamp(void)
Gets the request receipt timestamp.
Definition: avbts_message.hpp:828
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessagePathDelayReq message on the IEEE1588Port payload.
uint32_t getTimestampCounterValue(void)
Gets the timestamp counter value set during the RX timestamp method.
Definition: avbts_message.hpp:279
int32_t getRateOffset()
Gets the cummulative scaledRateOffset.
Definition: avbts_message.hpp:659
uint32_t PLAT_htonl(uint32_t l)
Converts the unsigned integer hostlong from host byte order to network byte order.
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
uint16_t getSequenceId(void)
Gets the sequenceId value within a ptp message.
Definition: avbts_message.hpp:215
void setCorrectionField(long long correctionAmount)
Sets the correction field. It expects the host format.
Definition: avbts_message.hpp:251
void toByteString(uint8_t *byte_str)
Gets scaledNs in a byte string format.
Definition: avbts_message.hpp:611
unsigned char getGrandmasterPriority2(void)
Gets grandmaster's priority2 value.
Definition: avbts_message.hpp:480
Definition: avbts_port.hpp:207
bool isBetterThan(PTPMessageAnnounce *msg)
Compare gramdmaster's capabilities comming on the announce messages against the current grandmaster c...
#define PATH_TRACE_TLV_TYPE
Definition: avbts_message.hpp:328
void setResponseOriginTimestamp(Timestamp timestamp)
Sets the response origin timestamp.
Definition: avbts_message.hpp:876
Timestamp getResponseOriginTimestamp(void)
Gets the response origin timestamp.
Definition: avbts_message.hpp:890
void getPortIdentity(PortIdentity *identity)
Gets PortIdentity field.
bool isSenderEqual(PortIdentity portIdentity)
Determine whether the message was sent by given communication technology, uuid, and port id fields...
Timestamp getOriginTimestamp(void)
Gets origin timestamp value.
Definition: avbts_message.hpp:759
PTPMessageCommon(void)
Definition: avbts_message.hpp:191
void processMessage(IEEE1588Port *port)
Processes PTP messages.
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessageFollowUp message on the IEEE1588Port payload.
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessageAnnounce message on the IEEE1588Port payload.
bool garbage()
Gets the garbage collection status.
Definition: avbts_message.hpp:295
uint16_t sequenceId
Definition: avbts_message.hpp:175
char logMeanMessageInterval
Definition: avbts_message.hpp:180
void sendPort(IEEE1588Port *port, PortIdentity *destIdentity)
Assembles PTPMessageRespFollowUp message on the IEEE1588Port payload.
PortIdentity * sourcePortIdentity
Definition: avbts_message.hpp:173
ClockIdentity getGrandmasterClockIdentity()
Gets grandmaster's clockIdentity value.
Definition: avbts_message.hpp:513
void setPortIdentity(PortIdentity *identity)
Sets PortIdentity value.
Timestamp getOriginTimestamp(void)
Gets origin timestamp value.
Definition: avbts_message.hpp:570
void setRequestingPortIdentity(PortIdentity *identity)
Sets requesting port identity.
void setPreciseOriginTimestamp(Timestamp &timestamp)
Sets the precis origin timestamp value.
Definition: avbts_message.hpp:710
Definition: avbts_message.hpp:721
uint16_t PLAT_htons(uint16_t s)
Converts the unsigned short integer hostshort from host byte order to network byte order...
Definition: avbts_message.hpp:670
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.
void setTimestamp(Timestamp &timestamp)
Sets the timestamp value.
Definition: avbts_message.hpp:287
Definition: avbts_message.hpp:593
void setRequestReceiptTimestamp(Timestamp timestamp)
Sets the request receipt timestamp.
Definition: avbts_message.hpp:807
void processMessage(IEEE1588Port *port)
Processes PTP messages.
virtual void processMessage(IEEE1588Port *port)
Generic interface for processing PTP message.
Definition: ieee1588.hpp:222
~PTPMessagePathDelayReq()
Definition: avbts_message.hpp:732
void set(uint8_t *id)
Set the clock id to the object.
Definition: ieee1588.hpp:189
friend PTPMessageCommon * buildPTPMessage(char *buf, int size, LinkLayerAddress *remote, IEEE1588Port *port)
Builds a PTP message.