state-faulty.c 610 Bytes
Newer Older
1
/*
2 3
 * Copyright (C) 2011 CERN (www.cern.ch)
 * Author: Aurelio Colosimo
4
 * Based on PTPd project v. 2.1.0 (see AUTHORS for details)
5 6
 *
 * Released according to the GNU LGPL, version 2.1 or any later version.
7
 */
8

Alessandro Rubini's avatar
Alessandro Rubini committed
9
#include <ppsi/ppsi.h>
10 11 12

/*
 * Fault troubleshooting. Now only prints an error messages and comes back to
13
 * PTP_INITIALIZING state after a 4-seconds grace period
14 15 16 17
 */

int pp_faulty(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
18 19 20 21
	if (pp_timeout(ppi, PP_TO_FAULTY)) {
		ppi->next_state = PPS_INITIALIZING;
		return 0;
	}
22
	ppi->next_delay = pp_next_delay_1(ppi, PP_TO_FAULTY);
23 24
	return 0;
}