libptpmgmt  1.3
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 
20  uint16_t clockType;
23  uint8_t *physicalAddress;
30 };
34 };
36 static const uint16_t PTPMGMT_INITIALIZE_EVENT = 0x0000;
39  uint16_t initializationKey;
40 };
45 };
53  uint8_t flags;
60 };
68 };
76  uint8_t flags;
88 };
101  uint8_t flags;
103 };
132 };
136 };
140 };
144 };
151  uint8_t flags;
152 };
157 };
163 };
168 };
177 };
181 };
185 };
195  uint8_t flags;
196 };
204  uint8_t flags;
205 };
212  uint8_t flags;
214 };
221  uint8_t flags;
222 };
226 };
233  uint8_t flags;
234 };
243 };
252 };
257 };
263 };
270  uint8_t flags;
271 };
277 };
284  uint8_t flags;
290 };
298  uint8_t flags;
299 };
305 };
309 };
316 };
324  uint8_t flags;
329 };
335 };
345 };
349 };
356 };
363  uint8_t flags;
364 };
371  uint8_t flags;
372 };
379  uint8_t flags;
380 };
387  uint8_t flags;
389 };
391 static const float_nanoseconds PTPMGMT_P41 = 1ULL << 41;
396  int64_t master_offset;
397  int64_t ingress_time;
405  uint16_t nanoseconds_msb;
407  uint64_t nanoseconds_lsb;
412 };
428  uint8_t flags;
430 };
438 };
440 #define LIBPTPMGMT_EVENT_BITMASK_CNT (64)
442 static const int PTPMGMT_NOTIFY_PORT_STATE = 0;
444 static const int PTPMGMT_NOTIFY_TIME_SYNC = 1;
446 static const int PTPMGMT_NOTIFY_PARENT_DATA_SET = 2;
448 static const int PTPMGMT_NOTIFY_CMLDS = 3;
453  uint16_t duration;
455 };
468  int event);
481  int event);
491 };
493 #define LIBPTPMGMT_MAX_MESSAGE_TYPES (16)
495 static const int PTPMGMT_STAT_SYNC = 0;
497 static const int PTPMGMT_STAT_DELAY_REQ = 1;
499 static const int PTPMGMT_STAT_PDELAY_REQ = 2;
501 static const int PTPMGMT_STAT_PDELAY_RESP = 3;
503 static const int PTPMGMT_STAT_FOLLOW_UP = 8;
505 static const int PTPMGMT_STAT_DELAY_RESP = 9;
507 static const int PTPMGMT_STAT_PDELAY_RESP_FOLLOW_UP = 10;
509 static const int PTPMGMT_STAT_ANNOUNCE = 11;
511 static const int PTPMGMT_STAT_SIGNALING = 12;
513 static const int PTPMGMT_STAT_MANAGEMENT = 13;
523 };
525 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_FALSE = 0;
527 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_TRUE = 1;
529 static const uint8_t PTPMGMT_SYNC_UNCERTAIN_DONTCARE = 0xff;
540  uint8_t val;
541 };
547  uint64_t announce_timeout;
548  uint64_t sync_timeout;
549  uint64_t delay_timeout;
558  uint64_t sync_mismatch;
559  uint64_t followup_mismatch;
560 };
568 };
576 };
587 };
595  uint32_t as_capable;
596 };
597 
598 #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:440
#define LIBPTPMGMT_MAX_MESSAGE_TYPES
Definition: proc.h:493
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:351
ptpmgmt_linuxptpPowerProfileVersion_e
Definition: types.h:367
ptpmgmt_portState_e
Definition: types.h:288
ptpmgmt_delayMechanism_e
Definition: types.h:303
ptpmgmt_timeSource_e
Definition: types.h:275
ptpmgmt_clockAccuracy_e
Definition: types.h:233
UInteger16_t maxTableSize
Definition: proc.h:276
uint8_t flags
Definition: proc.h:270
Definition: proc.h:259
struct ptpmgmt_AcceptableMaster_t * list
Definition: proc.h:262
Integer16_t actualTableSize
Definition: proc.h:260
Definition: proc.h:279
uint8_t flags
Definition: proc.h:284
Integer8_t logAlternateMulticastSyncInterval
Definition: proc.h:287
UInteger8_t numberOfAlternateMasters
Definition: proc.h:289
UInteger8_t keyField
Definition: proc.h:293
uint8_t flags
Definition: proc.h:298
UInteger8_t maxKey
Definition: proc.h:308
struct ptpmgmt_PTPText_t displayName
Definition: proc.h:304
UInteger8_t keyField
Definition: proc.h:302
Integer32_t currentOffset
Definition: proc.h:313
UInteger8_t keyField
Definition: proc.h:312
UInteger48_t timeOfNextJump
Definition: proc.h:315
Integer32_t jumpSeconds
Definition: proc.h:314
UInteger8_t announceReceiptTimeout
Definition: proc.h:162
Definition: types.h:455
Definition: proc.h:183
enum ptpmgmt_clockAccuracy_e clockAccuracy
Definition: proc.h:184
Definition: proc.h:19
struct ptpmgmt_PTPText_t userDescription
Definition: proc.h:28
Octet_t profileIdentity[6]
Definition: proc.h:29
struct ptpmgmt_PTPText_t productDescription
Definition: proc.h:26
struct ptpmgmt_PTPText_t physicalLayerProtocol
Definition: proc.h:21
uint16_t clockType
Definition: proc.h:20
Octet_t manufacturerIdentity[3]
Definition: proc.h:25
UInteger16_t physicalAddressLength
Definition: proc.h:22
struct ptpmgmt_PortAddress_t protocolAddress
Definition: proc.h:24
uint8_t * physicalAddress
Definition: proc.h:23
struct ptpmgmt_PTPText_t revisionData
Definition: proc.h:27
Definition: proc.h:591
uint32_t as_capable
Definition: proc.h:595
Integer32_t scaledNeighborRateRatio
Definition: proc.h:594
struct ptpmgmt_TimeInterval_t meanLinkDelay
Definition: proc.h:592
Definition: proc.h:62
UInteger16_t stepsRemoved
Definition: proc.h:63
struct ptpmgmt_TimeInterval_t offsetFromMaster
Definition: proc.h:65
struct ptpmgmt_TimeInterval_t meanPathDelay
Definition: proc.h:67
Definition: types.h:408
Definition: types.h:429
Definition: proc.h:47
struct ptpmgmt_ClockQuality_t clockQuality
Definition: proc.h:56
UInteger16_t numberPorts
Definition: proc.h:54
UInteger8_t priority1
Definition: proc.h:55
UInteger8_t priority2
Definition: proc.h:57
struct ptpmgmt_ClockIdentity_t clockIdentity
Definition: proc.h:58
UInteger8_t domainNumber
Definition: proc.h:59
uint8_t flags
Definition: proc.h:53
Definition: proc.h:351
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:355
Definition: proc.h:142
UInteger8_t domainNumber
Definition: proc.h:143
uint8_t flags
Definition: proc.h:363
enum ptpmgmt_portState_e desiredState
Definition: proc.h:388
uint8_t flags
Definition: proc.h:387
Definition: proc.h:42
UInteger16_t numberOfFaultRecords
Definition: proc.h:43
struct ptpmgmt_FaultRecord_t * faultRecords
Definition: proc.h:44
Definition: types.h:446
UInteger8_t actualTableSize
Definition: proc.h:240
struct ptpmgmt_PortAddress_t * PortAddress
Definition: proc.h:242
Integer8_t logQueryInterval
Definition: proc.h:239
Definition: proc.h:416
uint8_t flags
Definition: proc.h:428
struct ptpmgmt_ClockQuality_t clockQuality
Definition: proc.h:417
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:429
Integer16_t currentUtcOffset
Definition: proc.h:418
Definition: proc.h:374
uint8_t flags
Definition: proc.h:379
Definition: proc.h:38
uint16_t initializationKey
Definition: proc.h:39
Definition: proc.h:154
Integer8_t logAnnounceInterval
Definition: proc.h:156
Integer8_t logMinPdelayReqInterval
Definition: proc.h:334
Definition: proc.h:165
Integer8_t logSyncInterval
Definition: proc.h:167
Definition: types.h:562
Definition: proc.h:366
uint8_t flags
Definition: proc.h:371
Definition: proc.h:70
uint8_t flags
Definition: proc.h:76
UInteger16_t observedParentOffsetScaledLogVariance
Definition: proc.h:79
UInteger8_t grandmasterPriority1
Definition: proc.h:83
struct ptpmgmt_ClockIdentity_t grandmasterIdentity
Definition: proc.h:87
struct ptpmgmt_ClockQuality_t grandmasterClockQuality
Definition: proc.h:85
Integer32_t observedParentClockPhaseChangeRate
Definition: proc.h:82
UInteger8_t grandmasterPriority2
Definition: proc.h:86
struct ptpmgmt_PortIdentity_t parentPortIdentity
Definition: proc.h:71
Definition: proc.h:228
uint8_t flags
Definition: proc.h:233
Definition: proc.h:224
struct ptpmgmt_ClockIdentity_t * pathSequence
Definition: proc.h:225
Definition: proc.h:434
UInteger32_t neighborPropDelayThresh
Definition: proc.h:436
Integer32_t asCapable
Definition: proc.h:437
Definition: proc.h:105
struct ptpmgmt_TimeInterval_t peerMeanPathDelay
Definition: proc.h:111
Integer8_t logMinDelayReqInterval
Definition: proc.h:110
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:106
Integer8_t logMinPdelayReqInterval
Definition: proc.h:125
enum ptpmgmt_portState_e portState
Definition: proc.h:107
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:122
Integer8_t logSyncInterval
Definition: proc.h:118
UInteger8_t announceReceiptTimeout
Definition: proc.h:116
Nibble_t versionNumber
Definition: proc.h:131
Integer8_t logAnnounceInterval
Definition: proc.h:113
Definition: proc.h:572
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:573
UInteger8_t flags
Definition: proc.h:575
Integer32_t phc_index
Definition: proc.h:574
Definition: proc.h:485
struct ptpmgmt_PTPText_t interface
Definition: proc.h:490
enum ptpmgmt_portState_e portState
Definition: proc.h:487
enum ptpmgmt_linuxptpTimeStamp_e timestamping
Definition: proc.h:489
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:486
Definition: proc.h:545
uint64_t followup_mismatch
Definition: proc.h:559
uint64_t master_announce_timeout
Definition: proc.h:555
uint64_t unicast_service_timeout
Definition: proc.h:551
uint64_t sync_timeout
Definition: proc.h:548
uint64_t sync_mismatch
Definition: proc.h:558
uint64_t announce_timeout
Definition: proc.h:547
uint64_t unicast_request_timeout
Definition: proc.h:553
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:546
uint64_t qualification_timeout
Definition: proc.h:557
uint64_t delay_timeout
Definition: proc.h:549
uint64_t master_sync_timeout
Definition: proc.h:556
Definition: proc.h:517
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:518
uint64_t txMsgType[LIBPTPMGMT_MAX_MESSAGE_TYPES]
Definition: proc.h:522
uint64_t rxMsgType[LIBPTPMGMT_MAX_MESSAGE_TYPES]
Definition: proc.h:520
UInteger32_t networkTimeInaccuracy
Definition: proc.h:585
UInteger32_t totalTimeInaccuracy
Definition: proc.h:586
UInteger16_t grandmasterID
Definition: proc.h:583
enum ptpmgmt_linuxptpPowerProfileVersion_e version
Definition: proc.h:582
UInteger32_t grandmasterTimeInaccuracy
Definition: proc.h:584
Definition: proc.h:347
UInteger8_t primaryDomain
Definition: proc.h:348
Definition: proc.h:134
UInteger8_t priority1
Definition: proc.h:135
Definition: proc.h:138
UInteger8_t priority2
Definition: proc.h:139
Definition: types.h:435
Definition: types.h:417
Definition: types.h:412
Definition: proc.h:146
uint8_t flags
Definition: proc.h:151
Definition: proc.h:452
uint8_t bitmask[LIBPTPMGMT_EVENT_BITMASK_CNT]
Definition: proc.h:454
uint16_t duration
Definition: proc.h:453
uint8_t val
Definition: proc.h:540
Definition: proc.h:207
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:213
uint8_t flags
Definition: proc.h:212
Integer16_t currentUtcOffset
Definition: proc.h:91
enum ptpmgmt_timeSource_e timeSource
Definition: proc.h:102
uint8_t flags
Definition: proc.h:101
Definition: proc.h:395
Integer32_t gmPresent
Definition: proc.h:410
uint16_t fractional_nanoseconds
Definition: proc.h:409
uint16_t nanoseconds_msb
Definition: proc.h:405
Integer32_t scaledLastGmPhaseChange
Definition: proc.h:401
int64_t master_offset
Definition: proc.h:396
uint64_t nanoseconds_lsb
Definition: proc.h:407
Integer32_t cumulativeScaledRateOffset
Definition: proc.h:399
UInteger16_t gmTimeBaseIndicator
Definition: proc.h:403
struct ptpmgmt_ClockIdentity_t gmIdentity
Definition: proc.h:411
int64_t ingress_time
Definition: proc.h:397
Definition: proc.h:179
struct ptpmgmt_Timestamp_t currentTime
Definition: proc.h:180
Definition: proc.h:198
uint8_t flags
Definition: proc.h:204
UInteger8_t primaryDomain
Definition: proc.h:344
UInteger16_t numberPorts
Definition: proc.h:339
enum ptpmgmt_delayMechanism_e delayMechanism
Definition: proc.h:343
struct ptpmgmt_ClockIdentity_t clockIdentity
Definition: proc.h:338
struct ptpmgmt_TimeInterval_t peerMeanPathDelay
Definition: proc.h:328
uint8_t flags
Definition: proc.h:324
Integer8_t logMinPdelayReqInterval
Definition: proc.h:327
struct ptpmgmt_PortIdentity_t portIdentity
Definition: proc.h:319
Definition: types.h:399
Definition: types.h:403
UInteger16_t maxTableSize
Definition: proc.h:256
Definition: proc.h:564
Integer16_t actualTableSize
Definition: proc.h:565
struct ptpmgmt_LinuxptpUnicastMaster_t * unicastMasters
Definition: proc.h:567
Definition: proc.h:245
struct ptpmgmt_PortAddress_t * PortAddress
Definition: proc.h:251
Integer8_t logQueryInterval
Definition: proc.h:248
UInteger16_t actualTableSize
Definition: proc.h:249
uint8_t flags
Definition: proc.h:221
Definition: proc.h:32
struct ptpmgmt_PTPText_t userDescription
Definition: proc.h:33
Definition: proc.h:187
uint8_t flags
Definition: proc.h:195
Integer16_t currentUtcOffset
Definition: proc.h:188
Definition: proc.h:170
Nibble_t versionNumber
Definition: proc.h:176
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