flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
ptp_types.h
Go to the documentation of this file.
1
10#ifndef FLEXPTP_PTP_TYPES_H_
11#define FLEXPTP_PTP_TYPES_H_
12
13#include <stdbool.h>
14#include <stdint.h>
15
16#include "event.h"
17#include "ptp_defs.h"
18#include "timeutils.h"
19
20#include "ptp_sync_cycle_data.h"
21
22#include <flexptp_options.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#ifdef FLEXPTP_FREERTOS
29typedef TimerHandle_t TimerType;
30#elif defined(FLEXPTP_CMSIS_OS2)
31typedef osTimerId_t TimerType;
32#endif
33
37typedef enum PTPMessageType {
45 PTP_MT_Announce = 11
47
51typedef enum PTPControl {
56 PTP_CON_Other = 5
58
62typedef struct {
73 bool PTP_LI_59;
74 bool PTP_LI_61;
75} PtpFlags;
76
80typedef struct
81{
82 // 0.
83 uint8_t messageType;
85
86 // 1.
87 uint8_t versionPTP;
89
90 // 2-3.
91 uint16_t messageLength;
92
93 // 4.
94 uint8_t domainNumber;
95
96 // 5.
97 uint8_t _r2;
98
99 // 6-7.
101
102 // 8-15.
103 uint64_t correction_ns;
105
106 // 16-19.
107 uint32_t _r3;
108
109 // 20-27.
110 uint64_t clockIdentity;
111
112 // 28-29
113 uint16_t sourcePortID;
114
115 // 30-31.
116 uint16_t sequenceID;
117
118 // 32.
119 uint8_t control;
120
121 // 33.
122 int8_t logMessagePeriod; // Logarithmic Message Period
123} PtpHeader;
124
128typedef struct {
132
136typedef enum {
138 PTP_TP_802_3 = 1
140
144typedef enum {
146 PTP_DM_P2P = 1
148
152typedef enum {
156
160typedef enum {
162 PTP_MC_GENERAL = 1
164
165#define MAX_PTP_MSG_SIZE (128)
166
170struct RawPtpMessage_;
171
175typedef void(TxCb)(const struct RawPtpMessage_ *pMsg);
176
180typedef enum {
185
186typedef struct RawPtpMessage_ {
188 uint32_t size;
189
190 // --- transmit related ---
191 uint32_t tag;
192 uint32_t ttl;
196
197 // --- data ---
198 uint8_t data[MAX_PTP_MSG_SIZE];
200
204typedef enum {
214 PTP_CC_SLAVE_ONLY = 255
216
220typedef enum {
221 PTP_CA_25NS = 0x20,
241
245typedef enum {
255
256#define PTP_VARIANCE_HAS_NOT_BEEN_COMPUTED (0xFFFF)
257
261typedef struct {
263 uint8_t priority1;
267 uint8_t priority2;
270 uint8_t timeSource;
272
274
278typedef enum PtpM2SState {
282
286typedef enum {
291
295typedef enum {
299
303typedef enum {
308
309typedef enum {
320
324typedef struct {
328 uint16_t masterTOCntr;
329 uint32_t stateDuration;
332
336typedef struct _PtpProfileAdditionalData {
337 const void *data;
338 uint16_t size;
340 struct _PtpProfileAdditionalData *next;
342
346typedef enum {
350 PTP_PF_N
352
356typedef struct {
363 uint8_t domainNumber;
364 uint8_t flags;
366} PtpProfile;
367
371typedef enum {
372 /* Standard TLVs */
376
377 /* Optional unicast message negotitation TLVs */
382
383 /* Optional path trace mechanism TLV */
385
386 /* Optional alternate timescale TLV */
388
389 /* Security TLVs */
393
394 /* Cumulative frequency scale factor offset */
397
398#define PTP_TLV_HEADER \
399 uint16_t type; \
400 uint16_t length;
405typedef struct {
408
412typedef struct {
413 uint16_t sequenceID, delay_reqSequenceID;
417 uint16_t syncPeriodMs;
419
423typedef struct {
424 uint16_t syncSequenceID;
427
431typedef enum {
436
440typedef struct {
442 uint64_t identity;
443 uint16_t reportCount;
444 uint16_t dropoutCntr;
446
450typedef struct {
451#ifdef PTP_ADDEND_INTERFACE
452 uint32_t addend;
453#elif defined(PTP_HLT_INTERFACE)
454 float tuning_ppb;
455#endif
457
461typedef struct {
464
468typedef struct {
469 double filtTimeErr;
470 bool locked;
471} PtpStats;
472
476typedef void (*PtpSyncCallback)(int64_t time_error, const PtpSyncCycleData *pSCD,
477#ifdef PTP_ADDEND_INTERFACE
478 uint32_t freqCodeWord
479#elif defined(PTP_HLT_INTERFACE)
480 float tuning_ppb
481#endif
482);
483
488
492typedef enum { PTP_FC_IDLE = 0,
497
501typedef struct {
504
506
507 struct {
509 uint64_t clockIdentity;
510 } hwoptions;
511
514
515 uint32_t ticks;
516
517 // Logging
518 struct {
519 bool def;
520 bool corr;
522 bool info;
523 bool locked;
524 bool bmca;
526 } logging;
527
530
531 /* ---- SLAVE ----- */
532
533 struct {
534 bool enabled;
535
540 uint8_t fastCompCntr;
544 uint64_t coarseLimit;
545
547 uint32_t delReqTmr;
548
550 } slave;
551
552 /* ---- MASTER ----- */
553
554 struct {
555 bool enabled;
556
559 PtpSyncCycleData scd;
560 bool expectPDelRespFollowUp;
561
563
564 uint32_t syncTickPeriod;
565 uint32_t syncTmr;
567 uint32_t announceTmr;
569 uint32_t pdelayReqTmr;
570 } master;
572
573#ifdef __cplusplus
574}
575#endif
576
577#endif /* FLEXPTP_PTP_TYPES_H_ */
In this module are the core and user events defined.
PtpUserEventCode
Definition: event.h:46
In here reside a multitude of fundamental PTP-related constants and definitions.
#define PTP_MAX_TLV_PRESET_NAME_LENGTH
Maximum TLV preset name length.
Definition: ptp_defs.h:66
This module defines the context object of a full synchronization cycle. In SLAVE mode four timestamps...
BmcaCandidateState
BMCA candidate states.
Definition: ptp_types.h:295
@ BMCA_CANDIDATE_COLLECTION
Collecting candidates, we are in the candidate collection time window.
Definition: ptp_types.h:297
@ BMCA_NO_CANDIDATE
No candidate on the network.
Definition: ptp_types.h:296
PtpControl
PTP header control field values.
Definition: ptp_types.h:51
@ PTP_CON_Other
Other.
Definition: ptp_types.h:56
@ PTP_CON_Delay_Req
Delay Request.
Definition: ptp_types.h:53
@ PTP_CON_Follow_Up
Follow Up.
Definition: ptp_types.h:54
@ PTP_CON_Delay_Resp
Delay Response.
Definition: ptp_types.h:55
@ PTP_CON_Sync
Sync.
Definition: ptp_types.h:52
PtpTransportType
PTP transport type enumeration.
Definition: ptp_types.h:136
@ PTP_TP_IPv4
IPv4 Transport Type.
Definition: ptp_types.h:137
@ PTP_TP_802_3
Ethernet Transport Type.
Definition: ptp_types.h:138
PtpLogMsgPeriods
Enumeration for logarithmic message period boundaries.
Definition: ptp_types.h:303
@ PTP_LOGPER_MAX
Maximal logarithmic messaging period.
Definition: ptp_types.h:305
@ PTP_LOGPER_MIN
Minimal logarithmic messaging period.
Definition: ptp_types.h:304
@ PTP_LOGPER_SYNCMATCHED
Messaging occurs whenever a Sync arrives.
Definition: ptp_types.h:306
void(* PtpUserEventCallback)(PtpUserEventCode uev)
Definition: ptp_types.h:487
void(* PtpSyncCallback)(int64_t time_error, const PtpSyncCycleData *pSCD, uint32_t freqCodeWord)
Definition: ptp_types.h:476
PtpBmcaFsmState
Definition: ptp_types.h:309
@ PTP_BMCA_FAULTY
Definition: ptp_types.h:317
@ PTP_BMCA_UNCALIBRATED
Definition: ptp_types.h:316
@ PTP_BMCA_MASTER
Definition: ptp_types.h:313
@ PTP_BMCA_PASSIVE
Definition: ptp_types.h:315
@ PTP_BMCA_LISTENING
Definition: ptp_types.h:311
@ PTP_BMCA_SLAVE
Definition: ptp_types.h:314
@ PTP_BMCA_INITIALIZING
Definition: ptp_types.h:310
@ PTP_BMCA_DISABLED
Definition: ptp_types.h:318
@ PTP_BMCA_PRE_MASTER
Definition: ptp_types.h:312
TimerHandle_t TimerType
Definition: ptp_types.h:29
PtpClockClass
Standard PTP clock classes.
Definition: ptp_types.h:204
@ PTP_CC_PRIMARY_REFERENCE_DEGRAD_B
A Primary reference operating off the holdover specification, can be a slave.
Definition: ptp_types.h:211
@ PTP_CC_APPLICATION_SPECIFIC_DEGRAD_A
An Application specific class clock operating off the holdover specification.
Definition: ptp_types.h:210
@ PTP_CC_DEFAULT
Default clock class.
Definition: ptp_types.h:213
@ PTP_CC_APPLICATION_SPECIFIC_DEGRAD_B
An Application specific class clock operating off the holdover specification, can be a slave.
Definition: ptp_types.h:212
@ PTP_CC_PRIMARY_REFERENCE_HOLDOVER
Normally a Primary reference clock, but now working in holdover mode.
Definition: ptp_types.h:206
@ PTP_CC_PRIMARY_REFERENCE
Primary reference clock, cannot be a slave.
Definition: ptp_types.h:205
@ PTP_CC_APPLICATION_SPECIFIC
Application specific reference clock, ARB timescale, cannot be a slave.
Definition: ptp_types.h:207
@ PTP_CC_SLAVE_ONLY
The clock is slave ony.
Definition: ptp_types.h:214
@ PTP_CC_APPLICAION_SPECIFIC_HOLDOVER
An Application specific class clock that operates in holdover.
Definition: ptp_types.h:208
@ PTP_CC_PRIMARY_REFERENCE_DEGRAD_A
A Primary reference operating off the holdover specification.
Definition: ptp_types.h:209
PtpTlvType
PTP TLV types.
Definition: ptp_types.h:371
@ PTP_TLV_ALTERNATE_TIME_OFFSET_INDICATOR
Definition: ptp_types.h:387
@ PTP_TLV_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION
Definition: ptp_types.h:381
@ PTP_TLV_CUM_FREQ_SCALE_FACTOR_OFFSET
Definition: ptp_types.h:395
@ PTP_TLV_AUTHENTICATION_CHALLENGE
Definition: ptp_types.h:391
@ PTP_TLV_PATH_TRACE
Definition: ptp_types.h:384
@ PTP_TLV_MANAGEMENT_ERROR_STATUS
Management error status.
Definition: ptp_types.h:374
@ PTP_TLV_MANAGEMENT
Management extension.
Definition: ptp_types.h:373
@ PTP_TLV_GRANT_UNICAST_TRANSMISSION
Definition: ptp_types.h:379
@ PTP_TLV_ORGANIZATION_EXTENSION
Organization extension.
Definition: ptp_types.h:375
@ PTP_TLV_SECURITY_ASSOCIATION_UPDATE
Definition: ptp_types.h:392
@ PTP_TLV_CANCEL_UNICAST_TRANSMISSION
Definition: ptp_types.h:380
@ PTP_TLV_AUTHENTICATION
Definition: ptp_types.h:390
@ PTP_TLV_REQUEST_UNICAST_TRANSMISSION
Definition: ptp_types.h:378
#define PTP_TLV_HEADER
Definition: ptp_types.h:398
void() TxCb(const struct RawPtpMessage_ *pMsg)
Transmit callback function prototype.
Definition: ptp_types.h:175
PtpAnnounceBody PtpMasterProperties
Definition: ptp_types.h:273
PtpMessageClass
Enumeration for different PTP message classes.
Definition: ptp_types.h:160
@ PTP_MC_EVENT
Event Message Class.
Definition: ptp_types.h:161
@ PTP_MC_GENERAL
General Message Class.
Definition: ptp_types.h:162
PtpFastCompState
Definition: ptp_types.h:492
@ PTP_FC_TIME_CORRECTION_PROPAGATION
Waiting for the effects of time correction to propagate.
Definition: ptp_types.h:495
@ PTP_FC_SKEW_CORRECTION
Skew correction is running.
Definition: ptp_types.h:493
@ PTP_FC_TIME_CORRECTION
Time correction is running.
Definition: ptp_types.h:494
@ PTP_FC_IDLE
Fast correction algorithm is IDLE.
Definition: ptp_types.h:492
PtpClockAccuracy
Standard clock accuracy definitions.
Definition: ptp_types.h:220
@ PTP_CA_2_5US
Accurate to within 2.5us.
Definition: ptp_types.h:225
@ PTP_CA_250MS
Accurate to within 250ms.
Definition: ptp_types.h:235
@ PTP_CA_GT10S
Accurate to > 10s.
Definition: ptp_types.h:238
@ PTP_CA_100US
Accurate to within 100us.
Definition: ptp_types.h:228
@ PTP_CA_250NS
Accurate to within 250ns.
Definition: ptp_types.h:223
@ PTP_CA_10S
Accurate to within 10s.
Definition: ptp_types.h:237
@ PTP_CA_1MS
Accurate to within 1ms.
Definition: ptp_types.h:230
@ PTP_CA_UNKNOWN
Accuracy is unknown.
Definition: ptp_types.h:239
@ PTP_CA_100MS
Accurate to within 100ms.
Definition: ptp_types.h:234
@ PTP_CA_250US
Accurate to within 250us.
Definition: ptp_types.h:229
@ PTP_CA_25NS
Accurate to within 25ns.
Definition: ptp_types.h:221
@ PTP_CA_1US
Accurate to within 1us.
Definition: ptp_types.h:224
@ PTP_CA_25US
Accurate to within 25us.
Definition: ptp_types.h:227
@ PTP_CA_10US
Accurate to within 10us.
Definition: ptp_types.h:226
@ PTP_CA_100NS
Accurate to within 100ns.
Definition: ptp_types.h:222
@ PTP_CA_25MS
Accurate to within 25ms.
Definition: ptp_types.h:233
@ PTP_CA_1S
Accurate to within 1s.
Definition: ptp_types.h:236
@ PTP_CA_2_5MS
Accurate to within 2.5ms.
Definition: ptp_types.h:231
@ PTP_CA_10MS
Accurate to within 10ms.
Definition: ptp_types.h:232
PtpM2SState
Core state machine states.
Definition: ptp_types.h:278
@ SWaitFollowUp
Waiting for a Follow_Up message.
Definition: ptp_types.h:280
@ SIdle
Idle.
Definition: ptp_types.h:279
PtpMessageType
PTP packet type enumeration.
Definition: ptp_types.h:37
@ PTP_MT_Delay_Resp
Delay Response.
Definition: ptp_types.h:43
@ PTP_MT_PDelay_Resp
Peer Delay Response.
Definition: ptp_types.h:41
@ PTP_MT_Sync
Sync.
Definition: ptp_types.h:38
@ PTP_MT_PDelay_Req
Peer Delay Request.
Definition: ptp_types.h:40
@ PTP_MT_Announce
Announce.
Definition: ptp_types.h:45
@ PTP_MT_Delay_Req
Delay Request.
Definition: ptp_types.h:39
@ PTP_MT_PDelay_Resp_Follow_Up
Peer Delay Response Follow Up.
Definition: ptp_types.h:44
@ PTP_MT_Follow_Up
Follow Up.
Definition: ptp_types.h:42
PtpDelayMechanism
PTP Delay mechanism enumeration.
Definition: ptp_types.h:144
@ PTP_DM_E2E
End-to-End Delay Mechanism.
Definition: ptp_types.h:145
@ PTP_DM_P2P
Peer-to-Peer Delay Mechanism.
Definition: ptp_types.h:146
RawPtpMsgTag
Definition: ptp_types.h:180
@ RPMT_RANDOM
Create a random, unique tag.
Definition: ptp_types.h:181
@ RPMT_SYNC
Sync tag.
Definition: ptp_types.h:182
@ RPMT_DELAY_REQ
(P)Delay_Req tag
Definition: ptp_types.h:183
#define MAX_PTP_MSG_SIZE
Maximum PTP message size.
Definition: ptp_types.h:165
BmcaMasterState
BMCA master states.
Definition: ptp_types.h:286
@ BMCA_MASTER_ME
I am the best master, yeey!
Definition: ptp_types.h:289
@ BMCA_NO_MASTER
No master.
Definition: ptp_types.h:287
@ BMCA_MASTER_REMOTE
A remote master is found to be the best.
Definition: ptp_types.h:288
PtpP2PSlaveState
PTP P2P slave state viewed from the MASTER.
Definition: ptp_types.h:431
@ PTP_P2PSS_ESTABLISHED
The slave is considered stable and ready.
Definition: ptp_types.h:434
@ PTP_P2PSS_NONE
No slave is detected.
Definition: ptp_types.h:432
@ PTP_P2PSS_CANDIDATE
A slave has reported in at least once, now being checked on.
Definition: ptp_types.h:433
PtpTransportSpecific
PTP transport specific enumeration.
Definition: ptp_types.h:152
@ PTP_TSPEC_GPTP_8021AS
802.1AS Transport Specific Flag
Definition: ptp_types.h:154
@ PTP_TSPEC_UNKNOWN_DEF
Unkown Transport Specific Flag (default)
Definition: ptp_types.h:153
PtpProfileFlags
PTP profile flags.
Definition: ptp_types.h:346
@ PTP_PF_N
Number of available PTP profile flags.
Definition: ptp_types.h:350
@ PTP_PF_SLAVE_ONLY
Operating only in SLAVE mode.
Definition: ptp_types.h:349
@ PTP_PF_ISSUE_SYNC_FOR_COMPLIANT_SLAVE_ONLY_IN_P2P
Send Sync messages only for a compliant peer in P2P mode.
Definition: ptp_types.h:348
@ PTP_PF_NO_FLAGS
Empty profile flags.
Definition: ptp_types.h:347
PtpTimeSource
Standard PTP time source definitions.
Definition: ptp_types.h:245
@ PTP_TSRC_ATOMIC_CLOCK
The clock is directly connected to such a device and using the PTP timescale.
Definition: ptp_types.h:246
@ PTP_TSRC_PTP
The clock is synchronized to a different PTP domain.
Definition: ptp_types.h:249
@ PTP_TSRC_NTP
The clock is synchronized via NTP or SNTP.
Definition: ptp_types.h:250
@ PTP_TSRC_INTERNAL_OSCILLATOR
Undisciplined, free running oscillator.
Definition: ptp_types.h:253
@ PTP_TSRC_GPS
The clock is synchronized to a satellite system that distribtues time and frequency tied to internati...
Definition: ptp_types.h:247
@ PTP_TSRC_OTHER
Any of source not covered by other values.
Definition: ptp_types.h:252
@ PTP_TSRC_TERRESTRIAL_RADIO
The clock is synchronized via any type of radio distribution system that is tied to international sta...
Definition: ptp_types.h:248
@ PTP_TSRC_HAND_SET
The clock has been set by means of a human interface based on observation of an international standar...
Definition: ptp_types.h:251
Contents of a PTP Announce message without the common PTP header.
Definition: ptp_types.h:261
uint16_t currentUTCOffset
Current UTC Offset.
Definition: ptp_types.h:262
uint64_t grandmasterClockIdentity
Grandmaster Clock Identity.
Definition: ptp_types.h:268
uint8_t grandmasterClockClass
Grandmaster Clock Class.
Definition: ptp_types.h:264
uint8_t grandmasterClockAccuracy
Grandmaster Clock Accuracy.
Definition: ptp_types.h:265
uint16_t localStepsRemoved
Local Steps Removed.
Definition: ptp_types.h:269
uint16_t grandmasterClockVariance
Grandmaster Clock Variance.
Definition: ptp_types.h:266
uint8_t priority2
Priority 2.
Definition: ptp_types.h:267
uint8_t timeSource
Time Source.
Definition: ptp_types.h:270
uint8_t priority1
Priority 1.
Definition: ptp_types.h:263
BMCA state.
Definition: ptp_types.h:324
uint32_t stateDuration
Heartbeat cycles since last state transition.
Definition: ptp_types.h:329
PtpMasterProperties masterProps
Master clock properties.
Definition: ptp_types.h:326
uint16_t masterTOCntr
Current master announce dropout counter.
Definition: ptp_types.h:328
PtpBmcaFsmState state
BMCA state.
Definition: ptp_types.h:325
bool preventMasterSwitchOver
Set if master switchover is prohibited.
Definition: ptp_types.h:330
uint16_t masterAnnPer_ms
Message period of current master.
Definition: ptp_types.h:327
Giant PTP core state object.
Definition: ptp_types.h:501
TimestampI offset
PPS signal offset.
Definition: ptp_types.h:508
bool bmca
BMCA state change.
Definition: ptp_types.h:524
PtpBmcaState bmca
BMCA state.
Definition: ptp_types.h:512
PtpSyncCycleData scd
Sync cycle data.
Definition: ptp_types.h:537
bool locked
clock lock state change
Definition: ptp_types.h:523
uint32_t syncTmr
Counter for scheduling Sync transmission.
Definition: ptp_types.h:565
PtpUserEventCallback userEventCb
User event callback pointer.
Definition: ptp_types.h:529
uint32_t delReqTmr
Timer counting ticks for Delay_Req transmissions.
Definition: ptp_types.h:547
bool transmission
Transmission logging.
Definition: ptp_types.h:525
PtpP2PSlaveInfo p2pSlave
Information on the connected P2P slave (only used in P2P modes)
Definition: ptp_types.h:557
PtpHWClockState hwclock
Hardware clock state.
Definition: ptp_types.h:505
uint32_t pdelay_reqSequenceID
Sequence number of the last PDelay_Request sent.
Definition: ptp_types.h:558
PtpFastCompState fastCompState
State of fast compensation.
Definition: ptp_types.h:539
PtpSyncCallback syncCb
Sync callback invoked in every synchronization cycle.
Definition: ptp_types.h:549
uint64_t clockIdentity
clockIdentity calculated from MAC address
Definition: ptp_types.h:509
TimestampI prevSyncMa
T1 from the previous cycle.
Definition: ptp_types.h:541
bool def
default
Definition: ptp_types.h:519
PtpProfile profile
PTP profile.
Definition: ptp_types.h:502
PtpMasterMessagingState messaging
Messaging state.
Definition: ptp_types.h:562
uint32_t syncTickPeriod
Sync transmission period in ticks.
Definition: ptp_types.h:564
PtpMasterProperties capabilities
The capabilities of this device.
Definition: ptp_types.h:503
PtpSlaveMessagingState messaging
Messaging state.
Definition: ptp_types.h:536
uint32_t announceTmr
Counter to schedule Announce transmission.
Definition: ptp_types.h:567
TimestampI prevTimeError
Time error in the previous cycle.
Definition: ptp_types.h:543
bool enabled
Slave module is enabled.
Definition: ptp_types.h:534
bool corr
correction fields
Definition: ptp_types.h:520
PtpStats stats
Statistics.
Definition: ptp_types.h:528
TimestampI prevSyncSl
T2 from the previous cycle.
Definition: ptp_types.h:542
bool expectPDelRespFollowUp
Expect a PDelay_Resp_Follow_Up message.
Definition: ptp_types.h:538
bool timestamps
timestamps
Definition: ptp_types.h:521
uint32_t ticks
ticks counting form the initialization
Definition: ptp_types.h:515
bool info
informative messages
Definition: ptp_types.h:522
uint32_t pdelayReqTickPeriod
PDelayReq transmission period in ticks.
Definition: ptp_types.h:568
uint32_t pdelayReqTmr
Counter for PDelayReq transmission scheduling.
Definition: ptp_types.h:569
PtpNetworkState network
Network state.
Definition: ptp_types.h:513
uint32_t announceTickPeriod
Announce transmission in ticks.
Definition: ptp_types.h:566
uint64_t coarseLimit
time error limit above coarse correction is engaged
Definition: ptp_types.h:544
uint32_t delReqTickPeriod
ticks between Delay_Req transmissions
Definition: ptp_types.h:546
uint8_t fastCompCntr
Cycle counter for fast compensation.
Definition: ptp_types.h:540
Identification carrying Delay_Resp message.
Definition: ptp_types.h:128
uint64_t requestingSourceClockIdentity
Requesting Source Clock Identity.
Definition: ptp_types.h:129
uint16_t requestingSourcePortIdentity
Requesting Source Port Identity.
Definition: ptp_types.h:130
PTP flags structure.
Definition: ptp_types.h:62
bool TIME_TRACEABLE
Time Traceable.
Definition: ptp_types.h:70
bool PTP_LI_59
Leap Second (59)
Definition: ptp_types.h:73
bool PTP_ProfileSpecific_2
Profile Specific 2.
Definition: ptp_types.h:64
bool PTP_UTC_REASONABLE
UTC Reasonable.
Definition: ptp_types.h:72
bool PTP_UNICAST
Unicast.
Definition: ptp_types.h:66
bool PTP_LI_61
Leap Second (61)
Definition: ptp_types.h:74
bool FREQUENCY_TRACEABLE
Frequency Traceable.
Definition: ptp_types.h:69
bool PTP_TIMESCALE
Timescale.
Definition: ptp_types.h:71
bool PTP_SECURITY
Security.
Definition: ptp_types.h:63
bool PTP_ProfileSpecific_1
Profile Specific 1.
Definition: ptp_types.h:65
bool PTP_TWO_STEP
Two Step.
Definition: ptp_types.h:67
bool PTP_ALTERNATE_MASTER
Alternate Master.
Definition: ptp_types.h:68
Hardware clock state.
Definition: ptp_types.h:450
uint32_t addend
hardware clock addend value
Definition: ptp_types.h:452
PTP message header structure.
Definition: ptp_types.h:81
int8_t logMessagePeriod
Definition: ptp_types.h:122
uint8_t _r2
Definition: ptp_types.h:97
uint8_t versionPTP
PTP version.
Definition: ptp_types.h:87
uint8_t messageType
ID.
Definition: ptp_types.h:83
uint64_t clockIdentity
Clock Identity.
Definition: ptp_types.h:110
uint16_t sequenceID
Sequence ID.
Definition: ptp_types.h:116
uint16_t messageLength
Length.
Definition: ptp_types.h:91
uint16_t sourcePortID
Source Port ID.
Definition: ptp_types.h:113
PtpFlags flags
Flags.
Definition: ptp_types.h:100
uint8_t minorVersionPTP
Definition: ptp_types.h:88
uint32_t _r3
Definition: ptp_types.h:107
uint8_t control
Control.
Definition: ptp_types.h:119
uint64_t correction_ns
Correction nanoseconds.
Definition: ptp_types.h:103
uint8_t domainNumber
Domain.
Definition: ptp_types.h:94
uint32_t correction_subns
Correction subnanoseconds.
Definition: ptp_types.h:104
uint8_t transportSpecific
Transport Specific.
Definition: ptp_types.h:84
PTP master messaging state structure.
Definition: ptp_types.h:423
uint16_t announceSequenceID
Sequence ID of the next Announce message.
Definition: ptp_types.h:425
uint16_t syncSequenceID
Sequence ID of the coming Sync.
Definition: ptp_types.h:424
Network state.
Definition: ptp_types.h:461
TimestampI meanPathDelay
mean path delay
Definition: ptp_types.h:462
PTP P2P slave info structure;.
Definition: ptp_types.h:440
uint16_t reportCount
Number of times the slave had reported in.
Definition: ptp_types.h:443
uint16_t dropoutCntr
Dropout watchdog counter for resetting the state machine if the slave went silent.
Definition: ptp_types.h:444
uint64_t identity
The clock identity of the connected, operating P2P slave.
Definition: ptp_types.h:442
PtpP2PSlaveState state
Indicates that a slave is responding to our PDELAY_REQ messages.
Definition: ptp_types.h:441
PTP profile structure.
Definition: ptp_types.h:356
PtpDelayMechanism delayMechanism
delay mechanism
Definition: ptp_types.h:359
PtpTransportSpecific transportSpecific
majorSdoId ('transportSpecific')
Definition: ptp_types.h:358
int8_t logSyncPeriod
logarithm of the Sync transmission period (MASTER only)
Definition: ptp_types.h:361
int8_t logAnnouncePeriod
logarithm of the Announce period (MASTER only)
Definition: ptp_types.h:362
uint8_t flags
Flags associated with this profile.
Definition: ptp_types.h:364
int8_t logDelayReqPeriod
logarithm of (P)DelayReq period (SLAVE and MASTER)
Definition: ptp_types.h:360
PtpTransportType transportType
transport layer
Definition: ptp_types.h:357
uint8_t domainNumber
PTP domain number.
Definition: ptp_types.h:363
PTP profile additional data list element.
Definition: ptp_types.h:336
PtpMessageType msgType
Message type into which this extension should be inserted.
Definition: ptp_types.h:339
const void * data
Pointer to the data block.
Definition: ptp_types.h:337
struct _PtpProfileAdditionalData * next
Pointer to the next element of the list.
Definition: ptp_types.h:340
uint16_t size
Size of the data block.
Definition: ptp_types.h:338
PTP slave messaging state structure.
Definition: ptp_types.h:412
uint16_t syncPeriodMs
Sync interval in milliseconds.
Definition: ptp_types.h:417
uint16_t delay_reqSequenceID
last sequence IDs
Definition: ptp_types.h:413
int8_t logSyncPeriod
logarithm of Sync interval
Definition: ptp_types.h:416
PtpM2SState m2sState
Sync-FollowUp state.
Definition: ptp_types.h:415
uint16_t lastRespondedDelReqId
ID of the last (P)Delay_Req got responded.
Definition: ptp_types.h:414
Structure for statistics.
Definition: ptp_types.h:468
bool locked
is the PTP locked to defined limit?
Definition: ptp_types.h:470
double filtTimeErr
0.1Hz lowpass-filtered time error
Definition: ptp_types.h:469
PTP synchronization cycle data.
PTP TLV.
Definition: ptp_types.h:405
TimestampI ts
Timestamp.
Definition: ptp_types.h:187
uint32_t tag
unique transmit tag
Definition: ptp_types.h:191
PtpDelayMechanism tx_dm
transmit transport type
Definition: ptp_types.h:194
uint32_t ttl
transmit Time-to-Live in ticks
Definition: ptp_types.h:192
PtpMessageClass tx_mc
transmit message class
Definition: ptp_types.h:195
uint32_t size
Packet size.
Definition: ptp_types.h:188
TxCb * pTxCb
transmit callback function
Definition: ptp_types.h:193
Timestamp (signed)
Definition: timeutils.h:33
This module defines storage classes for timestamps and operations on time values.