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"
|
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];
|
|
|
|
};
|
|
|
|
|
2012-12-01 04:52:37 +08:00
|
|
|
struct default_ds {
|
|
|
|
struct defaultDS dds;
|
|
|
|
int free_running;
|
|
|
|
int freq_est_interval; /*log seconds*/
|
2013-12-02 03:32:05 +08:00
|
|
|
int grand_master_capable; /*802.1AS only*/
|
2013-02-09 17:45:30 +08:00
|
|
|
int stats_interval; /*log seconds*/
|
2013-03-08 00:27:33 +08:00
|
|
|
int kernel_leap;
|
2013-10-23 00:57:15 +08:00
|
|
|
int sanity_freq_limit;
|
2013-07-06 02:43:45 +08:00
|
|
|
int time_source;
|
2013-02-04 06:01:51 +08:00
|
|
|
struct clock_description clock_desc;
|
2013-10-29 18:58:20 +08:00
|
|
|
enum filter_type delay_filter;
|
|
|
|
int delay_filter_length;
|
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
|
|
|
};
|
|
|
|
|
2012-08-27 00:48:54 +08:00
|
|
|
#define CURRENT_UTC_OFFSET 35 /* 1 Jul 2012 */
|
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-12-31 16:14:18 +08:00
|
|
|
struct port_defaults {
|
2012-12-10 21:39:08 +08:00
|
|
|
Integer64 asymmetry;
|
2011-12-31 16:14:18 +08:00
|
|
|
Integer8 logAnnounceInterval;
|
|
|
|
Integer8 logSyncInterval;
|
|
|
|
Integer8 logMinDelayReqInterval;
|
2012-07-28 04:04:00 +08:00
|
|
|
Integer8 logMinPdelayReqInterval;
|
2011-12-31 16:14:18 +08:00
|
|
|
UInteger8 announceReceiptTimeout;
|
2013-08-26 20:36:49 +08:00
|
|
|
UInteger8 syncReceiptTimeout;
|
2012-07-27 16:51:31 +08:00
|
|
|
UInteger8 transportSpecific;
|
2012-08-07 15:16:19 +08:00
|
|
|
int path_trace_enabled;
|
2012-08-09 02:16:47 +08:00
|
|
|
int follow_up_info;
|
2012-08-31 21:54:26 +08:00
|
|
|
int freq_est_interval; /*log seconds*/
|
2013-03-19 00:08:21 +08:00
|
|
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
2013-03-14 03:16:59 +08:00
|
|
|
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
2011-12-31 16:14:18 +08:00
|
|
|
};
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
#endif
|