summaryrefslogtreecommitdiff
path: root/third_party/ptpd-1.1.0/src/ptpd.h
blob: b0abe7efd9bfbab0cdbfccfa8e05caa9dec1b63d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * @file   ptpd.h
 * @mainpage Ptpd Documentation
 * @authors Martin Burnicki, Alexandre van Kempen, Steven Kreuzer,
 *          George Neville-Neil
 * @version 1.0
 * @date   Tue Jul 20 16:15:04 2010
 *
 *
 */

#ifndef PTPD_H
#define PTPD_H

/* Definitions and dependencies for the TI TivaWare port */
#include "constants.h"
#include "dep-tiva/constants_dep.h"
#include "dep-tiva/datatypes_dep.h"
#include "datatypes.h"
#include "dep-tiva/ptpd_dep.h"

/* arith.c */
UInteger32 crc_algorithm(Octet *, Integer16);
UInteger32 sum(Octet *, Integer16);
void    fromInternalTime(TimeInternal *, TimeRepresentation *, Boolean);
void    toInternalTime(TimeInternal *, TimeRepresentation *, Boolean *);
void    normalizeTime(TimeInternal *);
void    addTime(TimeInternal *, TimeInternal *, TimeInternal *);
void    subTime(TimeInternal *, TimeInternal *, TimeInternal *);

/* bmc.c */
UInteger8 bmc(ForeignMasterRecord *, RunTimeOpts *, PtpClock *);
void    m1 (PtpClock *);
void    s1 (MsgHeader *, MsgSync *, PtpClock *);
void    initData(RunTimeOpts *, PtpClock *);

/* probe.c */
void    probe(RunTimeOpts *, PtpClock *);

/* protocol.c */
void    protocol(RunTimeOpts *, PtpClock *);

/* Split versions of protocol() that may be used when no RTOS is present.
 * These functions were added by TI.
 */
void protocol_first(RunTimeOpts*,PtpClock*);
void protocol_loop(RunTimeOpts*,PtpClock*);

#endif