libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
proc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later
2  SPDX-FileCopyrightText: Copyright © 2021 Erez Geva <ErezGeva2@gmail.com> */
3 
12 #ifndef __PTPMGMT_C_PROC_H
13 #define __PTPMGMT_C_PROC_H
14 
15 #include <stdlib.h>
16 #include "c/types.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
24  uint16_t clockType;
27  uint8_t *physicalAddress;
34 };
38 };
40 static const uint16_t PTPMGMT_INITIALIZE_EVENT = 0x0000;
43  uint16_t initializationKey;
44 };
49 };
57  uint8_t flags;
64 };
72 };
80  uint8_t flags;
92 };
105  uint8_t flags;
107 };
136 };
140 };
144 };
148 };
155  uint8_t flags;
156 };
161 };
167 };
172 };
181 };
185 };
189 };
199  uint8_t flags;
200 };
208  uint8_t flags;
209 };
216  uint8_t flags;
218 };
225  uint8_t flags;
226 };
230 };
237  uint8_t flags;
238 };
247 };
256 };
261 };
267 };
274  uint8_t flags;
275 };
281 };
288  uint8_t flags;
294 };
302  uint8_t flags;
303 };
309 };
313 };
320 };
328  uint8_t flags;
333 };
339 };
349 };
353 };
360 };
367  uint8_t flags;
368 };
375  uint8_t flags;
376 };
383  uint8_t flags;
384 };
391  uint8_t flags;
393 };
395 static const float_nanoseconds PTPMGMT_P41 = 1ULL << 41;
400  int64_t master_offset;
401  int64_t ingress_time;
409  uint16_t nanoseconds_msb;
411  uint64_t nanoseconds_lsb;
416 };
432  uint8_t flags;
434 };
442 };
444 #define LIBPTPMGMT_EVENT_BITMASK_CNT (64)
446 static const int PTPMGMT_NOTIFY_PORT_STATE = 0;
448 static const int PTPMGMT_NOTIFY_TIME_SYNC = 1;
450 static const int PTPMGMT_NOTIFY_PARENT_DATA_SET = 2;
452 static const int PTPMGMT_NOTIFY_CMLDS = 3;
457  uint16_t duration;
459 };
472  int event);
485  int event);
495 };
497 #define LIBPTPMGMT_MAX_MESSAGE_TYPES (16)
499 static const int PTPMGMT_STAT_SYNC = 0;
501 static const int PTPMGMT_STAT_DELAY_REQ = 1;
503 static const int PTPMGMT_STAT_PDELAY_REQ = 2;
505 static const int PTPMGMT_STAT_PDELAY_RESP = 3;
507 static const int PTPMGMT_STAT_FOLLOW_UP = 8;
509 static const int PTPMGMT_STAT_DELAY_RESP = 9;
511 static const int PTPMGMT_STAT_PDELAY_RESP_FOLLOW_UP = 10;
513 static const int PTPMGMT_STAT_ANNOUNCE = 11;
515 static const int PTPMGMT_STAT_SIGNALING = 12;
517 static const int PTPMGMT_STAT_MANAGEMENT = 13;
527 };
529 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_FALSE = 0;
531 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_TRUE = 1;
533 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_DONTCARE = 0xff;
544  uint8_t val;
545 };
551  uint64_t announce_timeout;
552  uint64_t sync_timeout;
553  uint64_t delay_timeout;
562  uint64_t sync_mismatch;
563  uint64_t followup_mismatch;
564 };
572 };
580 };
591 };
599  uint32_t as_capable;
600 };
601 
602 #ifdef __cplusplus
603 }
604 #endif
605 
606 #endif /* __PTPMGMT_C_PROC_H */
void ptpmgmt_clearEvent_lnp(struct ptpmgmt_SUBSCRIBE_EVENTS_NP_t *tlv, int event)
#define LIBPTPMGMT_EVENT_BITMASK_CNT
Definition: proc.h:444
#define LIBPTPMGMT_MAX_MESSAGE_TYPES
Definition: proc.h:497
void ptpmgmt_setEvent_lnp(struct ptpmgmt_SUBSCRIBE_EVENTS_NP_t *tlv, int event)
void ptpmgmt_clearAll_lnp(struct ptpmgmt_SUBSCRIBE_EVENTS_NP_t *tlv)
bool ptpmgmt_getEvent_lnp(const struct ptpmgmt_SUBSCRIBE_EVENTS_NP_t *tlv, int event)
Types, enumerators, and structers used by C interface to PTP management messages.
ptpmgmt_linuxptpTimeStamp_e
Definition: types.h:355
ptpmgmt_linuxptpPowerProfileVersion_e
Definition: types.h:371
ptpmgmt_portState_e
Definition: types.h:292
ptpmgmt_delayMechanism_e
Definition: types.h:307
ptpmgmt_timeSource_e
Definition: types.h:279
ptpmgmt_clockAccuracy_e
Definition: types.h:237
UInteger16_t maxTableSize
Definition: proc.h:280
uint8_t flags
Definition: proc.h:274
Definition: proc.h:263
struct ptpmgmt_AcceptableMaster_t * list
Definition: proc.h:266
Integer16_t actualTableSize
Definition: proc.h:264
Definition: proc.h:283
uint8_t flags
Definition: proc.h:288
Integer8_t logAlternateMulticastSyncInterval
Definition: proc.h:291
UInteger8_t numberOfAlternateMasters
Definition: proc.h:293
UInteger8_t keyField
Definition: proc.h:297
uint8_t flags
Definition: proc.h:302
UInteger8_t maxKey
Definition: proc.h:312
struct ptpmgmt_PTPText_t displayName
Definition: proc.h:308
UInteger8_t keyField
Definition: proc.h:306
Integer32_t currentOffset
Definition: proc.h:317
UInteger8_t keyField
Definition: proc.h:316
UInteger48_t timeOfNextJump
Definition: proc.h:319
Integer32_t jumpSeconds
Definition: proc.h:318
UInteger8_t announceReceiptTimeout
Definition: proc.h:166
Definition: types.h:459
Definition: proc.h:187
enum ptpmgmt_clockAccuracy_e clockAccuracy
Definition: proc.h:188
Definition: proc.h:23
struct ptpmgmt_PTPText_t userDescription
Definition: proc.h:32
Octet_t profileIdentity[6]
Definition: proc.h:33
struct ptpmgmt_PTPText_t productDescription
Definition: proc.h:30
struct ptpmgmt_PTPText_t physicalLayerProtocol
Definition: proc.h:25
uint16_t clockType
Definition: proc.h:24
Octet_t manufacturerIdentity[3]
Definition: proc.h:29
UInteger16_t physicalAddressLength
Definition: proc.h:26
struct ptpmgmt_PortAddress_t protocolAddress
Definition: proc.h:28
uint8_t * physicalAddress
Definition: proc.h:27
struct ptpmgmt_PTPText_t revisionData
Definition: proc.h:31
Definition: proc.h:595
uint32_t as_capable
Definition: proc.h:599
Integer32_t scaledNeighborRateRatio
Definition: proc.h:598
struct ptpmgmt_TimeInterval_t meanLinkDelay
Definition: proc.h:596
Definition: proc.h:66
UInteger16_t stepsRemoved
Definition: proc.h:67
struct ptpmgmt_TimeInterval_t offsetFromMaster
Definition: proc.h:69
struct ptpmgmt_TimeInterval_t meanPathDelay
Definition: proc.h:71
Definition: types.h:412
Definition: types.h:433
Definition: proc.h:51
struct ptpmgmt_ClockQuality_t clockQuality
Definition: proc.h:60
UInteger16_t numberPorts
Definition: proc.h:58
UInteger8_t priority1
Definition: proc.h:59
UInteger8_t priority2
Definition: proc.h:61
struct ptpmgmt_ClockIdentity_t clockIdentity
Definition: proc.h:62
UInteger8_t domainNumber
Definition: proc.h:63
uint8_t flags
Definition: proc.h:57
Definition: proc.h:355
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:359
Definition: proc.h:146
UInteger8_t domainNumber
Definition: proc.h:147
uint8_t flags
Definition: proc.h:367
enum ptpmgmt_portState_e desiredState
Definition: proc.h:392
uint8_t flags
Definition: proc.h:391
Definition: proc.h:46
UInteger16_t numberOfFaultRecords
Definition: proc.h:47
struct ptpmgmt_FaultRecord_t * faultRecords
Definition: proc.h:48
Definition: types.h:450
UInteger8_t actualTableSize
Definition: proc.h:244
struct ptpmgmt_PortAddress_t * PortAddress
Definition: proc.h:246
Integer8_t logQueryInterval
Definition: proc.h:243
Definition: proc.h:420
uint8_t flags
Definition: proc.h:432
struct ptpmgmt_ClockQuality_t clockQuality
Definition: proc.h:421
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:433
Integer16_t currentUtcOffset
Definition: proc.h:422
Definition: proc.h:378
uint8_t flags
Definition: proc.h:383
Definition: proc.h:42
uint16_t initializationKey
Definition: proc.h:43
Definition: proc.h:158
Integer8_t logAnnounceInterval
Definition: proc.h:160
Integer8_t logMinPdelayReqInterval
Definition: proc.h:338
Definition: proc.h:169
Integer8_t logSyncInterval
Definition: proc.h:171
Definition: types.h:566
Definition: proc.h:370
uint8_t flags
Definition: proc.h:375
Definition: proc.h:74
uint8_t flags
Definition: proc.h:80
UInteger16_t observedParentOffsetScaledLogVariance
Definition: proc.h:83
UInteger8_t grandmasterPriority1
Definition: proc.h:87
struct ptpmgmt_ClockIdentity_t grandmasterIdentity
Definition: proc.h:91
struct ptpmgmt_ClockQuality_t grandmasterClockQuality
Definition: proc.h:89
Integer32_t observedParentClockPhaseChangeRate
Definition: proc.h:86
UInteger8_t grandmasterPriority2
Definition: proc.h:90
struct ptpmgmt_PortIdentity_t parentPortIdentity
Definition: proc.h:75
Definition: proc.h:232
uint8_t flags
Definition: proc.h:237
Definition: proc.h:228
struct ptpmgmt_ClockIdentity_t * pathSequence
Definition: proc.h:229
Definition: proc.h:438
UInteger32_t neighborPropDelayThresh
Definition: proc.h:440
Integer32_t asCapable
Definition: proc.h:441
Definition: proc.h:109
struct ptpmgmt_TimeInterval_t peerMeanPathDelay
Definition: proc.h:115
Integer8_t logMinDelayReqInterval
Definition: proc.h:114
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:110
Integer8_t logMinPdelayReqInterval
Definition: proc.h:129
enum ptpmgmt_portState_e portState
Definition: proc.h:111
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:126
Integer8_t logSyncInterval
Definition: proc.h:122
UInteger8_t announceReceiptTimeout
Definition: proc.h:120
Nibble_t versionNumber
Definition: proc.h:135
Integer8_t logAnnounceInterval
Definition: proc.h:117
Definition: proc.h:576
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:577
UInteger8_t flags
Definition: proc.h:579
Integer32_t phc_index
Definition: proc.h:578
Definition: proc.h:489
struct ptpmgmt_PTPText_t interface
Definition: proc.h:494
enum ptpmgmt_portState_e portState
Definition: proc.h:491
enum ptpmgmt_linuxptpTimeStamp_e timestamping
Definition: proc.h:493
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:490
Definition: proc.h:549
uint64_t followup_mismatch
Definition: proc.h:563
uint64_t master_announce_timeout
Definition: proc.h:559
uint64_t unicast_service_timeout
Definition: proc.h:555
uint64_t sync_timeout
Definition: proc.h:552
uint64_t sync_mismatch
Definition: proc.h:562
uint64_t announce_timeout
Definition: proc.h:551
uint64_t unicast_request_timeout
Definition: proc.h:557
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:550
uint64_t qualification_timeout
Definition: proc.h:561
uint64_t delay_timeout
Definition: proc.h:553
uint64_t master_sync_timeout
Definition: proc.h:560
Definition: proc.h:521
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:522
uint64_t txMsgType[LIBPTPMGMT_MAX_MESSAGE_TYPES]
Definition: proc.h:526
uint64_t rxMsgType[LIBPTPMGMT_MAX_MESSAGE_TYPES]
Definition: proc.h:524
UInteger32_t networkTimeInaccuracy
Definition: proc.h:589
UInteger32_t totalTimeInaccuracy
Definition: proc.h:590
UInteger16_t grandmasterID
Definition: proc.h:587
enum ptpmgmt_linuxptpPowerProfileVersion_e version
Definition: proc.h:586
UInteger32_t grandmasterTimeInaccuracy
Definition: proc.h:588
Definition: proc.h:351
UInteger8_t primaryDomain
Definition: proc.h:352
Definition: proc.h:138
UInteger8_t priority1
Definition: proc.h:139
Definition: proc.h:142
UInteger8_t priority2
Definition: proc.h:143
Definition: types.h:439
Definition: types.h:421
Definition: types.h:416
Definition: proc.h:150
uint8_t flags
Definition: proc.h:155
Definition: proc.h:456
uint8_t bitmask[LIBPTPMGMT_EVENT_BITMASK_CNT]
Definition: proc.h:458
uint16_t duration
Definition: proc.h:457
uint8_t val
Definition: proc.h:544
Definition: proc.h:211
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:217
uint8_t flags
Definition: proc.h:216
Integer16_t currentUtcOffset
Definition: proc.h:95
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:106
uint8_t flags
Definition: proc.h:105
Definition: proc.h:399
Integer32_t gmPresent
Definition: proc.h:414
uint16_t fractional_nanoseconds
Definition: proc.h:413
uint16_t nanoseconds_msb
Definition: proc.h:409
Integer32_t scaledLastGmPhaseChange
Definition: proc.h:405
int64_t master_offset
Definition: proc.h:400
uint64_t nanoseconds_lsb
Definition: proc.h:411
Integer32_t cumulativeScaledRateOffset
Definition: proc.h:403
UInteger16_t gmTimeBaseIndicator
Definition: proc.h:407
struct ptpmgmt_ClockIdentity_t gmIdentity
Definition: proc.h:415
int64_t ingress_time
Definition: proc.h:401
Definition: proc.h:183
struct ptpmgmt_Timestamp_t currentTime
Definition: proc.h:184
Definition: proc.h:202
uint8_t flags
Definition: proc.h:208
UInteger8_t primaryDomain
Definition: proc.h:348
UInteger16_t numberPorts
Definition: proc.h:343
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:347
struct ptpmgmt_ClockIdentity_t clockIdentity
Definition: proc.h:342
struct ptpmgmt_TimeInterval_t peerMeanPathDelay
Definition: proc.h:332
uint8_t flags
Definition: proc.h:328
Integer8_t logMinPdelayReqInterval
Definition: proc.h:331
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:323
Definition: types.h:403
Definition: types.h:407
UInteger16_t maxTableSize
Definition: proc.h:260
Definition: proc.h:568
Integer16_t actualTableSize
Definition: proc.h:569
struct ptpmgmt_LinuxptpUnicastMaster_t * unicastMasters
Definition: proc.h:571
Definition: proc.h:249
struct ptpmgmt_PortAddress_t * PortAddress
Definition: proc.h:255
Integer8_t logQueryInterval
Definition: proc.h:252
UInteger16_t actualTableSize
Definition: proc.h:253
uint8_t flags
Definition: proc.h:225
Definition: proc.h:36
struct ptpmgmt_PTPText_t userDescription
Definition: proc.h:37
Definition: proc.h:191
uint8_t flags
Definition: proc.h:199
Integer16_t currentUtcOffset
Definition: proc.h:192
Definition: proc.h:174
Nibble_t versionNumber
Definition: proc.h:180
uint16_t UInteger16_t
Definition: types.h:40
uint64_t UInteger48_t
Definition: types.h:44
uint8_t Nibble_t
Definition: types.h:36
uint8_t UInteger8_t
Definition: types.h:38
long double float_nanoseconds
Definition: types.h:68
uint32_t UInteger32_t
Definition: types.h:42
int8_t Integer8_t
Definition: types.h:50
uint8_t Octet_t
Definition: types.h:62
int16_t Integer16_t
Definition: types.h:52
int32_t Integer32_t
Definition: types.h:54