Blame ds.h

Packit 9c3e7e
/**
Packit 9c3e7e
 * @file ds.h
Packit 9c3e7e
 * @brief Data sets
Packit 9c3e7e
 * @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
Packit 9c3e7e
 *
Packit 9c3e7e
 * This program is free software; you can redistribute it and/or modify
Packit 9c3e7e
 * it under the terms of the GNU General Public License as published by
Packit 9c3e7e
 * the Free Software Foundation; either version 2 of the License, or
Packit 9c3e7e
 * (at your option) any later version.
Packit 9c3e7e
 *
Packit 9c3e7e
 * This program is distributed in the hope that it will be useful,
Packit 9c3e7e
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 9c3e7e
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 9c3e7e
 * GNU General Public License for more details.
Packit 9c3e7e
 *
Packit 9c3e7e
 * You should have received a copy of the GNU General Public License along
Packit 9c3e7e
 * with this program; if not, write to the Free Software Foundation, Inc.,
Packit 9c3e7e
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit 9c3e7e
 */
Packit 9c3e7e
#ifndef HAVE_DS_H
Packit 9c3e7e
#define HAVE_DS_H
Packit 9c3e7e
Packit 9c3e7e
#include "ddt.h"
Packit 9c3e7e
#include "fault.h"
Packit 9c3e7e
#include "filter.h"
Packit 9c3e7e
#include "tsproc.h"
Packit 9c3e7e
Packit 9c3e7e
/* clock data sets */
Packit 9c3e7e
Packit 9c3e7e
#define DDS_TWO_STEP_FLAG (1<<0)
Packit 9c3e7e
#define DDS_SLAVE_ONLY    (1<<1)
Packit 9c3e7e
Packit 9c3e7e
struct defaultDS {
Packit 9c3e7e
	UInteger8            flags;
Packit 9c3e7e
	UInteger8            reserved1;
Packit 9c3e7e
	UInteger16           numberPorts;
Packit 9c3e7e
	UInteger8            priority1;
Packit 9c3e7e
	struct ClockQuality  clockQuality;
Packit 9c3e7e
	UInteger8            priority2;
Packit 9c3e7e
	struct ClockIdentity clockIdentity;
Packit 9c3e7e
	UInteger8            domainNumber;
Packit 9c3e7e
	UInteger8            reserved2;
Packit 9c3e7e
} PACKED;
Packit 9c3e7e
Packit 9c3e7e
#define OUI_LEN 3
Packit 9c3e7e
struct clock_description {
Packit 9c3e7e
	struct static_ptp_text productDescription;
Packit 9c3e7e
	struct static_ptp_text revisionData;
Packit 9c3e7e
	struct static_ptp_text userDescription;
Packit 9c3e7e
	Octet manufacturerIdentity[OUI_LEN];
Packit 9c3e7e
};
Packit 9c3e7e
Packit 9c3e7e
struct dataset {
Packit 9c3e7e
	UInteger8            priority1;
Packit 9c3e7e
	struct ClockIdentity identity;
Packit 9c3e7e
	struct ClockQuality  quality;
Packit 9c3e7e
	UInteger8            priority2;
Packit 9c3e7e
	UInteger8            localPriority; /* Telecom Profile only */
Packit 9c3e7e
	UInteger16           stepsRemoved;
Packit 9c3e7e
	struct PortIdentity  sender;
Packit 9c3e7e
	struct PortIdentity  receiver;
Packit 9c3e7e
};
Packit 9c3e7e
Packit 9c3e7e
struct currentDS {
Packit 9c3e7e
	UInteger16   stepsRemoved;
Packit 9c3e7e
	TimeInterval offsetFromMaster;
Packit 9c3e7e
	TimeInterval meanPathDelay;
Packit 9c3e7e
} PACKED;
Packit 9c3e7e
Packit 9c3e7e
struct parentDS {
Packit 9c3e7e
	struct PortIdentity  parentPortIdentity;
Packit 9c3e7e
	UInteger8            parentStats;
Packit 9c3e7e
	UInteger8            reserved;
Packit 9c3e7e
	UInteger16           observedParentOffsetScaledLogVariance;
Packit 9c3e7e
	Integer32            observedParentClockPhaseChangeRate;
Packit 9c3e7e
	UInteger8            grandmasterPriority1;
Packit 9c3e7e
	struct ClockQuality  grandmasterClockQuality;
Packit 9c3e7e
	UInteger8            grandmasterPriority2;
Packit 9c3e7e
	struct ClockIdentity grandmasterIdentity;
Packit 9c3e7e
} PACKED;
Packit 9c3e7e
Packit 9c3e7e
struct parent_ds {
Packit 9c3e7e
	struct parentDS pds;
Packit 9c3e7e
	struct ClockIdentity *ptl;
Packit 9c3e7e
	unsigned int path_length;
Packit 9c3e7e
};
Packit 9c3e7e
Packit 9c3e7e
#define CURRENT_UTC_OFFSET  37 /* 1 Jan 2017 */
Packit 9c3e7e
#define INTERNAL_OSCILLATOR 0xA0
Packit 9c3e7e
Packit 9c3e7e
struct timePropertiesDS {
Packit 9c3e7e
	Integer16    currentUtcOffset;
Packit 9c3e7e
	UInteger8    flags;
Packit 9c3e7e
	Enumeration8 timeSource;
Packit 9c3e7e
} PACKED;
Packit 9c3e7e
Packit 9c3e7e
struct portDS {
Packit 9c3e7e
	struct PortIdentity portIdentity;
Packit 9c3e7e
	Enumeration8        portState;
Packit 9c3e7e
	Integer8            logMinDelayReqInterval;
Packit 9c3e7e
	TimeInterval        peerMeanPathDelay;
Packit 9c3e7e
	Integer8            logAnnounceInterval;
Packit 9c3e7e
	UInteger8           announceReceiptTimeout;
Packit 9c3e7e
	Integer8            logSyncInterval;
Packit 9c3e7e
	Enumeration8        delayMechanism;
Packit 9c3e7e
	Integer8            logMinPdelayReqInterval;
Packit 9c3e7e
	UInteger8           versionNumber;
Packit 9c3e7e
} PACKED;
Packit 9c3e7e
Packit 9c3e7e
#define FRI_ASAP (-128)
Packit 9c3e7e
Packit 9c3e7e
#endif