UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
ntp.h
Go to the documentation of this file.
1/*
2 * FILE: ntp.h
3 * AUTHOR: O.Hodson
4 *
5 * NTP utility functions to make rtp and rtp round time calculation
6 * a little less painful.
7 *
8 * Copyright (c) 2000 University College London
9 * All rights reserved.
10 *
11 * $Revision: 1.1 $
12 * $Date: 2007/11/08 09:48:59 $
13 *
14 */
15
16#ifndef _NTP_H
17#define _NTP_H
18
19#if defined(__cplusplus)
20extern "C" {
21#endif
22
23#define ntp64_to_ntp32(ntp_sec, ntp_frac) \
24 ((((ntp_sec) & 0x0000ffff) << 16) | \
25 (((ntp_frac) & 0xffff0000) >> 16))
26
27#define ntp32_sub(now, then) ((now) > (then)) ? ((now) - (then)) : (((now) - (then)) + 0x7fffffff)
28
29void ntp64_time(uint32_t *ntp_sec, uint32_t *ntp_frac);
30
31#if defined(__cplusplus)
32}
33#endif
34
35#endif /* _NTP_H */
void ntp64_time(uint32_t *ntp_sec, uint32_t *ntp_frac)
Definition ntp.c:26