Blame foreign.h

Packit 9c3e7e
/**
Packit 9c3e7e
 * @file foreign.h
Packit 9c3e7e
 * @brief Defines a foreign clock record.
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_FOREIGN_H
Packit 9c3e7e
#define HAVE_FOREIGN_H
Packit 9c3e7e
Packit 9c3e7e
#include <sys/queue.h>
Packit 9c3e7e
Packit 9c3e7e
#include "ds.h"
Packit 9c3e7e
#include "port.h"
Packit 9c3e7e
Packit 9c3e7e
#define FOREIGN_MASTER_THRESHOLD 2
Packit 9c3e7e
Packit 9c3e7e
struct foreign_clock {
Packit 9c3e7e
	/**
Packit 9c3e7e
	 * Pointer to next foreign_clock in list.
Packit 9c3e7e
	 */
Packit 9c3e7e
	LIST_ENTRY(foreign_clock) list;
Packit 9c3e7e
Packit 9c3e7e
	/**
Packit 9c3e7e
	 * A list of received announce messages.
Packit 9c3e7e
	 *
Packit 9c3e7e
	 * The data set field, foreignMasterPortIdentity, is the
Packit 9c3e7e
	 * sourcePortIdentity of the first message.
Packit 9c3e7e
	 */
Packit 9c3e7e
	TAILQ_HEAD(messages, ptp_message) messages;
Packit 9c3e7e
Packit 9c3e7e
	/**
Packit 9c3e7e
	 * Number of elements in the message list,
Packit 9c3e7e
	 * aka foreignMasterAnnounceMessages.
Packit 9c3e7e
	 */
Packit 9c3e7e
	unsigned int n_messages;
Packit 9c3e7e
Packit 9c3e7e
	/**
Packit 9c3e7e
	 * Pointer to the associated port.
Packit 9c3e7e
	 */
Packit 9c3e7e
	struct port *port;
Packit 9c3e7e
Packit 9c3e7e
	/**
Packit 9c3e7e
	 * Contains the information from the latest announce message
Packit 9c3e7e
	 * in a form suitable for comparision in the BMCA.
Packit 9c3e7e
	 */
Packit 9c3e7e
	struct dataset dataset;
Packit 9c3e7e
};
Packit 9c3e7e
Packit 9c3e7e
#endif