gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
avbts_message.hpp File Reference
#include <stdint.h>
#include <avbts_osnet.hpp>
#include <ieee1588.hpp>
#include <list>
#include <algorithm>
Include dependency graph for avbts_message.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PTPMessageCommon
 
class  PathTraceTLV
 
class  PTPMessageAnnounce
 
class  PTPMessageSync
 
class  scaledNs
 
class  FollowUpTLV
 
class  PTPMessageFollowUp
 
class  PTPMessagePathDelayReq
 
class  PTPMessagePathDelayResp
 
class  PTPMessagePathDelayRespFollowUp
 

Macros

#define PTP_CODE_STRING_LENGTH   4
 
#define PTP_SUBDOMAIN_NAME_LENGTH   16
 
#define PTP_FLAGS_LENGTH   2
 
#define GPTP_VERSION   2
 
#define PTP_NETWORK_VERSION   1
 
#define PTP_ETHER   1
 
#define PTP_DEFAULT   255
 
#define PTP_COMMON_HDR_OFFSET   0
 
#define PTP_COMMON_HDR_LENGTH   34
 
#define PTP_COMMON_HDR_TRANSSPEC_MSGTYPE(x)   x
 
#define PTP_COMMON_HDR_PTP_VERSION(x)   x+1
 
#define PTP_COMMON_HDR_MSG_LENGTH(x)   x+2
 
#define PTP_COMMON_HDR_DOMAIN_NUMBER(x)   x+4
 
#define PTP_COMMON_HDR_FLAGS(x)   x+6
 
#define PTP_COMMON_HDR_CORRECTION(x)   x+8
 
#define PTP_COMMON_HDR_SOURCE_CLOCK_ID(x)   x+20
 
#define PTP_COMMON_HDR_SOURCE_PORT_ID(x)   x+28
 
#define PTP_COMMON_HDR_SEQUENCE_ID(x)   x+30
 
#define PTP_COMMON_HDR_CONTROL(x)   x+32
 
#define PTP_COMMON_HDR_LOG_MSG_INTRVL(x)   x+33
 
#define PTP_ANNOUNCE_OFFSET   34
 
#define PTP_ANNOUNCE_LENGTH   30
 
#define PTP_ANNOUNCE_CURRENT_UTC_OFFSET(x)   x+10
 
#define PTP_ANNOUNCE_GRANDMASTER_PRIORITY1(x)   x+13
 
#define PTP_ANNOUNCE_GRANDMASTER_CLOCK_QUALITY(x)   x+14
 
#define PTP_ANNOUNCE_GRANDMASTER_PRIORITY2(x)   x+18
 
#define PTP_ANNOUNCE_GRANDMASTER_IDENTITY(x)   x+19
 
#define PTP_ANNOUNCE_STEPS_REMOVED(x)   x+27
 
#define PTP_ANNOUNCE_TIME_SOURCE(x)   x+29
 
#define PTP_SYNC_OFFSET   34
 
#define PTP_SYNC_LENGTH   10
 
#define PTP_SYNC_SEC_MS(x)   x
 
#define PTP_SYNC_SEC_LS(x)   x+2
 
#define PTP_SYNC_NSEC(x)   x+6
 
#define PTP_FOLLOWUP_OFFSET   34
 
#define PTP_FOLLOWUP_LENGTH   10
 
#define PTP_FOLLOWUP_SEC_MS(x)   x
 
#define PTP_FOLLOWUP_SEC_LS(x)   x+2
 
#define PTP_FOLLOWUP_NSEC(x)   x+6
 
#define PTP_PDELAY_REQ_OFFSET   34
 
#define PTP_PDELAY_REQ_LENGTH   20
 
#define PTP_PDELAY_REQ_SEC_MS(x)   x
 
#define PTP_PDELAY_REQ_SEC_LS(x)   x+2
 
#define PTP_PDELAY_REQ_NSEC(x)   x+6
 
#define PTP_PDELAY_RESP_OFFSET   34
 
#define PTP_PDELAY_RESP_LENGTH   20
 
#define PTP_PDELAY_RESP_SEC_MS(x)   x
 
#define PTP_PDELAY_RESP_SEC_LS(x)   x+2
 
#define PTP_PDELAY_RESP_NSEC(x)   x+6
 
#define PTP_PDELAY_RESP_REQ_CLOCK_ID(x)   x+10
 
#define PTP_PDELAY_RESP_REQ_PORT_ID(x)   x+18
 
#define PTP_PDELAY_FOLLOWUP_OFFSET   34
 
#define PTP_PDELAY_FOLLOWUP_LENGTH   20
 
#define PTP_PDELAY_FOLLOWUP_SEC_MS(x)   x
 
#define PTP_PDELAY_FOLLOWUP_SEC_LS(x)   x+2
 
#define PTP_PDELAY_FOLLOWUP_NSEC(x)   x+6
 
