Add support for reference clocks

This commit is contained in:
Miroslav Lichvar
2009-05-05 09:14:13 +02:00
parent ef3669fe1b
commit ac30bb06ef
14 changed files with 453 additions and 16 deletions

16
util.c
View File

@@ -247,6 +247,22 @@ UTI_TimestampToString(NTP_int64 *ts)
/* ================================================== */
char *
UTI_RefidToString(unsigned long ref_id)
{
unsigned int a, b, c, d;
char *result;
a = (ref_id>>24) & 0xff;
b = (ref_id>>16) & 0xff;
c = (ref_id>> 8) & 0xff;
d = (ref_id>> 0) & 0xff;
result = NEXT_BUFFER;
snprintf(result, BUFFER_LENGTH, "%c%c%c%c", a, b, c, d);
return result;
}
/* ================================================== */
char *
UTI_IPToDottedQuad(unsigned long ip)
{