2011-11-02 00:32:40 +08:00
|
|
|
/**
|
|
|
|
* @file ds.h
|
|
|
|
* @brief Data sets
|
|
|
|
* @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_DS_H
|
|
|
|
#define HAVE_DS_H
|
|
|
|
|
|
|
|
#include "ddt.h"
|
2013-03-19 00:08:21 +08:00
|
|
|
#include "fault.h"
|
2013-10-29 18:58:20 +08:00
|
|
|
#include "filter.h"
|
2015-03-26 23:32:14 +08:00
|
|
|
#include "tsproc.h"
|
2011-11-02 00:32:40 +08:00
|
|
|
|
|
|
|
/* clock data sets */
|
|
|
|
|
2012-12-01 04:52:37 +08:00
|
|
|
#define DDS_TWO_STEP_FLAG (1<<0)
|
|
|
|
#define DDS_SLAVE_ONLY (1<<1)
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
struct defaultDS {
|
2012-12-01 04:52:37 +08:00
|
|
|
UInteger8 flags;
|
|
|
|
UInteger8 reserved1;
|
2011-11-02 00:32:40 +08:00
|
|
|
UInteger16 numberPorts;
|
|
|
|
UInteger8 priority1;
|
|
|
|
struct ClockQuality clockQuality;
|
|
|
|
UInteger8 priority2;
|
|
|
|
struct ClockIdentity clockIdentity;
|
|
|
|
UInteger8 domainNumber;
|
2012-12-01 04:52:37 +08:00
|
|
|
UInteger8 reserved2;
|
|
|
|
} PACKED;
|
|
|
|
|
2013-02-04 06:01:51 +08:00
|
|
|
#define OUI_LEN 3
|
|
|
|
struct clock_description {
|
|
|
|
struct static_ptp_text productDescription;
|
|
|
|
struct static_ptp_text revisionData;
|
|
|
|
struct static_ptp_text userDescription;
|
|
|
|
Octet manufacturerIdentity[OUI_LEN];
|
|
|
|
};
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
struct dataset {
|
|
|
|
UInteger8 priority1;
|
|
|
|
struct ClockIdentity identity;
|
|
|
|
struct ClockQuality quality;
|
|
|
|
UInteger8 priority2;
|
|
|
|
UInteger16 stepsRemoved;
|
|
|
|
struct PortIdentity sender;
|
|
|
|
struct PortIdentity receiver;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct currentDS {
|
|
|
|
UInteger16 stepsRemoved;
|
|
|
|
TimeInterval offsetFromMaster;
|
|
|
|
TimeInterval meanPathDelay;
|
2012-08-22 13:28:34 +08:00
|
|
|
} PACKED;
|
2011-11-02 00:32:40 +08:00
|
|
|
|
|
|
|
struct parentDS {
|
|
|
|
struct PortIdentity parentPortIdentity;
|
2012-12-01 05:35:26 +08:00
|
|
|
UInteger8 parentStats;
|
|
|
|
UInteger8 reserved;
|
2011-11-02 00:32:40 +08:00
|
|
|
UInteger16 observedParentOffsetScaledLogVariance;
|
|
|
|
Integer32 observedParentClockPhaseChangeRate;
|
|
|
|
UInteger8 grandmasterPriority1;
|
|
|
|
struct ClockQuality grandmasterClockQuality;
|
|
|
|
UInteger8 grandmasterPriority2;
|
|
|
|
struct ClockIdentity grandmasterIdentity;
|
2012-12-01 05:35:26 +08:00
|
|
|
} PACKED;
|
|
|
|
|
|
|
|
struct parent_ds {
|
|
|
|
struct parentDS pds;
|
2012-08-07 15:20:55 +08:00
|
|
|
struct ClockIdentity *ptl;
|
|
|
|
unsigned int path_length;
|
2011-11-02 00:32:40 +08:00
|
|
|
};
|
|
|
|
|
2015-09-17 18:04:28 +08:00
|
|
|
#define CURRENT_UTC_OFFSET 36 /* 1 Jul 2015 */
|
2011-11-02 00:32:40 +08:00
|
|
|
#define INTERNAL_OSCILLATOR 0xA0
|
|
|
|
|
|
|
|
struct timePropertiesDS {
|
|
|
|
Integer16 currentUtcOffset;
|
2012-12-02 18:24:31 +08:00
|
|
|
UInteger8 flags;
|
2011-11-02 00:32:40 +08:00
|
|
|
Enumeration8 timeSource;
|
2012-12-02 18:24:31 +08:00
|
|
|
} PACKED;
|
2011-11-02 00:32:40 +08:00
|
|
|
|
2012-12-03 03:34:44 +08:00
|
|
|
struct portDS {
|
|
|
|
struct PortIdentity portIdentity;
|
|
|
|
Enumeration8 portState;
|
|
|
|
Integer8 logMinDelayReqInterval;
|
|
|
|
TimeInterval peerMeanPathDelay;
|
|
|
|
Integer8 logAnnounceInterval;
|
|
|
|
UInteger8 announceReceiptTimeout;
|
|
|
|
Integer8 logSyncInterval;
|
|
|
|
Enumeration8 delayMechanism;
|
|
|
|
Integer8 logMinPdelayReqInterval;
|
|
|
|
UInteger8 versionNumber;
|
|
|
|
} PACKED;
|
|
|
|
|
2013-01-30 23:28:54 +08:00
|
|
|
#define FRI_ASAP (-128)
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
#endif
|