#define PTP_PDELAY_FOLLOWUP_REQ_CLOCK_ID(x)   x+10
 
#define PTP_PDELAY_FOLLOWUP_REQ_PORT_ID(x)   x+18
 
#define PTP_LI_61_BYTE   1
 
#define PTP_LI_61_BIT   0
 
#define PTP_LI_59_BYTE   1
 
#define PTP_LI_59_BIT   1
 
#define PTP_ASSIST_BYTE   0
 
#define PTP_ASSIST_BIT   1
 
#define PTP_PTPTIMESCALE_BYTE   1
 
#define PTP_PTPTIMESCALE_BIT   3
 
#define TX_TIMEOUT_BASE   1000
 
#define TX_TIMEOUT_ITER   6
 
#define PATH_TRACE_TLV_TYPE   0x8
 

Enumerations

enum  MessageType {
  SYNC_MESSAGE = 0, DELAY_REQ_MESSAGE = 1, PATH_DELAY_REQ_MESSAGE = 2, PATH_DELAY_RESP_MESSAGE = 3,
  FOLLOWUP_MESSAGE = 8, DELAY_RESP_MESSAGE = 9, PATH_DELAY_FOLLOWUP_MESSAGE = 0xA, ANNOUNCE_MESSAGE = 0xB,
  SIGNALLING_MESSAGE = 0xC, MANAGEMENT_MESSAGE = 0xD
}
 
enum  LegacyMessageType {
  SYNC, DELAY_REQ, FOLLOWUP, DELAY_RESP,
  MANAGEMENT, MESSAGE_OTHER
}
 
enum  MulticastType { MCAST_NONE, MCAST_PDELAY, MCAST_OTHER }
 

Macro Definition Documentation

#define GPTP_VERSION   2

GPTP version

#define PATH_TRACE_TLV_TYPE   0x8

This is the value that indicates the TLV is a path trace TLV, as specified in 16.2.7.1 and Table 34 of IEEE Std 1588-2008. The value is specified there as PATH_TRACE, whose value is 0x8.

#define PTP_ANNOUNCE_CURRENT_UTC_OFFSET (   x)    x+10

Gets PTP announce current UTC offset

#define PTP_ANNOUNCE_GRANDMASTER_CLOCK_QUALITY (   x)    x+14

Gets Grandmaster clock quality offset on announce fields

#define PTP_ANNOUNCE_GRANDMASTER_IDENTITY (   x)    x+19

Gets Grandmaster identity offset on announce fields

#define PTP_ANNOUNCE_GRANDMASTER_PRIORITY1 (   x)    x+13

Gets Grandmaster priority1 offset on announce fields

#define PTP_ANNOUNCE_GRANDMASTER_PRIORITY2 (   x)    x+18

Gets Grandmasdter priority2 offset on announce fields

#define PTP_ANNOUNCE_LENGTH   30

PTP announce length in bytes

#define PTP_ANNOUNCE_OFFSET   34

PTP announce offset

#define PTP_ANNOUNCE_STEPS_REMOVED (   x)    x+27

Gets steps removed offset on announce fields

#define PTP_ANNOUNCE_TIME_SOURCE (   x)    x+29

Gets time source offset on announce fields

#define PTP_ASSIST_BIT   1

PTP_ASSIST(two step flag) bit on PTP_ASSIST byte

#define PTP_ASSIST_BYTE   0

PTP_ASSIST(two step flag) byte offset on flags field

#define PTP_CODE_STRING_LENGTH   4

PTP code string length in bytes

#define PTP_COMMON_HDR_CONTROL (   x)    x+32

Gets the control offset on PTP header

#define PTP_COMMON_HDR_CORRECTION (   x)    x+8

Gets the correction field offset on PTP header

#define PTP_COMMON_HDR_DOMAIN_NUMBER (   x)    x+4

Gets the domain number offset on PTP header

#define PTP_COMMON_HDR_FLAGS (   x)    x+6

Gets the flags offset on PTP header

#define PTP_COMMON_HDR_LENGTH   34

PTP common header length in bytes

#define PTP_COMMON_HDR_LOG_MSG_INTRVL (   x)    x+33

Gets the log message interval offset on PTP header

#define PTP_COMMON_HDR_MSG_LENGTH (   x)    x+2

Gets the message length offset on PTP header

#define PTP_COMMON_HDR_OFFSET   0

PTP common header offset

#define PTP_COMMON_HDR_PTP_VERSION (   x)    x+1

Gets the ptp version offset on PTP header

#define PTP_COMMON_HDR_SEQUENCE_ID (   x)    x+30

Gets the sequence id offset on PTP header

#define PTP_COMMON_HDR_SOURCE_CLOCK_ID (   x)    x+20

Gets the source clock id offset on PTP header

#define PTP_COMMON_HDR_SOURCE_PORT_ID (   x)    x+28

Gets the source port id offset on PTP header

#define PTP_COMMON_HDR_TRANSSPEC_MSGTYPE (   x)    x

Gets the message type offset on PTP header

#define PTP_DEFAULT   255
Todo:
Not used
#define PTP_ETHER   1
Todo:
Not used
#define PTP_FLAGS_LENGTH   2

PTP flags length in bytes

#define PTP_FOLLOWUP_LENGTH   10

PTP FOLLOWUP length in bytes

#define PTP_FOLLOWUP_NSEC (   x)    x+6

Gets tne followup nanoseconds offset

#define PTP_FOLLOWUP_OFFSET   34

PTP FOLLOWUP base offset

#define PTP_FOLLOWUP_SEC_LS (   x)    x+2

Gets the followup seconds LSB offset

#define PTP_FOLLOWUP_SEC_MS (   x)    x

Gets the followup seconds MSB offset

#define PTP_LI_59_BIT   1

PTP_LI_59(leap59) bit offset on PTP_LI_59 byte

#define PTP_LI_59_BYTE   1

PTP_LI_59(leap59) byte offset on flags field

#define PTP_LI_61_BIT   0

PTP_LI_61(leap61) bit offset on PTP_LI_61 byte

#define PTP_LI_61_BYTE   1

PTP_LI_61(leap61) byte offset on flags field

#define PTP_NETWORK_VERSION   1

PTP Network version

#define PTP_PDELAY_FOLLOWUP_LENGTH   20

PTP PDELAY FOLLOWUP length in bytes

#define PTP_PDELAY_FOLLOWUP_NSEC (   x)    x+6

Gets the pdelay followup nanoseconds offset

#define PTP_PDELAY_FOLLOWUP_OFFSET   34

PTP PDELAY FOLLOWUP base offset

#define PTP_PDELAY_FOLLOWUP_REQ_CLOCK_ID (   x)    x+10

Gets the pdelay followup request clock id offset

#define PTP_PDELAY_FOLLOWUP_REQ_PORT_ID (   x)    x+18

Gets the pdelay followup request port id offset

#define PTP_PDELAY_FOLLOWUP_SEC_LS (   x)    x+2

Gets the pdelay followup seconds LSB offset

#define PTP_PDELAY_FOLLOWUP_SEC_MS (   x)    x

Gets the pdelay followup seconds MSB offset

#define PTP_PDELAY_REQ_LENGTH   20

PTP PDELAY REQUEST length in bytes

#define PTP_PDELAY_REQ_NSEC (   x)    x+6

Gets the pdelay request nanoseconds offset

#define PTP_PDELAY_REQ_OFFSET   34

PTP PDELAY REQUEST base offset

#define PTP_PDELAY_REQ_SEC_LS (   x)    x+2

Gets the pdelay request seconds LSB offset

#define PTP_PDELAY_REQ_SEC_MS (   x)    x

Gets the pdelay request seconds MSB offset

#define PTP_PDELAY_RESP_LENGTH   20

PDELAY RESPONSE length in bytes

#define PTP_PDELAY_RESP_NSEC (   x)    x+6

Gets the pdelay nanoseconds offset

#define PTP_PDELAY_RESP_OFFSET   34

PDELAY RESPONSE base offset

#define PTP_PDELAY_RESP_REQ_CLOCK_ID (   x)    x+10

Gets the pdelay response request clock id offset

#define PTP_PDELAY_RESP_REQ_PORT_ID (   x)    x+18

Gets the pdelay response request port id offset

#define PTP_PDELAY_RESP_SEC_LS (   x)    x+2

Gets the pdelay response seconds LSB offset

#define PTP_PDELAY_RESP_SEC_MS (   x)    x

Gets the pdelay response seconds MSB offset

#define PTP_PTPTIMESCALE_BIT   3

PTPTIMESCAPE bit offset on PTPTIMESCALE byte

#define PTP_PTPTIMESCALE_BYTE   1

PTPTIMESCALE byte offset on flags field

#define PTP_SUBDOMAIN_NAME_LENGTH   16

PTP subdomain name lenght in bytes

#define PTP_SYNC_LENGTH   10

PTP SYNC length in bytes

#define PTP_SYNC_NSEC (   x)    x+6

PTP SYNC nanoseconds offset

#define PTP_SYNC_OFFSET   34

PTP SYNC base offset

#define PTP_SYNC_SEC_LS (   x)    x+2

PTP SYNC seconds LSB offset

#define PTP_SYNC_SEC_MS (   x)    x

PTP SYNC seconds MSB offset

#define TX_TIMEOUT_BASE   1000

Timeout base in microseconds

#define TX_TIMEOUT_ITER   6

Number of timeout iteractions for sending/receiving messages

Enumeration Type Documentation

Enumeration legacy message type

Enumeration message type. IEEE 1588-2008 Clause 13.3.2.2

Enumeration multicast type.